diff options
author | Ryan Huber <rhuber@gmail.com> | 2017-04-18 09:49:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-18 09:49:07 -0700 |
commit | f4746f965bc54e2511fa6adc9ec9909c88c4f479 (patch) | |
tree | dec30c132cf51b749a62575ed456591f1cc92f8b /wee_slack.py | |
parent | 27276faabffd3c63623d9215e1b39f3e06afc307 (diff) | |
parent | 8e59ca670cfc417c412449077784ddd662c9fda5 (diff) | |
download | wee-slack-f4746f965bc54e2511fa6adc9ec9909c88c4f479.tar.gz |
Merge pull request #347 from V13Axel/status_command
Add command for setting Slack Status
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 25 |
1 files changed, 25 insertions, 0 deletions
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' |