aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 8b411b6..7f01550 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -4006,10 +4006,17 @@ command_thread.completion = '%(threads)'
@utf8_decode
def command_reply(data, current_buffer, args):
"""
+ When in a channel buffer:
/reply [-alsochannel] <count/message_id> <text>
- Reply in a thread on the message. Specify either the message id, a count
- upwards to the message from the last message, or, if you are already in a
- thread, nothing.
+ Reply in a thread on the message. Specify either the message id or a count
+ upwards to the message from the last message.
+
+ When in a thread buffer:
+ /reply [-alsochannel] <text>
+ Reply to the current thread. This can be used to send the reply to the
+ rest of the channel.
+
+ In either case, -alsochannel also sends the reply to the parent channel.
"""
channel = EVENTROUTER.weechat_controller.buffers[current_buffer]
parts = args.split(None, 1)
@@ -4019,18 +4026,15 @@ def command_reply(data, current_buffer, args):
else:
broadcast = False
- try:
- if isinstance(channel, SlackThreadChannel):
- text = args
- else:
- msg_id, text = args.split(None, 1)
- except ValueError:
- w.prnt('', 'Usage: /reply [-alsochannel] <count/id> <message>')
- return w.WEECHAT_RC_OK_EAT
-
if isinstance(channel, SlackThreadChannel):
+ text = args
msg = channel.parent_message
else:
+ try:
+ msg_id, text = args.split(None, 1)
+ except ValueError:
+ w.prnt('', 'Usage (when in a channel buffer): /reply [-alsochannel] <count/id> <message>')
+ return w.WEECHAT_RC_OK_EAT
msg = get_msg_from_id(channel, msg_id)
if msg: