question

HUSKALuu-8084 avatar image
0 Votes"
HUSKALuu-8084 asked HUSKALuu-8084 commented

Botframework v4 + Slack : when user delete/update message on slack, does not receive notification to api/messages

Hi guys,

I have a problem when developing Azure Bot and connect with slack. I follow this guideline : bot-service-channel-connect-slack and use Create a Slack application using the Azure portal


After that, I test with my slack workspace. When post new message on slack, It posts a notification to my message endpoint : my_domain/api/messages
But when I update/delete message on slack. I didn't receive any notification to my message endpoint.

Is there something I need to setting ? I hope someone can help me to fix this issue.

azure-bot-service
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered HUSKALuu-8084 commented

@HUSKALuu-8084 I think you need to subscribe to the message events to get updates for edited or updated messages. The documentation from Azure does not include these events. But, as per slack documentation you can use these and check if the channel supports the same.

As per slack documentation:

If the message has been edited after posting it will include an edited property, including the user ID of the editor, and the timestamp the edit happened. The original text of the message is not available.

For deleted messages try subscribing to message_deleted


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@romungi-MSFT ,
Thanks for your answer. This is my subscriptions events:
Subscriptions  Events

I can't find the message_deleted event.


0 Votes 0 ·
image.png (45.9 KiB)

message_deleted seems to be a subtype property as mentioned in documentation of slack.

A message_deleted message is sent when a message in a channel is deleted, usually via the chat.delete method.

The deleted_ts property gives the timestamp of the message that was deleted.


 {
     "type": "message",
     "subtype": "message_deleted",
     "hidden": true,
     "channel": "C2147483705",
     "ts": "1358878755.000001",
     "deleted_ts": "1358878749.000002"
 }

There is a sample in the botbuilder samples repo for slack adaptors on reading the subtypes. Could you please check if a similar sample mentioned below helps?

             if (turnContext.Activity.Value is EventType slackEvent)
             {
                 if (slackEvent.Type == "message")
                 {
                     if (slackEvent.AdditionalProperties.ContainsKey("subtype") &&
                         slackEvent.AdditionalProperties["subtype"].ToString() == "file_share")
                     {
                         await turnContext.SendActivityAsync(MessageFactory.Text("Echo: I received an attachment"), cancellationToken);
                     }    
                 }
             }




0 Votes 0 ·

@romungi-MSFT ,
You may not understand my problem. I didn't receive any notification (post action to my_domain/api/messages). I tracked my host request as below :

138446-image.png

This result for posting new message on slack. It didn't send request for updating/deleting message.


0 Votes 0 ·
image.png (3.3 KiB)