问题
protected override Task<MessagingExtensionActionResponse> OnTeamsMessagingExtensionSubmitActionAsync(
ITurnContext<IInvokeActivity> turnContext, MessagingExtensionAction action, CancellationToken cancellationToken)
{
return Task.FromResult(new MessagingExtensionActionResponse
{
ComposeExtension = new MessagingExtensionResult
{
Type = "message",
Text ="<div><pre>Hello</pre></div>"
}
});
}
I dont want a hero card that takes up space, just simple plain HTML response like the example above, but i dont know how to do it. The above example dont work.
回答1:
Currently OnTeamsMessagingExtensionSubmitActionAsync method does not support html response .It has the following options for responding.
- No response - You can choose to use the submit action to trigger a process in an external system, and not provide any feedback to the user. This can be useful for long-running processes, and you may choose to provide feedback in another manner (for example, with a proactive message.
- Another task module - You can respond with an additional task module as part of a multi-step interaction.
- Card response - You can respond with a card that the user can then interact with and/or insert into a message.
- Adaptive Card from bot - Insert an Adaptive Card directly into the conversation.
- Request the user authenticate
- Request the user provide additional configuration
Doc Link
来源:https://stackoverflow.com/questions/61421840/how-to-return-simple-html-response-with-messagingextensionactionresponse-for-a-t