From b61e5c0d28332bacb477ca666ba212204e445398 Mon Sep 17 00:00:00 2001 From: Douglas Zanco Franco Date: Thu, 5 Oct 2017 13:20:52 -0300 Subject: created '/slack users' and '/slack channels' command --- wee_slack.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'wee_slack.py') 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): -- cgit