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

DirectMentions are never detected #3

Open
EmmaSimon opened this issue May 25, 2016 · 6 comments
Open

DirectMentions are never detected #3

EmmaSimon opened this issue May 25, 2016 · 6 comments

Comments

@EmmaSimon
Copy link

When using the starter-go-bot, it creates a subrouter with bot.Messages(slackbot.DirectMessage, slackbot.DirectMention).Subrouter(). Direct messages work fine, but direct mentions do not. At the point when Hear is called on this router, the botID of the bot is not set, and so neither is the botID of the route or the router. However, when the bot is run, the botID of the routers still never gets set. So when Utils.IsDirectMention is called, it's always checking for the regex ^<@>.*.

This can be fixed if you add the line b.SimpleRouter.SetBotID(ID) to Bot.setBotID, then when the bot is run and initialized, it sets the ID for all the existing routers and routes.

@jaimem88
Copy link

jaimem88 commented Nov 7, 2016

+1
Simple fix, it works for me! Thanks @EmmaSimon

@CK-Ward
Copy link

CK-Ward commented May 24, 2017

This doesn't work for me

@EmmaSimon
Copy link
Author

@CelinaWard Did you try merging the pull request into your repo? There's also a fork mentioned in the comments of it that should include this fix and a few others.

@CK-Ward
Copy link

CK-Ward commented May 25, 2017 via email

@EmmaSimon
Copy link
Author

@CelinaWard Double check that it's the same as this: https://github.com/BeepBoopHQ/go-slackbot/pull/4/files
Alternately just clone https://github.com/adampointer/go-slackbot instead of this repo.

@CK-Ward
Copy link

CK-Ward commented May 25, 2017 via email

flw-cn pushed a commit to flw-cn/go-slackbot that referenced this issue Jun 25, 2018
liamsorsby pushed a commit to liamsorsby/go-slackbot that referenced this issue Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants