aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2019-06-01 21:52:25 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2019-06-02 23:09:20 +0200
commit86c93bc57766affd309b52d70a7a692f4ad1fce6 (patch)
treeef861205894bc1366775ca4396fc6c7e5aad3acf
parenta648de170db0b974857c669480bd5188a12f8219 (diff)
downloadwee-slack-86c93bc57766affd309b52d70a7a692f4ad1fce6.tar.gz
Print error when a command is not used on an appropriate buffer
-rw-r--r--wee_slack.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py
index a789600..18ff60b 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -122,6 +122,8 @@ def slack_buffer_required(f):
@wraps(f)
def wrapper(data, current_buffer, *args, **kwargs):
if current_buffer not in EVENTROUTER.weechat_controller.buffers:
+ command_name = f.__name__.replace('command_', '', 1)
+ w.prnt('', 'slack: command "{}" must be executed on slack buffer'.format(command_name))
return w.WEECHAT_RC_ERROR
return f(data, current_buffer, *args, **kwargs)
return wrapper