diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-01-19 06:34:23 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-01-19 06:34:23 -0800 |
commit | 85118421b9614f2ebe35a29483b59634a1b50bd0 (patch) | |
tree | 85110cb93464bf3862a06e67d86f28b19a718462 /wee_slack.py | |
parent | 1e83acd38abfb46d5e9f78b75192805529e75853 (diff) | |
download | wee-slack-85118421b9614f2ebe35a29483b59634a1b50bd0.tar.gz |
prevent ambigous /slack join
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 7156719..910acd7 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -680,8 +680,18 @@ def command_talk(current_buffer, args): def command_join(current_buffer, args): - servers.find(current_domain_name()).channels.find(args).open() - + domain = current_domain_name() + if domain == "": + if len(servers) == 1: + domain = servers[0] + else: + w.prnt(current_buffer, "You are connected to multiple Slack instances, please execute /join from a server buffer. i.e. (domain).slack.com") + return + channel = servers.find(domain).channels.find(args) + if channel != None: + servers.find(domain).channels.find(args).open() + else: + w.prnt(current_buffer, "Channel not found.") def command_channels(current_buffer, args): server = servers.find(current_domain_name()) |