aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-08-28 15:24:54 -0700
committerRyan Huber <rhuber@gmail.com>2015-08-28 15:24:54 -0700
commita37787d8b18dba4864f14611ec48a08cdef67c98 (patch)
treed811b898f942eb567b62056b102f4d0e513aa3be /wee_slack.py
parent4c860f0648bcb62ed1c6386bb612f1a6a8044a1e (diff)
parentc6c5ae4d2ddc8d5edf83f78e17ced0217de1d040 (diff)
downloadwee-slack-a37787d8b18dba4864f14611ec48a08cdef67c98.tar.gz
Merge pull request #104 from rawdigits/tfheen/distracting-channel-required
Require /slack distracting to be run from a channel buffer
Diffstat (limited to 'wee_slack.py')
-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)