Bot Framework ErrorResponseException: "The bot referenced by the 'from' field is unrecognized" - botframework

My bot in Telegram worked fine for many months, and suddenly...
ErrorResponseException: "The bot referenced by the 'from' field is unrecognized"
It throws each time when my bot tries to reply to an incoming message.
The from field didn't change. The bot id in Telegram can't change.
I checked: the bot HTTP Request is sent with the correct bot id in the from.id field.
I use Microsoft.Bot.Builder v3.15.3 Nuget package

I had to renew the Telegram Bot access token
I went to #BotFather in Telegram and invoked the /revoke command to change the token to access HTTP API.
Then I went to my Functions bot in the Azure Portal, and on Channels section clicked on "Edit" on my Telegram bot. I pasted the new Access token, saved, and it works again!
What caused it?
Looks like the token somehow expired. I created my bot 355 days ago (Dec 14, 2017), and haven't changed the token since then.
But I'm not sure if it's the reason.
See how similar solution helped for Facebook bot.

I faced with the same issue for the Skype for Business channel. I haven't changed the from.id but the bot stoped to work correct. I seems Microsoft started to validate this field and before I had incorrect value of this one.
I just went throught the documentation (https://learn.microsoft.com/en-us/skype-sdk/skype-for-business-bot-framework/docs/overview) one more time and saw my mistake:
"from": {
"id": "sip:user#contoso.com",
"name": "Contoso User"
}

Related

Azure bot framework Slack channel "Slack API error" because of token_expired

I have a self-hosted Azure bot with a Slack channel. The bot is able to send proactive messages and respond to user mentions after I authorized it with Slack. However, this stops working after some period of inactivity. The request via botbuilder sdk results in "Slack API error" and the underlying error appears to be token_expired.
await turnContext.sendActivity({ text: 'Some message...', textFormat: 'markdown' });
I assumed that token refresh should be fully handled within the framework. Has anyone encountered this issue? Is there some specific configuration that is required?

microsoft bot framework - skype for business - error

I am using Microsoft Botframework to publish a bot (Channel Registration). When I try enabling the channels , I see the bot to be working in Slack , Skype, MS Teams & Web chat . However (despite following the steps to enable bot in SFB) I could not get the bot working in Skype for Business. I keep getting the error.
"Sorry, we ran into a problem at our end."
Neither do I see any log to debug.
Waited more than 24 hrs to ensure it is not the sync issue. But issue still remains. Any help appreciated !!
I am not clear with the error as to from which end it is being thrown.
I need you to follow the below steps:
Publish Bot in azure as an app service, through VS if you are coding through c#.
Create a "Bot channel registration" in azure and connect the above app service and Bot channel registration(simple use the URL of the app service append it with /api/messages and insert the same as messaging endpoint in Bot channel registration).
use the app id and app secret in bot solution and republish the app service.
Inside Bot channel registration click on channel and enable it for Skype for business(you will find your BOT in SFB using the credentials you have used to create the bot channel registration).
Finally got it working. What i noticed is the following
I faced the issue when I used the SIP URI as somebot#mydomain.com to register the bot in my tenant.
And i got it working when I used the SIP URI as somebot#mydomain.onmicrosoft.com.
Unsure on the reasoning though :)
And btw thanks #Tanmoy for your answer aswell !!

Post message to Slack channel as BOT not as APP

I am building a slack app and I am using the chat.postMessage API to post the message to user. I also have a bot user for my app and I am using the bot token for posting the message. When I post the message the message is shown as posted from my app not from my bot means posted message has my App name as the user who posted this message and just next to it 'APP' is written so looks like the app has posted this message but what I want is as I am posting as BOT using the bot token 'BOT' should be written down as with the bots of other slack apps. How do I achieve this. Is there any other parameter I need to pass for doing this. For your information I am passing the value of as_user as default which is true. Please help in achieving the desired behavior.

Bot framework Unable to use with Skype For Business

I've built a Bot using C#. I tested it using the emulator, web chat, direct line and Skype, and it's working as expected.
I followed the steps to register the bot with skype for business, I waited more than 24 hours to see what's happen.
So far, I can see the Bot as a contact, however, when I try to send a message, the error
"Error happened in Skype for business when reaching bot service. We
saved this conversation. You'll see it soon in the Conversations tab
in Skype for Business and in the Conversation History folder in
Outlook."
Looking for some logs or something, I collected some info, that I'm sharing here.
Analytics from BOT that proves that it's reaching it:
The Log for SFB channel said: "There was an error sending this message to your bot: HTTP status code NotFound"
It's look that the Bot endpoint is not available. When I registered it in SFB, I've been using NGROK (to run agains my machine), but later I've change it to a azure site.
"Old" endpoint is used yet today:
So, all I can guess is that Bot End Point was "registered" at the moment that I made the registration of my Bot in SFB, and now it's not possible to change it.
Does it make sense to anyone of you?
My problem seems to be kind of similar to Bot Framework - An error while sending a message from Skype for Business
Adrián
Ok, I'm sure the problem with the bot was the endpoint registration. I found a powershell script that update the endpoint.
I Opened Windows PowerShell as Administrator and run the ff scripts:
Import-PSSession (New-CsOnlineSession -Credential (Get-Credential))
Set-CsOnlineApplicationEndpoint -Uri sip:username#yourdomain.com
Obviously, I changed username#yourdomain.com with my own.
Then, after waiting 8 hours (or so), I was able to communicate with the bot, using SFB as channel.
Bot running as expected
I hope this can be useful for others.

Adding Channel Telegram to BotFramework not working

I'm trying to add a channel to my Bot at dev.botframework.com but when I try to submit the access token of telegram, I'm getting a Runtime Error.
I tryed a new Access token and an old one from a previous bot, but it don't work.
Is that an error in my bot or on the Website / at telegram? I can use the bot with the webchat without any Problems.
This was already fixed per this thread.

Resources