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

Make hubot respond to @-mentions #115

Closed
wants to merge 2 commits into from

Conversation

ianfixes
Copy link

Fixes #106

Assumes bot name and bot's slack username are the same (which seems reasonable).

@ianfixes
Copy link
Author

Whoops, one bug to fix.

@ianfixes ianfixes closed this Dec 12, 2014
@@ -103,6 +111,11 @@ class SlackBot extends Adapter
# If this is a DM, pretend it was addressed to us
if msg.getChannelType() == 'DM'
txt = "#{@robot.name} #{txt}"
# Or, if we were @-mentioned
else if matches = txt.match(/<@(.+)>:\s?(.*)/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a safer regex here would be /<@([^>]+)>:\s?(.*)/ for cases where the message contains ">:".

@paulhammond
Copy link
Contributor

I'm sorry, my changes in #113 have made this unmergeable.

I've taken the idea behind this fix, applied it a bit more widely, and turned it into #120, which fixes this bug and a few others. Thank you for the idea on how to fix it!

@ianfixes ianfixes mentioned this pull request Dec 16, 2014
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

Successfully merging this pull request may close these issues.

Hubot not responding to @-mentions
4 participants