diff options
author | Tollef Fog Heen <tfheen@err.no> | 2016-09-24 22:49:41 +0200 |
---|---|---|
committer | Tollef Fog Heen <tfheen@err.no> | 2016-09-24 22:49:41 +0200 |
commit | 8cbf838cafd1d47bd4a0735dfaa34d08ada035e2 (patch) | |
tree | 72f853dc9f2a3d62d267d3d0a69b14e5ee818326 /wee_slack.py | |
parent | fdcc783b2136d28635344e06be47b385140a5d5b (diff) | |
download | wee-slack-8cbf838cafd1d47bd4a0735dfaa34d08ada035e2.tar.gz |
Print out topic when the user does /topic
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index f1ce9aa..4708aa6 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1327,10 +1327,16 @@ def command_openweb(current_buffer, args): @slack_buffer_or_ignore def topic_command_cb(data, current_buffer, args): - if command_topic(current_buffer, args.split(None, 1)[1]): + n = len(args.split()) + if n < 2: + channel = channels.find(current_buffer) + if channel: + w.prnt(current_buffer, 'Topic for {} is "{}"'.format(channel.name, channel.topic)) + return w.WEECHAT_RC_OK_EAT + elif command_topic(current_buffer, args.split(None, 1)[1]): return w.WEECHAT_RC_OK_EAT else: - return w.WEECHAT_RC_OK + return w.WEECHAT_RC_ERROR def command_topic(current_buffer, args): """ |