I have subscribed to channel notifications for my bot in Slack.I am receiving repetitive event notifications from slack with same timestamps. Generally, if one request fails then slack tries the same request again after some time but the requests I am receiving are all with same timestamp.
Any idea, how to stop these instantaneous repetitive notifications?
Related
I am facing a weird bug when using my bot app to send messages in a thread.
I am sending DMs as a bot app user - the message will appear in the app channel.
When I send the first message, I get a notification from this message (right).
I get the thread ts, and then send a message again as a bot, replying in a thread. I receive the message in the channel, as a thread, but I don't get any notification.
Next I reply it as the user receiving this DM - works ok
Then, from the moment I reply to this thread, after the first interaction from the user, I start to get notifications from my own bot messages.
The issue? I'd like to get notifications from the start, doesn't matter if the user interacted with me in this thread or not. Any way to do it?
Thanks!
I am using https://slack.com/api/chat.postMessage to do it all.
I am using an Azure Function to send a Proactive message to the client. How do i "reset" a conversation when a Proactive message is sent.
Within the bot, a user might be prompted for something (ex. time of day). A proactive message may get sent to them before they respond. In this scenario, I would like to reset/cancel the previous dialog and start fresh.
I am already able to reset the dialog using CancelAllDialogsAsync which works fine for user-driven messages.
I am sending my proactive message using ConnectorClient, which bypasses the framework, and sends directly to the client, thus never hitting my middleware to reset the dialog.
How can I get the proactive message sent to the framework (i can send the response from the bot no problem)
I would highly recommend you solve this by having your function send your bot a backchannel event under the context of the ConversationReference via the ConnectorClient. This way the bot maintains ownership for all the details about state and what should happen when this event occurs rather than that responsibility leaking to the function. The bot then watches for this custom event and responds to it however it sees fit.
If you need any more details let me know and I'll update my answer.
I want my bot to respond only if anyone mentions its name like #mybot.
How to achieve this?
For that you need to use the Events API and subscribe to the event app_metion.
That way your app will receive all message that directly mention your bot with #mybot.
Those messages will be sent as request from Slack to the endpoint provided for receiving events.
I have successfully setup my slack bot app, have enabled events etc. I want to receive any direct messages that the members of my slack team send to my bot. For this, I have only enabled Bot Events and No Team Events like below
However, I do not get any event on my webhook on this setting.
If I enable message.im event under Team Events, then I start getting events. But then, I get every message that the user (who has installed the app) sends to any other user in the team.
How do I get only the messages that are sent to my bot user?
Update 1
Based on this SO question I created a private channel with the bot user. Even then, the messages in the private channel do not arrive in my webhook with the above event subscriptions.
Update 2
After reinstalling the app, it seems to be working fine. I have only used it for few minutes after the reinstall so far. I will keep posting here how it goes. It would still be interesting to know what went wrong where.
It is normal behavior that your script receives all messages (for every channel your bot is a member of), not only the messages sent directly to your bot. At this time you can not filter further in the event configuration. So you need to filter out any unwanted message in your script handling the event.
See also this answer.
I subscribed to Outlook Push Notification Services, precisely I want to receive push notifications for sentitems.
Consequently, I use https://outlook.office.com/api/v2.0/me/MailFolders/sentitems/messages as Resource in my #Microsoft.OutlookServices.PushSubscription POST request to the url https://outlook.office.com/api/v2.0/me/subscription
As expected, I receive the push notification when I send an email. The problem lies in the fact that the ResourceData is always the same. The Id never changes and correspond to the one I received after the first Notification.
I also remarked that even when no mail is sent I keep receiving notification with "ChangeType":"Created" (and always the same ResourceData.Id).
This may be a bug, or should I send back something to the subscriptions after receiving a notification?
This is because the webhook responded to the push notification request with status code 500. Hence Outlook Push Notification Services treated this request as failed and then retried it later for several times. As the notifications of the same subscription are processed in sequence, later notification won't be sent until the earlier notification was successfully sent out. That's why you saw multiple notifications with the same resource data and change type even when no change happened.