aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rw-r--r--wee_slack.py4
2 files changed, 9 insertions, 1 deletions
diff --git a/README.md b/README.md
index 8808b74..276bbd4 100644
--- a/README.md
+++ b/README.md
@@ -186,6 +186,12 @@ Run a Slack slash command. Simply prepend `/slack slash` to what you'd type in t
/slack slash /desiredcommand arg1 arg2 arg3
```
+To send a command as a normal message instead of performing the action, prefix it with a slash or a space, like so:
+```
+//slack
+ s/a/b/
+```
+
#### Threads
Start a new thread on the most recent message The number indicates which message in the buffer to reply to, in reverse time order:
diff --git a/wee_slack.py b/wee_slack.py
index c354bf5..2cdbb8f 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -644,7 +644,7 @@ def buffer_input_callback(signal, buffer_ptr, data):
if not channel:
return w.WEECHAT_RC_ERROR
- reaction = re.match("^\s*(\d*)(\+|-):(.*):\s*$", data)
+ reaction = re.match("^(\d*)(\+|-):(.*):\s*$", data)
substitute = re.match("^(\d*)s/", data)
if reaction:
if reaction.group(2) == "+":
@@ -664,6 +664,8 @@ def buffer_input_callback(signal, buffer_ptr, data):
old = old.replace(r'\/', '/')
channel.edit_nth_previous_message(msgno, old, new, flags)
else:
+ if data.startswith(('//', ' ')):
+ data = data[1:]
channel.send_message(data)
# this is probably wrong channel.mark_read(update_remote=True, force=True)
return w.WEECHAT_RC_OK