In a group conversation a bot only sees the messages that mentions the bot's name (for example, "#mybot hello!").
Is it possible to make the bot see all the messages in a Skype group chat?
This is currently not possible. See the documentation on this:
In a group the bot will only receive messages directly addressed to it e.g. “#YourBot This is the message”. It will not receive other messages sent by group participants or notifications of users joining or leaving the group.
Related
I'm able to send a proactive message as a bot to one Teams group chat at a time using Bot connector API's. If I want to send the same message to multiple Teams chats at the same time, do I need to use connector.Conversations.SendToConversationAsync() for each conversation separately or is there support for batch requests?
I see batching specified in https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/rate-limit, but not able to find any documentation on how to do it.
I am looking to build a slack app which can auto-reply to a person whenever they mention me in a channel or DM me. However, i cannot find any method in the slack API for the same.
Is there any particular way i am missing or this cannot be done in Slack?
When you say 'mention me', if you mean the bot,
then you can subscribe to 'app_mention' event and take it from there.
https://api.slack.com/events/app_mention
If you mean - you as user and not the bot, then the bot needs to be part of the conversation to read the messages. This means that it will not work with the DMs.
For channels, you can invite the bot to the channel you want to monitor, and capture the 'message' event to parse the message and look for your id.
https://api.slack.com/events/message
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.
we are working on MS Bot Framework bot. We are integrating with directline and MS teams. In certain cases we need to download conversation history. Within directline we are using standard DL endpoints to retrieve the conversation. However these are not available for teams channel. Therefore we are trying to get chat messages using Graph API by using
/me/chats/{id}/messages
And here's our issue - to get the chat ID we are trying to iterate through chats returned by
/me/chats
And then look up conversation members by
/me/chats/{id}/members
However chat with Bot contains only user and not the bot so it appears it is a single member chat. As workaround we always sort chats by last updated timestamp descending and assuming first single member conversation is the one we are looking for however this is tricky and unreliable and also very slow some times. Is there some better way to get conversation history from MS teams channel?
Using Graph API, you can access information related to channels in Microsoft Teams. You can refer to list channel messages which retrieves the list of messages (without the replies) in a channel of a team. If you want to get the replies for the message, then you need to call list message replies or get message reply API.
GET /teams/{id}/channels/{id}/messages
One more way is to subscribe to the channel using change notifications API which makes you get all the messages of the channel to the notification endpoint.
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.