Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for alternative slack autocomplete syntax #17

Closed
cakejelly opened this issue Aug 30, 2015 · 5 comments
Closed

Support for alternative slack autocomplete syntax #17

cakejelly opened this issue Aug 30, 2015 · 5 comments

Comments

@cakejelly
Copy link

I just noticed this when following your Mathbot tutorial. @mathbot: calculate works but mathbot: calculate doesn't.

The syntax for the second command can be a result of slacks autocomplete (unless you switch it off) and you need to explicitly add it as an alias to get it working. Can we support this by default?

@dblock
Copy link
Collaborator

dblock commented Aug 30, 2015

I believe I had implemented this in dblock@80e2321, but haven't updated mathbot. Can you please try this with HEAD of slack-ruby-bot on mathbot to confirm? I can release 0.4.4 shortly if that works.

@cakejelly
Copy link
Author

80e2321 allows you to address your bot via @<botname>... but if you begin typing your bots name without '@' and press tab, the following text will be entered: <botname>:.This isn't picked up as a valid alias. Instead, it recognises <botname> as the alias and treats everything else as your command, resulting in Sorry @cakejelly, I don't understand that command!

Currently i'm using the following as a workaround:

SlackRubyBot.configure do |config|
  config.aliases = ['mathbot:']
end

I only took a brief look at the code, but I think adding "#{user}:" to names (https://github.com/dblock/slack-ruby-bot/blob/master/lib/slack-ruby-bot/config.rb#L13) could solve this

@dblock
Copy link
Collaborator

dblock commented Aug 31, 2015

Yep, do you want to try a PR with a test?

@cakejelly
Copy link
Author

Yeah will do :) Will try get one up later on.

@dblock dblock closed this as completed in 715ff28 Sep 23, 2015
@dblock
Copy link
Collaborator

dblock commented Sep 23, 2015

Implemented in dblock@715ff28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants