diff options
author | Ryan Huber <rhuber@gmail.com> | 2017-02-09 10:25:38 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2017-02-09 10:25:38 -0800 |
commit | b582aee685b983cca237ef233611da2f2c67080f (patch) | |
tree | 1d38d7ff47b0c76842feba943d48c3ce41b4b6a1 /wee_slack.py | |
parent | a21dfa3f79170d76f2f96ce2668938dca50ee0fc (diff) | |
download | wee-slack-b582aee685b983cca237ef233611da2f2c67080f.tar.gz |
msg works
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 16 |
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 |