Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Not getting @here in routes #109

Open
kendrickm opened this issue Oct 26, 2016 · 2 comments
Open

Not getting @here in routes #109

kendrickm opened this issue Oct 26, 2016 · 2 comments

Comments

@kendrickm
Copy link

I'm trying to write a plugin that listens for someone to use '@here' in a channel. It would then compare them against a specific group, and if they're not in that group give them a polite private message asking them not to notify everyone in the channel. The issue I'm having is it seems that @here isn't getting handled like normal text is. I created a test route that simply echoed any text back it heard, and it did fine until @here was used. I then see this stack trace

Slack API call to chat.postMessage returned an error: no_text.
Full backtrace:
/var/bundle/ruby/2.3.0/gems/lita-slack-1.8.0/lib/lita/adapters/slack/api.rb:99:in call_api' /var/bundle/ruby/2.3.0/gems/lita-slack-1.8.0/lib/lita/adapters/slack/api.rb:59:insend_messages'
/var/bundle/ruby/2.3.0/gems/lita-slack-1.8.0/lib/lita/adapters/slack.rb:43:in send_messages' /var/bundle/ruby/2.3.0/gems/lita-4.7.1/lib/lita/robot.rb:129:insend_messages'
/var/bundle/ruby/2.3.0/gems/lita-4.7.1/lib/lita/message.rb:93:in `reply'
Is this a slack issue(not sending that message through their bot api) or something on the lita side? I'm not finding much searching around for other people trying to do this.

Thanks

@codewithtyler
Copy link

codewithtyler commented Oct 26, 2016

Hi @kendrickm we've been doing something similar with our bot. We're listening for the @channel and then posting a message based on that. You're welcome to see how we're doing it here.

I believe we were able to implement it via the lita-static-meme plugin.

@kendrickm
Copy link
Author

@RandomlyKnighted Thanks for the suggestion. I just tried that out and it looks like @channel works, but @here doesn't. I'm wondering if Slack doesn't view a bot user as 'here' when it builds a list of users to send the message to?

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

No branches or pull requests

2 participants