How to check all messages that push to many users (in one time) really success to all users? - line

Same the title, I want to detect if have some response fail then I will code to resent a message again.
I use line API thanks

Related

Firebase Error Message - The document has moved https://fcm.googleapis.com/batch?google_abuse=GOOGLE_ABUSE_EXEMPTION

We are sending lots and lots of FCM Messages to our millions of users. As the message is triggered by an external event (Kick off in a football match) we sent many messages at the same time.
Sometimes the sending of an FCM message fails and we get an error message like this:
<H1>302 Moved</H1> The document has moved
<A HREF="https://fcm.googleapis.com/batch?
google_abuse=GOOGLE_ABUSE_EXEMPTION%3DID%....3B+expires%3DTue,+22-Nov-
2022+19:04:17+GMT">here</A>. </BODY></HTML>
(I removed some text for privacy reasons.)
For sending the messages we use
implementation 'com.google.firebase:firebase-admin:9.1.0'
We got thousands of error messages like this in one minute. In the next minute everthing worked fine again.
I have search the internet for information about it. But i couldn't find any abuse rules for FCM. Does anybody has information about this kind of error?
firebaser here
At first glance, your project may be getting throttled, but it may also be another problem in the API calls or the FCM backend. It’ll be challenging to pinpoint or even narrow down what is the specific cause of the error on a public forum without going into project-specific details. I would recommend reaching out to Firebase support as they can offer personalized help. Please provide the latest request and response (with timestamp) you have so they can check what happened to the message delivery.

How to know count or last of messages in MediaGroup telegram

I want to attach a button for a media group
To do this, I intercept the message and see if there is the same mediaGroup_id, then I save the file_id to the database
After all messages from this media group have been received, I send them to a group in a separate channel (here is the problem) -> how can I determine that this is the last message from the media group, I had a stupid idea to create a job with a delay of several seconds, enough time to receive the entire media group, and then send the entire media group in this job, however, I am worried about the reliability of this method, and for sure it will be buggy if one day I have to use asynchronous
Then, in the main channel, I send a message containing a link to the media group and a button, as I wanted
Is there some way to do this more elegantly?
That actually sounds rather reasonable and in fact I know a bot that does something very similar. The idea why this works, is that TG apparently first uploads all the media files and then sends all messages at once rather then looping over "upload, then send".

WhatsApp messages order

We are working on our chatbot that is connected to UIB. Some of our messages have a bit of a complex structure, and we need to split them up in order to send them in proper order. Consider, we have a single message that has the following content structure: <text><image><text>. In order to send this message to a WhatsApp user, we need to split the content into three messages (#1 <text>; #2 <image>; #3 <text>). If we send these messages one-by-one, in WhatsApp client we might receive these messages as in the order <text><text><image>, because posting images takes longer than posting text messages. We have a workaround (adding delay between requests) but images could be big in size, so it takes very long to send them. We could constantly increase delay, but it's not a good way to do such things.
So, my question is the following:
Is it possible to make a request to check the message status, whether it has been delivered to WhatsApp servers or not? Actually, it doesn't matter, whether the message were delivered to the end user, because users might be offline. We just need to know if the messages have been delivered to the WhatApp server in the proper order.
You'll get the read/delivery status in the webhook URL.
Please contact support#uib.ai for further clarifications.

Telegram Bot - Send Info message

currently I am working to creating telegram bot. Now I required to know is there is any API to send info messages (like the one we get during a user is added r deleted in a group chat)
Thanks in advance
What you want to do can be done using answerCallbackQuery method.
But first of all you have to create a CallbackQuery using InlineKeyboardMarkup to create inline keyboards you can follow the steps in this link.
After creating the callback query you have to answer it using one of the codes below:
if (update.CallbackQuery.Data == "CQ1")
{
await Bot.AnswerCallbackQueryAsync(update.CallbackQuery.Id,"Text",true,null, 0);
}
This way the message will look like a message box and will disappear after the user taps on OK. But if you use the code below, the message will show up and disappear automatically after a few seconds.
else if (update.CallbackQuery.Data == "CQ2")
{
await Bot.AnswerCallbackQueryAsync(update.CallbackQuery.Id, "Text", false,null, 30);
}
By the way, messages that are shown at times like adding a user to a
group are service messages and theses kinds of message can only be
sent by telegram server.
If my suggestion does not fix your issue you can use pinMessage method
that sticks a single message to the top of the page in groups and
channels. But note that you can only pin one message to a channel
or group and for pinning another message firstly you should unpin the
previous one.
Currently there is no way to send such info messages.
And in my opinion, this feature is unlikely to be added in future because:
info messages usually tell you information about your chat; they are managed by telegram servers
therefore they should not be sent by Users
bot is an instance of User

Rails 3: Return large amount of data to user via API

My app has an API that users can request data. Sometimes that data takes time to process and is breaking my code.
I need a solution for this and I was thinking in using delayed_job but I'm not sure how this works. If the user makes a request, I need to give him an answer. Even if I process the data in background, the call still needs to wait until the job returns.
What is the solution for this? I am not sure how to do it.
Thanks
Heroku has a 30 second timeout, which is why your requests are failing (Probably H12 or H13 in your heroku logs).
There are three methods to work around this.
Keep the connection open by sending blank data.
You'll need to respond within the first 30 seconds and every 55 seconds after that. Use the time in between to process the data. Sending spaces should not affect the ability of the browser to read the response.
Callback
Have the user provide a callback URL in the initial request. When you finish processing the data, hit the callback url with your response.
Polling
As suggested by Codeglot, you can provide the user with a key. To check on their request, they can ping your server with that key.
Tell the user that their data is being processed and will be available shortly. Youtube, Vimeo, Facebook, Twitter, they all do this.