aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2017-02-09 10:25:38 -0800
committerRyan Huber <rhuber@gmail.com>2017-02-09 10:25:38 -0800
commitb582aee685b983cca237ef233611da2f2c67080f (patch)
tree1d38d7ff47b0c76842feba943d48c3ce41b4b6a1 /wee_slack.py
parenta21dfa3f79170d76f2f96ce2668938dca50ee0fc (diff)
downloadwee-slack-b582aee685b983cca237ef233611da2f2c67080f.tar.gz
msg works
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index a5536ef..4f36dcd 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2394,6 +2394,22 @@ def me_command_cb(data, current_buffer, arg):
buffer_input_callback("EVENTROUTER", current_buffer, message)
return w.WEECHAT_RC_OK
+@slack_buffer_or_ignore
+def msg_command_cb(data, current_buffer, args):
+ dbg("msg_command_cb")
+ aargs = args.split(None, 2)
+ who = aargs[1]
+ command_talk(current_buffer, who)
+
+ if len(aargs) > 2:
+ message = aargs[2]
+ team = EVENTROUTER.weechat_controller.buffers[current_buffer].team
+ cmap = team.get_channel_map()
+ if who in cmap:
+ channel = team.channels[cmap[channel]]
+ channel.send_message(message)
+ return w.WEECHAT_RC_OK_EAT
+
def command_talk(current_buffer, arg):
"""
incomplete because globals hack