aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2015-08-29 00:20:57 +0200
committerTollef Fog Heen <tfheen@err.no>2015-08-29 00:20:57 +0200
commitc6c5ae4d2ddc8d5edf83f78e17ced0217de1d040 (patch)
treed811b898f942eb567b62056b102f4d0e513aa3be
parent4c860f0648bcb62ed1c6386bb612f1a6a8044a1e (diff)
downloadwee-slack-c6c5ae4d2ddc8d5edf83f78e17ced0217de1d040.tar.gz
Require /slack distracting to be run from a channel buffer
Running this from a server buffer makes no sense, so output an error if you do that.
-rw-r--r--wee_slack.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 21ce03f..eae2e1d 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -957,6 +957,9 @@ def command_nodistractions(current_buffer, args):
def command_distracting(current_buffer, args):
global distracting_channels
distracting_channels = [x.strip() for x in w.config_get_plugin("distracting_channels").split(',')]
+ if channels.find(current_buffer) is None:
+ w.prnt(current_buffer, "This command must be used in a channel buffer")
+ return
fullname = channels.find(current_buffer).fullname()
if distracting_channels.count(fullname) == 0:
distracting_channels.append(fullname)