A common scenario in BOT world is you want to notify something or send some message to a backend agent proactively. The official domo of Microsoft Bot demonstrate how to achieve that. But the conversation is initiated by the user, not start from the Bot.
Skype for Business team published a document about SfB channel and Bot Framework. In this doc, they mentioned how to create outbound bots using C# Bot Builder SDK. However, the sample code is incomplete and doesn’t tell us how to send a message to the conversation.
Prerequisite:
- A Bot service with Skype for Business channel enabled.
- The instance of your bot with a Skype for Business Online tenant is registered.
See more:
https://docs.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-skypeforbusiness
https://msdn.microsoft.com/en-us/skype/skype-for-business-bot-framework/docs/overview
After further testing, here is my sample code which can initial a conversation from bot to a specific SfB user and send message to the user in same conversation:
1 | //Initiate a Conversation |