diff options
-rw-r--r-- | README.md | 13 | ||||
-rw-r--r-- | wee_slack.py | 25 |
2 files changed, 38 insertions, 0 deletions
@@ -13,6 +13,7 @@ A WeeChat native client for Slack.com. Provides supplemental features only avail Features -------- * **New** [Threads](#threads) support! + * **New** [Slack Status](#status) support! * Slash commands (including custom ones!) * Upload to slack capabilities! * Emoji reactions! @@ -209,6 +210,18 @@ Label a thread with a memorable name. The above command will open a channel call ``` _Note: labels do not persist once a thread buffer is closed_ +#### Status + +Set your Slack status on a given team: +``` +/slack status [:emoji:] [Status message] +``` + +Example: +``` +/slack status :ghost: Boo! +``` + Optional settings ----------------- diff --git a/wee_slack.py b/wee_slack.py index 4122254..a3d43ce 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -3030,6 +3030,31 @@ def command_away(data, current_buffer, args): @slack_buffer_required +def command_status(data, current_buffer, args): + """ + Lets you set your Slack Status (not to be confused with away/here) + /slack status [emoji] [status_message] + """ + e = EVENTROUTER + channel = e.weechat_controller.buffers.get(current_buffer, None) + if channel: + team = channel.team + + if args is None: + server.buffer_prnt("Usage: /slack status [status emoji] [status text].") + return + + split_args = args.split(None, 2) + emoji = split_args[1] if len(split_args) > 1 else "" + text = split_args[2] if len(split_args) > 2 else "" + + profile = {"status_text":text,"status_emoji":emoji} + + s = SlackRequest(team.token, "users.profile.set", {"profile": profile}, team_hash=team.team_hash, channel_identifier=channel.identifier) + EVENTROUTER.receive(s) + + +@slack_buffer_required def command_back(data, current_buffer, args): """ Sets your status as 'back' |