I am a bit confused on the definition of a "conversationId". Can anyone explain what a conversation is exactly? My use case needs a state for a group conversation, as long as the bot is the group, I want to maintain that state.
I also want to know how differentiate group conversation vs conversation with one user.
The Message Types documentation explains the messages for begin and end conversation for users and bots. This page also indicates that messages are channel specific, meaning that some channels will send a conversation message and others might not. So, once you choose your channels, you'll need to experiment or read the channel specific documentation to see if they send messages for start and end conversation. To prepare, the Bot Framework Emulator has a drop-down list with a Send button so you can test how your code handles these messages.
Related
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'm trying to create a subscription to receive the contents of all new messages sent within a private Team, and so far it appears I have to configure a bot / webhook within Teams (and only messages #mentioned to that bot / webhook will be sent to me), or otherwise use the Graphs API (I can't determine whether the same caveat exists with #mentions).
The use case is to allow members of the Team to post messages, and for my listening application to consume the message contents and take an action (turn on a light, etc.. but external to Teams). I don't anticipate needing to write anything back into the Team.
I found this link in another post: https://blog.thoughtstuff.co.uk/2020/01/how-to-use-the-new-webhooks-for-microsoft-teams-channel-chat-messages/
Has anyone successfully been able to subscribe to all messages within a private team for a similar use case?
Thank you!
Posting the Answer for better knowledge
Copying from #Sridevi comments
To track messages and replies in a channel, you can create a change notification subscription at a channel level. Please follow this documentation.
What we are trying to do
I am working on automation which posts messages to a Slack channel using Incoming Webhooks on a custom Slack App. The messages mentions people.
What works
We can send a message just fine, it has formatted content, and usernames are correctly resolved using the link-names flag.
What isn't working
The whole point of the notification is to inform a dynamic set of people about something they should care about. The set of people we tag varies hugely (think people who contributed to a pull request) and so not all possible recipients are in the channel these automated messages go to.
We assumed that given the usernames are being directly #-mentioned, they would be notified by Slack. However, two of the users we've tested with and #-mentioned confirm they never received a notification they had been tagged.
This is different to "human" behaviour, where if you #-mention someone in Slack, you get a little message reminding you that person isn't in this channel and offers to invite them or let them know.
As far as we can tell, sending the message programmatically is doing the equivalent of "Do nothing" in the picture above. I want to do either of the other two options, preferably "Let them know".
How can I notify people they've been mentioned? I've looked at all the API documentation and nothing discusses notifying users who aren't in the channel that they are mentioned.
This can't be an uncommon issue.... right?
Notes:
We aren't directly calling chat.postMessage, it's just the only documentation on link_names I could find to link to. We are using Incoming Webhooks, which has minimal documentation on the parameters - it seems to be the same as chat.postMessage.
We would prefer not to move off Incoming Webhooks, but we can do a custom integration with the API if we have to.
You need to invite the user to the channel first, using the Python client that's:
client.channels_invite(
channel=channel_id,
user=user_id
)
We need to automate few notifications from our web application. These get triggered at various phases, for eg. Step A, B or C would trigger emails to specific parties.
AS an improvisation to this, teams integration is being looked at where a specific channel is being created and with webhook, the messages can be posted.
I created a custom channel with an incoming webhook and I posted a JSON request (of type #messagecard) which was viewable in the channel. But the need is to really establish a conversation and not separate individual messages. By conversation, we mean a scenario or tree structure like below
OverAll status 1 (Parent message)
--> subsequent reply (child message)
---> subsequent reply (child message)
I did some R&D and found that the incoming webhook post request does not return any message id (thsi feature doesnt exist)
What I do not understand is how bots (Azure or Microsoft) can help here.
Please advise
Webhooks/connectors is perfectly fine for the single messages, are you're seeing, but I don't think it will give you the ability to create and then continue an existing "conversation" (i.e. a thread). You certainly could achieve something like this using a "bot"-based approach. In practice, it's kind of "bot+extra" because you need two things:
1) A bot registered into the channel. This will give you some key info you need to be able to send messages from outside Teams - something called a "proactive" message. Having the bot in the channel also means you have something with the authorization to send a message to the channel
2) Next you need to implement the Proactive message. Have a look at my answer here to see more: Programmatically sending a message to a bot in Microsoft Teams (the answer is in C# - not sure what language/platform you're using, but the same concepts apply in Node)
In addition to the pro-active message, once you send that first message, you need to store the message reference that comes back from "SendToConversationAsync". You then apply it to the subsequent messages, as I've described in the answer here: How to add a mention in Teams alongside an adaptive card using Bot Framework
Hope that helps
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.