-
Notifications
You must be signed in to change notification settings - Fork 16
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
Hubot doesn't react on direct messages when talking directly to him with @myhubot #5
Comments
avoiding the mentions to be removed from the message itself
@daconstenla were you trying this in a DM or Room? |
I'm having the same problem. Perhaps I'm misunderstanding how this works. Should the regex pattern to match a handler include the bot's name in it? for example, if the bot name is |
@joeyguerra check the changes I made on the branch issue-5, by doing that, bot answers to my messages since message has the name of the bot on the message, otherwise is stripped from the message. @dgliu-f82 I've tried with both approaches, DM's and Rooms, either way doesn't work as expected unless my change is applied. |
Yeah. Especially after reading this:
i believe using |
@daconstenla did you accept the code commit agreement? Gotta do that first. |
I want to but since I did the contribution during working hours, I theoretically did the contribution as "company" and so I need my company to agree with the license before clicking the button 🤔 |
maybe @dgliu-f82 can make the change instead of accepting the pull request then? |
I believe the regex shouldn't contain the bot's name according to Hubot API. See the examples here: |
Unfortunately, the code assumes that the bot's name is in the text.
gets prepended to the regex pattern that the scripts set (where |
I see. I missed the difference between hear and respond earlier. For respond, Hubot automatically prepends the robot's name into the regex passed by the caller in order to match only messages directed at the bot. I think it does make sense for the Hangouts Chat adapter to pass the original text instead of argumentText. We will update the code shortly. |
Just to clarify though, Hangouts Chat today doesn't invoke a bot unless it's @mentioned in a room as I mentioned earlier #5 (comment). |
Yeah, that's where the design of Hubot and integrations design of Google Chat are not congruent. Which is exactly what the Adapter Pattern is supposed to solve. And in this case, I feel like this module should adapt Google Chat's integration designs to conform to Hubots design. |
Hi all, I've been playing around with hubot integration of hangouts chat and is not working is said in the documentation, according to it, hubot should answer back on any mention as:
but with google chat integration bot only reacts when it's mentioned with
@
when it's mentioned twice, for example:after enabling
DEBUG=true
I've seen that in the received body is getting theraw
message astext
field but it's processing the fieldargumentedText
which strips user's mention.possible solution
I've made a small change on the
HangoutsChatTextMessage
object creation to use receivedmessage.text
and then it works as expected, any reason why on the implementation the object is being created withargumentText
? I haven't seen any difference but mentioned removed from the message.raw json body of an example message with mention
Thanks!
The text was updated successfully, but these errors were encountered: