Botkit: Bot not responding on a Slack channel

Created on 2 Mar 2017  路  15Comments  路  Source: howdyai/botkit

My bot responds in private, but fails to respond in a channel. I can invite/add bot to a channel, but it doesn't respond.

Slack-related help wanted

Most helpful comment

@sageexplorer I went through the same problem, and solved it as follows:
on the "Features" the "Event Subscriptions" section "Subscribe to Bot Events, click on the "Add Bot User Event", search for "message.channels | A message was posted to a channel", and after this..."Salve Changes"! I hope this helps you!

All 15 comments

What type of API is it using? If it is a events bot, did you add the appropriate events subscriptions when provisioning it on the slack side?

Thanks for the response. It is an events bot. I am not sure where to add the appropriate events subscription when provisioning. All I did was created a bot according to the steps defined in Botkit-Slack document. Is there a critical piece of information I am missing?

Did you get it working?

@peterswimm I'm having the same issue, tried the Medium post, first glitch/gomix says the project doesn't exist and then the events API Url doesn't work :/

@ChrisChinchilla Thats weird, it seems to work for me, maybe try the updated starter kit?

https://github.com/howdyai/botkit-starter-slack

Using the instructions from the article?

I still couldn't get the bot respond on a slack channel, so abandoned the effort and used socket.io instead. I would still love to have it working on a slack channel other than the private chat.

@sageexplorer the main cause of problems like this is users do not have the appropriate bot events subscriptions setup, if you want to give it a try sometime and tell us where it is not working for me, please let me know.

@sageexplorer I went through the same problem, and solved it as follows:
on the "Features" the "Event Subscriptions" section "Subscribe to Bot Events, click on the "Add Bot User Event", search for "message.channels | A message was posted to a channel", and after this..."Salve Changes"! I hope this helps you!

I am having the same issue with my bot. I am trying to get it to respond to messages that are said in a channel, but maybe not directed at the bot. I tried to search for "message.channels | A message was posted to a channel" but I was unable to find it. I currently have "message.channels", "message.groups", "message.im", "message.mpim". Do you have any suggestions?

I have same problem, if I post message in a channel the request from slack is send to my endpoint (I think it's because message.channels), but when I mention the bot, my endpoint didn't receive any request, even though I already add app_mention in "Subscribe to Bot Events". Am I missing something,.

Same issue. I have integrated my DialogFlow bot, and when I DM the bot I can see my request in the bot's history (and its response) but no response ever shows in Slack.

I am facing a bit similar issue, but the only difference is that my bot responded perfectly after integration. problem arises when I am trying to chat later (1-2 days). But it works fine in DF try out panel. How can I resolve this?

Also experiencing this. I have to say, it's a bummer. From everything I can see, they specifically do not support app_mention and there's no word on when/if they will. I suppose it's fine to ask people to chat with the bot directly in an IM, but having it listen to everything in a given channel and attempt to respond is a no-go and in general, not being able to treat it like another user in any Slack context makes it less usable.

I have a workaround that fixes this without adding additional scopes.

It is true, that you can just add additional permissions/scopes to your bot to make this work. However, if you're trying to limit bot permissions to the minimum (e.g. just app_mentions:read), then this is fixable.

Specifically, in lib/core.js testTrigger(), the problem is that the "message.text" for an app_mention event is null. However, the correct data is still contained in the message object in the incoming_message:

testTrigger specifically compares against message.text. But if that is changed to check against either:
message.text OR message.incoming_message.channelData.text

then this starts to work on app_mentions, without having to add extra oauth scopes.

let me know if you'd like a pull request on this.

Was this page helpful?
0 / 5 - 0 ratings