I have created a proactive bot that basically asks certain questions to a user when a user starts conversation with the bot. The bot is deployed in Microsoft Teams environment. Is there any way that i can send automated message to a bot in a channel? I know messages can be sent using powershell by utilizing webhook url exposed by a particular team or using MS Flow. But I want to mention bot (e.g. @mybothandle) in the message so the bot starts asking questions by itself than requiring the user to start the conversation (by mentioning the bot manually) but not finding the way to mention. Your suggestions are welcome.
相关问题
- Pass custom debug information to Microsoft bot fra
- PromptDialog Choice with List object Bot Framework
- Using Bot State Accessors Inside Dialogs
- Correct id to send message to a skype account
- Is that possible to develop localization in Micros
相关文章
- “Uploading custom apps is not allowed” When Instal
- How to receive an image send by users?
- Detect end of conversation and ask for a feedback
- How to hook real-time audio stream endpoint to Dir
- In Azure Bot Framework's WaterfallDialog, how
- Create Microsoft Team Tab with API
- Adaptive Cards in Carousel Layout in Facebook Mess
- Handling Adaptive cards in Microsoft Bot Framework
To all Future Visitors, Microsoft Graph API (Beta) now provides a way to send message and mention the bot/user using following endpoint:
Method: POST
Body:
However, there is a bug that bot doesn't respond when receives the message: Bot is not responding to @Mention when sending message using Graph API
Basically you want to message the user directly at a specific point in time (like 24 hours later). I'm doing this in a few different bots, so it's definitely possible. The link that Wajeed has sent in the comment to your question is exactly what you need - when the user interacts with your bot, you need to save important information like the conversation id, conversation type, service url, and To and From info. You can store this, for instance, in a database, and then you can actually have a totally separate application make the call AS IF IT WAS your bot. In my bots, for example, I have the bot hosted in a normal host (e.g. Azure Website) but then have an Azure Function that sends the messages, for example, 24 hours later. It just appears to the user as if it was a message from the bot, like normal.
You will also need the Microsoft App ID and App Password for your bot, which you should have already (if not, it's in the Azure portal).
In your "sending" application, you're going to need to create an instance of Microsoft. Bot.Connector.ConnectorClient, like follows:
You also need to "trust" the service url you're calling, like this:
Then you create an instance of Microsoft.Bot.Schema.Activity, set the required properties, and send it via the connector you created:
All the items in square braces are what you get from the initial conversation the user is having with the bot, except that the From and To are switched around (when the user sends your bot a message, the user is the FROM and your Bot is the TO, and when the bot is sending you switch them around.
Hope that helps