1
votes

I've created a bot in .NET using the Azure Bot Framework and I've tested successfully in the emulator.

I want to create a local .net console application that can listen to my bot conversations using the Direct Line API and perform simple tasks as well as respond in the conversation.

I can't find a complete example of how to begin poling the message endpoint to listen for messages and then respond. I've scoured the original Azure documentation and I can't find anything.

https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-concepts?view=azure-bot-service-4.0

Am I misunderstanding the capabilities of the Direct Line API? Can someone please provide some very simple sample code that begins listening for conversation activity, and then handles activity when detected?

1
Can you specify what you want this client to do? You can use the API to retrieve activities, but most folks use Web Chat as the client to converse with the bot. I'm not exactly sure what you're asking for.mdrichardson
I interact with my bot through Slack. I want to send a slack message to my bot that will initiate a conversation with a client app with Direct Line API on a remote server. That client app would be able to perform tasks and respond in slack via the bot. I got the client app running with Direct Line and I can initiate conversations with my bot, but I can't get my bot to initiate conversations with my client app.Judson1101
Sounds like you need proactive messagingmdrichardson

1 Answers

1
votes

I think the following example fits your requirement: A bot and an additional controller that is used to send proactive messages to the bot, as shown in the following illustration. enter image description here

More information please refer to: https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-proactive-message?view=azure-bot-service-4.0&tabs=csharp