Notification of which channel (not team) a bot is added to in Microsoft Teams - microsoft-teams

In Teams, it's possible to create a bot with a team scope. When this happens, at install time the user is prompted to choose a team, and then specify a channel "where you want to use the app".
When the users chooses a Team, I see the conversationUpdate message with the MembersAdded list containing the bot, but when the users choose the specific channel, I don't see any message. Is it possible to catch this event and respond to it?
Use case is: I don't want to put a welcome message in the General channel, I want to put it into the channel the user just chose.

Currently, this is not supported. We have added feature request for this.

Related

Power Automate editing posted teams message

I am using power automate to post a message to a teams channel. The message cannot be edited by admin of that teams channel or any user in that channel. I could not find an option to make the teams message editable or make it editable only by admin of that channel. Any pointer on making power automate teams message editable by admin of the group?
In general messages sent from one "user" (or bot) can't be edited by other users, even an admin - that would be a disaster for things like auditability. However, messages sent from a bot (e.g. the Flow bot) -can- be edited by the bot. However, in the case of Power Automate, it does not offer this as an action for the "post a teams channel message" Action, only for the Action that sends an Adaptive Card message. If you can change your flow to send this kind of message, there is an action to then update it later, using the message id.

Send a user message to a user via Power Automate in MS Teams

Is there a possibility to send a user message to specified user(s) in MS Teams?
Elaboration:
My current flow triggers a message to a user, but it is always sent via FlowBot and appears in the Power Automate chat of MS Teams.
Flow: (Outlook; Trigger) "When a new email arrives (V3)" → (MS Teams) "Post message in chat or channel" → (Outlook) "Mark as read or unread" (v3)
Can individual users be set as recipients of direct messages with the message sent in the already existing chat with the user?
If yes, is it possible without a value chain?
Thanks!
As I see it, there are kind of a few different questions in your post, so I'll try deal with each of them:
In order to send a message directly to a user, the user has to come "from" someone/something, and in Teams that basically means a Bot. The easiest way, therefore, to do this is to use the out-of-box FlowBot. If that's fine for you, you're good to go. If you want it to come from another Bot (i.e. one you own) then you need to create a Bot somehow. Two main options are:
Code it from scratch using Microsoft Bot Framework - code in a regular language (C#, Python, etc.) or using Bot Framework Composer
Use Power Virtual Agents - ala "Power" family, it's kind of a "Drag and Drop" bot capability. You don't need to actually have the bot DO anything though, if you don't want it to handle user responses (you can do most of that visually in your Power Automate flow. For this option, you'll be able to select the bot from within Power Automate designer as the "send from" bot
You can choose to have the bot send a message directly to the user (i.e. in a 1-1 chat, like what you're seeing with FlowBot) or you can choose to have it send to a particular Channel inside Teams - either is fine. Be aware that Channels have threaded conversations, if you want to use them, but 1-1 chats do not.
You can try these Power Automate steps to create the 1:1 chat between you and the user, then send a message to it.

How to send message to all the members of the group on Installing teams bot

I have created a teams bot and had a service written in .NET core to handle events and user's messages to reply accordingly.
When I install a bot in a group, I need to send personal message(one-to-one i.e between bot and the user) to all the members of that group on installation. I am trying to do that in OnConversationUpdateActivityAsync event handler (which gets fired when I install the bot). But in this event I am getting information of the user who is installing the bot, not the other members which are added in that group, also I am not getting any information of the channel(channelId and members etc.) in which the bot is getting installed.
Any different approach or solution will work.
Thanks in Advance.
You haven't said if you want the bot to message the users privately (like 1-1 between the bot and user) or just send each person a personal message inside the group chat, but in both cases, Proactive Messaging is your correct approach. If you want to send a message inside the group chat itself, see this sample.
If you want to send the users messages directly, 1-1, they need to have the bot installed as a personal app already. It's possible to do this automatically, but it's a bit more work, and requires Microsoft Graph. The proactive messaging is a bit different too - you get the list of members as per the previous sample, but see here for how to get the required 1-1 conversation details, and how to send the actual message. This last link also has documentation on how to get started, and some background reading (at the bottom of the page).
#Hilton is correct, You need to specify in which scope you want to notify user 1:1 or directly in Group chat?
App should be installed in user scope if notifying user on installation, You can proactively install the App in User/Group Chat/ team scope using Graph API. To notify users in Teams or Group chat, You can fetch the list of members using List conversation members API, When you install the App using Graph API Bot received converstionUpdate, You can save the conversationReference and use it for proactively notifying.

How to make a bot to message only certain people

I developed a welcome bot using the Microsoft Bot Framework. I want to add it to Teams. In teams I want the bot to send welcome messages to only certain members belonging to a particular team or group. Please provide me advice or steps how to do it.
You can only send a welcome message to a specific user if that user first contacted your bot. This is done purposefully to minimize the possibility of spam bots being created. Once a user has contacted your bot you can capture the user's Id and, coupled with the conversationId, you can send future (proactive) messages.

Find the address of a specific user using Microsoft bot-builder

I would like to open new conversations with users using the Microsoft Bot Builder on the Skype for Business channel. The only information I have is the user id (sip:user#domain.com)
In all the examples I could find, it is needed to save the conversation id/address of a user in a previous conversation to send a new message to this user.
How to create a new conversation as a bot to a user knowing only his id?
Thanks
Like you stated the userId is required to send a message to the user. A new conversation can be created by the framework but ultimately, you can't do anything without the userId and to obtain this the user has to contact your bot first. This is only true for channels like Skype. Other channels like E-mail just use the email address as an id. Skype uses a GUID as the id for their users. This is done so bots can't randomly add themselves to any user on Skype. Source
This doesn't mean you have to necessarily wait for the user to start a conversation. Whenever a user adds a bot to their contact list an event is send to the bot. This is the ContactRelationUpdate event. It warns the bot that a user has added the bot and the bot can then respond accordingly. Once this event is thrown you can obtain the userId from the activity and do whatever you want with it. Source

Resources