How to check message existing in Slack? - bots

I making a Slack bot based on BotKit. Bot observes certain Slack messages and creates corresponding entities in a database. Entities are associated with these messages.
If somebody removed a message, Slack send RTM event message_deleted and I can hook this event and clean all entities associated with deleted message.
My problem is messages removed when bot-server is stopped for maintenance. Bot lost message_deleted event.
How can I get messages, that being removed when the bot server was stopped?

Related

Getting multiple change notification from graph api while sending URL's in Microsoft Teams channel message

I have been using graph API provided by Microsoft to subscribe to change notification for teams message.
It's all working fine for normal chat messages but when i try to send any message containing URL's it sends two/three notifications and sometime it works fine (sends only one).
I have gone through the docs and followd the protocals like sending 202 response conde to acknowledge the notification has been received as soon as i receive the notification and run other functionalities in another thread.
I couldn't find more info on for this inconsistent behaviour.
So far I tried to minimize the process after receiving notification on webhook receiver route by performing other actions like extracting channel,message id and retriving message in different thread and sent HTTPResponse of 202 as soon as i receive the notification.

Get telegram group messages before brodcasting to anyone

I want to create a Telegram bot and use it, inside a group, as a bridge to get user messages and information, then send messages through the bot with a fake name.
So the Problem is: Bot receives the message after it's broadcasted to everyone and I should get the message and delete it, then do my stuff but this can reveal the user's identity.
I want to get the message before it's broadcasted to anyone and:
Prevent the message from broadcasting.
Bridge message through the bot and send the same message as the fake user created in my server.
Is there any other solution to use out there? except inline mode?

How to check if the user has the webchat window open?

I am creating a customer support bot using Ms botframework v4 with nodeJS and directline API 3.0. A customer would talk to the bot and on request, the conversation would be handed over to an agent. If the customer requested to talk to a bot, the customer will wait until the agent becomes available. I want to check if the customer is still active before the agent sends a message to him/her.
wireframe of the bot and the webiste As you can see in the image Jack is in the queue I want to find out a way to check if Jack is still waiting, or he close the window and no longer waiting.
Check out this SO solution I provided. The request is similar to yours in that the OP wants to know how the bot can be notified if a user exits.
The short answer is to use an event listener. Before the window (that houses the web chat instance) is closed, an event is fired. This event is picked up by web chat which sends an activity (message, event, or other) to notify that bot.
From this point, you simply need to forward the notification to the agent that the user has exited the conversation.
Hope of help!

unexpected Stripe webhook events received, which I can't find on Stripe dashboard

I have setup a Webhook to my development environment. In addition to receiving the event notifications which I would expect, I receive additional notifications (with unique event ID) which do not make sense to me. When I try to look up those events on the Stripe dashboard I cannot find trace of them... Shouldn't all events be logged on the Dashboard?
Has anyone experienced this? I've popped a mail to the support but no answer yet.
EDIT:
I could find one of the "missing" events on the dashboard now. It was buried far down the event list, as it was apparently fired several hours ago for the first time, but couldn't be handled at that time by my application.
All events appear on the dashboard, listed at the time they are fired for the first time. So in case the application receiving the notification can't return a response 2xx for some reason, Stripe will try sending the notification again at a later time. Once the application server handles the event notification properly, the event will in all likelihood be logged by the application, and the timing might look confusing.

Xamarin.iOS - PushNotification when the device is off

Hi I would like to know if it is possible getting the push notification the server sent while the device os turned off.
How do I configure the app and the Azure Notification Hubs to know the device did not received the notification at the moment it was sent and show them when it gets on (or online) again?
Is it possible to do?
Thank you
Azure Notification hub just tells you a notification has been delivered. There´s no way to get a "received" confirmation if that is what you are looking for. This has actually nothing to do with Azure, it´s just how Apple Push Notification Service (connected with Azure) works.
Apple Push Notification Service (APN) will retain/cache the last (and only the last) notification sent while the device is off. Once the device is online, APN will try to send the notification again. But there is a time limit after which cached notifications will be lost, and that means your notification may never arrive its destiny.
If you really need to get arrival confirmations (ie: like whatsapp confirmations) you should implement it yourself. That would be another question but here are some hints:
You include an uid in the notification payload
You save that uid in your server database, in a table that tracks the "pending notifications".
Device opens the notification and sends an arrival confirmation to the server, passing the uid as parameter => you delete the "pending notification" record on your database table.
How would you resend the pending/lost notifications?
Option 1: Implement some kind of a background job that checks (in time periods. ie: once every 5 minutes) what notifications didn´t arrive and resend them until they are correctly confirmed.
Option 2: when your mobile app starts, send a message to the server telling "hey, I´m online again". Then process and send all the pending notifications specific to that user/device, deleting them from the pending notifications table.

Resources