Microsoft Bot Framework integration with Slack is broken - bots

I am developing chatbot for Slack using Microsoft Bot Framework. The Web app is hosted on azure. We have few installations.
Everything worked fine before this morning when I saw that new bot just didn't respond (the old one is still working).
We've been experimenting on permissions and auth keys on slack, so I thought that was the reason. But I tried to reinstall the app, bot user, auth keys etc from scratch and it didn't help. My configured endpoint just don't hit.
I think the issue is in communication between Slack and Microsoft Bot Framework, 'cos when I'm testing from chatbot panel's web client everything is working fine. Also, Slack representatives confirmed that there's no problem from their side.
UPDATE: I re-checked all credentials again and seems like it's working, don't know what was the issue. But two side questions still actual:
1) Can I test this channel of communication somehow? Cos when my endpoint didn't hit I can't get any info on what is happening. I have 0 errors on Microsoft Bot Framework web console.
2) Docs on configuring slack channel have changed recently and now it suggesting to add "Subscribe to Bot Events", while everything worked w\o it. Can you elaborate on that? Also, it's not quite clear what is {YourBotHandle} docs referring to in https://slack.botframework.com/api/Events/{YourBotHandle}

Usually, the Bot Framework Portal is the place to see if any channel is reporting errors with your bot. You can also check https://github.com/Microsoft/BotBuilder/issues just in case there is a general problem with a channel.
Regarding the second question, {YourBotHandle} refers to the handle that you provided at the time of registering your bot, as explained here.
As far as why you need to subscribe to bot events, first I would recommend you to read the documentation about Events on Slack (here), but long story short, this allows the bot to subscribe to events and be notified when those happen instead of having the bot asking Slack if something happened or not.
One way to use the Events API is as an alternative to opening
websocket connections to the real time messaging API. Instead of
maintaining one or more long-lived connections for each team an
application is connected to, you simply set up one or more endpoints
on your own servers to receive events atomically in near real-time.

Related

ms teams custom app starting a chat session with a bot

I'm building a teams app that contains some tabs and a bot.
Is it possible to, when an action is performed on a tab (i.e. clicking a button), initialize automatically a chat with the bot, or send a specific message?
Tks
Based on the comments above, what you're looking to do is implement "pro-active" messaging, where the bot itself initiates the conversation. It's definitely possible, and you can read more to get started here and here. The most important thing to know is that your user has to have installed the bot already, to get a "conversation context", but if they've installed the app, which includes the bot, to get the tab, then you're fine. You need to get some variables when they do install the app, which you hook into the conversationUpdate event to get access to. Give it a go and let me know if you have specific questions, here on SOverflow.

Chat messages from Dialogflow don't appear in Slack

I'm creating a bot with Dialogflow. It's quite straigtforward, and it worked on Telegram in no time. But things complicated when trying to integrate Dialogflow with Slack.
My bot is able to read direct messages from Slack, and I'm sure of it because the messages from Slack appear in the History section of Dialogflow. Good news there. In the same screen, I can see that Dialogflow answered all the messages Slack sent to it. But sadly, those answers don't appear in Slack.
By the way, just to confuse me more, the Dialogflow's test bot works flawlessly with Slack, publishing there with no issue. So, it's not anything related with the common values you have to copy from Slack and paste to Dialogflow to enable the integration.
It seems that my bot on Slack misses some kind of permission of the OAuth & Permissions screen, but I've tried some of theme, and I can't find the good one. Right now I'm using bot, chat:write:bot, im:write, and channels:read. I guess that only the two first ones are needed, but I'm totally lost and tried adding permissions with no reason. And then, I wrote this post.
Is there someone who has a simple bot that sends messages in direct messages on Slack? What are the needed permissions?
I had the same issue, it's quite easy to solve: just go on Manage Distribution in your bot's Slack API panel and click on the "Add to Slack" button.
That's all!
Under OAuth & Permissions, add "chat:write" to OAuth Scope. That will allow your bot to send messages to other users.

An issue when authorizing Facebook pages in Bot Framework

The issue originates from the bot framework itself, when I add a new Facebook channel for the first time everything works as expected, what I am trying to do is connecting multiple FB pages to the same bot, I read somewhere that you can do this by re-entering the page info and clicking "resubmit", the problem is when the "resubmit" button is clicked without first clicking "Deauthorize" first causes a problem, when I analyzed the request with the browser's inspector it seems that EnableChannelForBot method throws an error.
Also we are developing a service where users can register and link their FB pages to the bot just like ChatFuel or any other famous bot platform, the main problem is that bot framework is asking for a specific page id and access token per FB bot and you must do it manually through the bot framework dashboard, can we have an easy way to register the bot to multiple FB pages and without having to do so manually through an API or something Similar? Please work with us to provide a solution for this as soon as you can, Bot Framework is vital to our work and migrating to another SDK is going to be very costly and time-consuming.
I don't think that connecting multiple Facebook pages to the same bot is supported. Where did you read that?
Also, there is no API currently you can leverage on to register your bot/enable Facebook channel.

How to set Slack bot presence "online" when using Events API

I have a bot for Slack implemented using RTM (https://api.slack.com/rtm) which works well but requires WebSocket connections for each user active all the time. After rewriting it using new Events API (https://api.slack.com/events) the bot works well too but appears "away" all the time. Apparently Slack determines bot's status by checking WebSocket connection which is not good as my goal is to use Events API only. Is it possible to use Events API and make a bot appear "online"?
It's one of the two reasons that we don't move to Events API for our bot. The second is that typing events are not send with Events API.
For what we know (dev4slack community, Slack's direct contacts), Slack works at make able to indicate online presence without the RTM, for bots using Events API. That seems essential, without that, Events API seems to be a half solution.
Now with the RTM gone. Slack announced that the only way to toggle your bot presence is via the app management page.
Official Tweet here.

Skype Echo Bot for NodeJS: Messages Not Appearing in Skype App

I am following this Echo Bot Tutorial, and have gone through all of the basic steps regarding setup and registration. I am following the steps (near the bottom) regarding local testing, and have been using ngrok successfully.
I was able to add my Skype Bot as a contact, and I also have the latest version of the Skype app (Mac). When I send a message to the bot via the Skype app, I see the message appear in the debug notes in my terminal window. So I know that the messages I type are coming through.
I also see this:
skype-sdk.MessagingServiceClientV2 Sending message to 8:username with content Hey 8:username. Thank you for your message: "test".
However, I do not see any kind of reply in my Skype application. My expectation is that the bot would echo back my message to me.
My questions are:
1) When testing locally using the ngrok method described in the tutorial, should I be able to see activity from the Skype bot (in terms of messages to me)?
2) I am guessing this may be some an authentication issue? How can I best troubleshoot things, and get the Skype bot to actually respond in the Skype app?
I feel like I am incredibly close to getting this working, in that the messages I send are coming through... but the messages I expect from the Skype bot are not coming through. Any help or ideas greatly appreciated!
Found the fix, and posting it here should anyone else run into the same issue.
During the setup process, when I was using the Application Registration Portal, I selected the wrong string as my Application Secret.
Originally, I clicked on Generate New Key Pair, which resulted in a new entry appearing in the admin labeled Private Key. I used this string as my App Secret.
However, it appears that what I should have done was click on Generate New Password and used *that string instead**. Just gave it a try, and my bot is now responding back to me locally (in the Skype app), when testing with ngrok.
I think this particular distinction could have been made clearer in the documentation, as I lost a great deal of time due to this one oversight. Oh well, at least I can start developing now...

Resources