Telegram bot limits for user-to-bot chats - telegram

What is the correct strategy to make a bot that can serve many subscribers (say, 10,000) provided each chat is 1-to-1 (user-to-bot) and within a single chat there is no heavy communication (i.e. less than 1 message in a minute on average and chat sessions are limited to 20-30 minutes a day on average per user).
There is plenty of information on the telegram bot API rate limit but one thing still evades me. I struggle to understand how exactly API rate limits are applied when many users have an open 1-to-1 chat with a bot account (not a group chat with bot being a member).
Currently, the docs say a limit of 30 messages / second if sent to different users. Does it mean that if there are 31 users sending messages simultaneously then I will have to apply throttling on the bot backend?
Priorities here are to make sure that the bot responds as fast as possible and uninterrupted service is required even at peak times.
Can someone guide me in the right direction? I find official documentation had to understand in this regard.

Related

Telegram autoposting python script is leading to systematic bans

I want to make a simple auto posting script to post picture + text to multiple groups where it is welcome to not get any reports.
I already made a script without any proxies on a Telethon python module. It connects the virtual numbers with an app_id and hash_id so that it can send automatically messages to sertain groups and it all works fine untill it reaches 5 messages limit, then it results in spam block of telegram account.
On some of the account this number varies from 5 to 30+ message limit.
● Question: Is there any logical explanation based on what is telegram deciding to spam block the accounts usually right after 5th message? Is it a problem of messages text being the same? Or it only cares about delays? If anybody had experienced same problem, please share a solution of how to not get spam blocked and what are the requirements to not act as a spam?
I have tried changing text and sending the posts manually, but it always gives a negative result in the end.
Sending messages to Telegram groups (chats) shouldn't be a problem, since on my main Telegram account I usually chat and send lots of messages daily, but manually. Hope someone will help me take the stone off shoulders.

Telegram API limits regarding channel subscribers

What limits does Telegram API impose on viewing subscribers of a private/public channel? I know you can list all participants of a public group without issue. Not sure about private groups, but the same is probably true (just need to be admin). However, I don't have a channel of my own anywhere near large enough to check if it's limited.
The reason I'm asking is because this website claims only 200 subs are visible even for the channel admin. It would be unpleasant to run into that limitation halfway into a project.
The end goal is to fetch all subs from a given channel where the user has admin rights.

Can we increase number of topics and subscriptions in a google console project?

I am using google cloud pub/sub for receiving the push notifications of any gmail user by setting a watch on the concerned users mailbox. I am able to do that. I am creating a one topic per user in my google console project and also creating one subscription per topic. As per my knowledge we cannot make more than 10,000 topics and subscriptions in one project(GCP). My question is that can we increase this limit. I want to increase it to 100k or 10 million. Is it possible. If yes kindly suggest some resources or references, where I can read about it.
At this time, the 10,000 topics and subscriptions limit cannot be increased. It is a dimension we'd like to scale up at some point, but for now, this is not a quota for which one can request an increase.

How to manage too many messages sended to my bot?

I have implemented a php telegram-bot (https://github.com/php-telegram-bot/example-bot). I'm using the getUpdates method to recieve the messages sended to my bot.
The problem is that there are too many spam users sending him fake messages and for that reason I have a long tail of new messages and it produce a big delay for process the important messages.
I have seen that is not possible to block this spam users and it is not possible to recieve more than 100 new message in each call through telegram API. If i'm recieving thousands of messages per second, how can I manage them all with the least possible delay?
Finally I could resolve the issue. The spam come from different groups wich my bot was added. I configure it to not permit to be added to groups and then I use the interface "leaveChat" of the bot api to leave the chats. I have recorded all the chats where my bot recieve message, the group chat ids were easy to identify because they have negative ids.
I also increase the frecuency to download updates up to 20 calls per minute.

Google Analytics API Quota for several clients

I tried searching but I didn't find any useful resource that would answer my question.
I'm trying to develop a service for my costumers where I will need to connect to their analytics data and combine with information of other services that I already provide. However, with the quota of the API request, how can I get it to work with several costumers?
I mean, the limitation is 10.000 requests per month, and I will probably make around 40-50 requests per day per costumer. That means that if I get more than 7 costumers to use it I would reach the monthly quota. What is the best approach to make this scalable?
Thank you in advance!
I think you are confused a little about the Google Analtyics api limits.
Managment api, and metadata api have a limit of 10,000 requests per day. 10 requests per second.
The Core reporting api is 10,000 requests per day per User and or (View (used to be profile)) and 50,000 requests per application. You can request that that 50k be extended. But you need to show that there arnt a lot of errors comming from your application.
It might be a good idea to also send send either Userip or quotaUser with all over your requests this will ensure that each of your users gets 10k requests each day. If you dont send quotaUser or UserIp then google lumps them all under the same quota user and they they are as a group limited to the 10k. This may or may not be a problem if you can ensure that sevral users wont be requesting the same data from the same view (used to be profile)
Another thing you should remember is that nextlinks count twards the limit as well so you should either try refine your requests so that you dont get to many rows back or set max-results high enough that you dont get to many nextlinks.
You can read more about how and why you should use QuotaUser here Google Analtyics QuotaUser
The quota is 10,000 per day per profile.
You should be fine especially if each of your clients has a separate profile.
https://developers.google.com/analytics/devguides/reporting/core/v2/limits-quotas#core_reporting

Resources