aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorDouglas Zanco Franco <douglas.franco@dzfweb.com.br>2017-10-05 13:20:52 -0300
committerTrygve Aaberge <trygveaa@gmail.com>2017-10-25 23:27:40 +0200
commitb61e5c0d28332bacb477ca666ba212204e445398 (patch)
tree09b5818b9297b5176090dd462880144a239964d6 /wee_slack.py
parent37b3c1c670aee7b160eb74cb6b80e53c6a10ff2d (diff)
downloadwee-slack-b61e5c0d28332bacb477ca666ba212204e445398.tar.gz
created '/slack users' and '/slack channels' command
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 50b0655..831a9f2 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2953,6 +2953,30 @@ def msg_command_cb(data, current_buffer, args):
return w.WEECHAT_RC_OK_EAT
+@slack_buffer_required
+@utf8_decode
+def command_channels(data, current_buffer, args):
+ e = EVENTROUTER
+ team = e.weechat_controller.buffers[current_buffer].team
+
+ team.buffer_prnt("Channels:")
+ for channel in team.get_channel_map():
+ team.buffer_prnt(" {}".format(channel))
+ return w.WEECHAT_RC_OK_EAT
+
+
+@slack_buffer_required
+@utf8_decode
+def command_users(data, current_buffer, args):
+ e = EVENTROUTER
+ team = e.weechat_controller.buffers[current_buffer].team
+
+ team.buffer_prnt("Users:")
+ for user in team.users.values():
+ team.buffer_prnt(" {:<25}({})".format(user.name, user.presence))
+ return w.WEECHAT_RC_OK_EAT
+
+
@slack_buffer_or_ignore
@utf8_decode
def command_talk(data, current_buffer, args):