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

how to no @hubot ,bot can response in channel ? #555

Open
sssss31302 opened this issue Mar 20, 2019 · 1 comment

Comments

@sssss31302
Copy link

commented Mar 20, 2019

me:@hubot help
hubot:$%^$^
|
|
ˇ
me:help
hubot:$%^$^

Description

Describe your issue here.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

@sinisterstuf

This comment has been minimized.

Copy link
Contributor

commented Aug 21, 2019

Use robot.respond when you want the robot to respond directly to messages addressed to it, as in your me:@hubot help example and use robot.hear for any messages said in channel, as in your me:help example.

The following code would get the your above example working as-is:

module.exports = (robot) ->
  robot.hear /help/, (res) ->
    res.send "$%^$^"

The example code is based on the examples from the hearing and responding section of the Hubot basic scripting documentation.

This is a general Hubot scripting question, not specific to Slack, so I propose closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.