Sep 02 2024 04:49 AM
Can we open the task module in BotFramework-WebChat ? Kindly provide any references if available
Sep 02 2024 11:55 PM - edited Sep 03 2024 12:38 AM
@ray2408- Opening a task module in BotFramework-WebChat isn't directly supported as WebChat primarily focuses on chat interactions. Task modules are a Microsoft Teams feature used to create modal pop-up dialogs for extended interactions, typically involving forms or rich content.
Although this is not directly applicable to Webchat, understanding task modules in Teams can be helpful if you're integrating WebChat into a Teams application. Task Modules in Microsoft Teams.
To create custom events or components within WebChat. BotFramework-WebChat
Sep 03 2024 06:43 AM
@Sayali-MSFT I want to use it in the Teams Tab app. Where there is a webchat.
If not task module, is there any other way to open Dialog there?
Sep 05 2024 12:17 AM
@ray2408 - To open a Task Module from BotFramework-WebChat within Microsoft Teams using the appropriate adaptive card actions or by triggering the Task Module via message extensions or buttons.
To integrate BotFramework-WebChat within a Microsoft Teams Tab app, you'll need to embed the WebChat in your tab and handle communication between the bot and the user.
Here's a general guide to get started:
Set Up WebChat: You'll need the Direct Line token for WebChat, which you can generate from the Azure Bot Service. Here's a basic code snippet for embedding WebChat:
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script> <div id="webchat" role="main"></div> <script> (async function() { const res = await fetch('YOUR_TOKEN_GENERATION_ENDPOINT'); const { token } = await res.json(); window.WebChat.renderWebChat({ directLine: window.WebChat.createDirectLine({ token }), userID: 'USER_ID', username: 'User' }, document.getElementById('webchat')); })(); </script>
Teams Tab Configuration:
Bot Interaction: You can send adaptive cards or messages directly from the bot, and you could also implement task modules or custom views from the tab as part of user interaction.
Reference Document: -
1. Use Web Chat with the Direct Line App Service extension in Bot Framework SDK - Bot Service | Microso...
2. BotFramework-WebChat/samples/01.getting-started/a.full-bundle at main · microsoft/BotFramework-We...