How do you use the Send task module Teams options? Should invoking open a new Teams Task module? Can I have an intent directly open a task module?
I have setup the following task, but nothing happens in Teams when this response is triggered. Should a Teams task message appear?
https://github.com/microsoft/botframework-components/tree/main/packages/Teams/dotnet
The following page details how the Teams task module message responses work.
https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/task-modules/task-modules-bots
Related
I am trying to create a new conversation service resource in Twilio and to add a new conversation client to it. I am trying the node.js example but I don't have the option that the documentation shoes.
So for creating a new conversation Service I found this document:
But it seems that I can't create a conversation Service and can't create a user resource. I don't have an autocompletion for it and even if I try to ignore the IDE warning and to hardcode the command I am getting the error = "can't read create of undefined". You can see the marker that I got under the "services" word. This is also happening for user resource under the word "users". All the other commands (like create a conversation) are available.
Twilio developer evangelist here.
I just tested with the latest version of the Twilio Node package, which is 3.57.0 as of today. Twilio libraries are released every 2 weeks with new features. I was able to make the call to create a new Conversations service.
I would try upgrading the Twilio version and see what happens.
I can't seem to figure out how to proactively message a MS teams channel using a Python Bot (botframework).
An user installs my third-party MS teams bot, adding it to one of their Teams channels.
My Bot needs to send ad-hoc messages as part of an event from an unrelated back-end system.
The botframework does not let you message channels at will, it needs a conversation reference. You can get a conversation reference in various ways, such as someone messaging the bot, or fetching the list of channels and constructing a conversationId from that.
Reading the documentation
The documentation will have you believe that it is in fact possible to send message at will, using the following steps:
Get the user ID or team/channel ID (if needed).
Create the conversation or conversation thread (if needed).
Get the conversation ID.
Send the message.
For step 1, how/when do I get the channel ID if there are no events that my Bot has been added to a channel?
For step 2, how do I create a conversation if I don't know what team channels there are?
Conclusion
Does someone know how to send a message to a MS Teams channel using a Python app/bot? It should not require user interaction. The app/bot gets added to a Teams channel, and it should immediately post a message inside this channel.
Turns out the issue was that my on_teams_members_added() was not getting called because I kept deleting the app within Teams instead of uninstalling.
Make sure to:
Click on the ... overflow menu next to the team name
Pick Manage Team
Select the "Apps" tab
Click the trash icon to remove the app from that team
Then try to install the app again
With this code you can send a channel message when the Bot enters the channel:
async def on_teams_members_added( # pylint: disable=unused-argument
self,
teams_members_added: [TeamsChannelAccount],
team_info: TeamInfo,
turn_context: TurnContext,
):
for member in teams_members_added:
if member.id == turn_context.activity.recipient.id and team_info is not None:
# bot entered a Teams channel
await turn_context.send_activity("Hello channel! I have just been added.")
Your handler needs to inherit from TeamsActivityHandler.
I'm working on a sample for the pnp Teams samples repo on GitHub that I'm hoping to submit in the next few days. I haven't started on the documentation yet, but the code is fully functional, with both a C# and a Node.js version of the backend, which sends a -very- simple proactive message example (showing the most basic things you need) - hopefully it can be of use even though it's not in Python - see https://github.com/HiltonGiesenow/teams-dev-samples/tree/add-proactive-messaging-sample/samples/bot-proactive-messaging/src
I'm building a teams app that contains some tabs and a bot.
Is it possible to, when an action is performed on a tab (i.e. clicking a button), initialize automatically a chat with the bot, or send a specific message?
Tks
Based on the comments above, what you're looking to do is implement "pro-active" messaging, where the bot itself initiates the conversation. It's definitely possible, and you can read more to get started here and here. The most important thing to know is that your user has to have installed the bot already, to get a "conversation context", but if they've installed the app, which includes the bot, to get the tab, then you're fine. You need to get some variables when they do install the app, which you hook into the conversationUpdate event to get access to. Give it a go and let me know if you have specific questions, here on SOverflow.
I would like to send the user a welcome message when they install my MS Teams Bot app. All the samples and documentation point to using the ActivityHandler onMembersAdded event. Unfortunately I can't get this event to fire. I also noticed that when installing the zip file in Teams and watching the requests in ngrok nothing happens; so I'm not entirely sure the problem is in my bot app. Is there something I need to do in the manifest?
If I chat with my app the onMessage event will fire, but like I said above, I need to send a "Welcome" message when the app is installed before the user starts typing.
Background:
I created the manifest for my app using App Studio in Teams and exported it to a zip
The node app is built with the using botbuilder 4.9.2
onMembersAddedAsync works everywhere, but not in Teams :) For Teams, there is a set of separate methods that work only in Teams. You need to use OnTeamsMembersAddedAsync. You can read more about that here: https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/create-a-bot-for-teams
Using Stream Chat React library on desktop https://github.com/GetStream/stream-chat-react
Use case - clicking on web push notification should open specific thread.
How to programmatically open specific thread by parent message id?
Looked into openThread and handleOpenThread props but not exactly what needed.