I'm creating an event system where a chatbot can be used to trigger a job on an external system. Once the job has been received by the external system, it runs what it needs to run, and then notifies a queue held in azure that the job has been finished.
Next, I have a function app which looks at this queue. Once new information has been received (Contains an ID, ConversationReferenceObject and a job response), it notifies the bot via a ProactiveMessage:
var conversationReference = JsonConvert.DeserializeObject<ConversationReference>(subscription.ConversationReference);
MicrosoftAppCredentials.TrustServiceUrl(conversationReference.ServiceUrl);
var client = new ConnectorClient(new Uri(conversationReference.ServiceUrl), new MicrosoftAppCredentials(appId, appPassword));
var result = conversationReference.GetPostToBotMessage().CreateReply($@"[ProactiveMessage] Your job response: {response.data}");
client.Conversations.ReplyToActivity((Activity)result);
Now, rather than posting this reply to the bot activity I want the chatbot to intercept the [ProactiveMessage]
and then only respond to the user if a dialog is not currently active - just generally managing the conversation flow correctly.
Now, I'm wondering if the client.Conversations
has a different function where I can post to the chatbot rather then replying to the current conversation? I'm a bit stuck.