aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorV13Axel <alex@stechstudio.com>2017-04-13 17:58:15 -0400
committerV13Axel <alex@stechstudio.com>2017-04-13 17:58:15 -0400
commitaf0e8b2d0139e0445786546700e1545a28a64711 (patch)
tree0c8de8b2e925744f2b00ab8e88c359867d8dbe71 /wee_slack.py
parent843de1a69d12f8811dd988ac6f6990e71917a4af (diff)
downloadwee-slack-af0e8b2d0139e0445786546700e1545a28a64711.tar.gz
Add command for setting Slack Status
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index d5acd59..2caf66c 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2760,6 +2760,32 @@ 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}
+
+ team = EVENTROUTER.weechat_controller.buffers[current_buffer].team
+ 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'