Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account for telegram rate limiting #17

Open
armand1m opened this issue Aug 10, 2022 · 0 comments
Open

account for telegram rate limiting #17

armand1m opened this issue Aug 10, 2022 · 0 comments

Comments

@armand1m
Copy link
Owner

sometimes during startup after some unexpected termination (like when I forget to pay the GCP account, the cluster gets some workloads disabled, and when I pay they come back up), we get this error multiple times:

{"level":30,"time":1660134420391,"pid":1,"hostname":"gringobot-6b8d987846-kdv99","msg":"Bot is running."}
{"level":30,"time":1660134430926,"pid":1,"hostname":"gringobot-6b8d987846-kdv99","msg":"Creating message deletion interval for chat \"-1001578006520\"."}
{"level":30,"time":1660134431023,"pid":1,"hostname":"gringobot-6b8d987846-kdv99","msg":"Creating message deletion interval for chat \"-1001241627505\"."}
/app/node_modules/telegraf/lib/core/network/client.js:258
            throw new error_1.default(data, { method, payload });
                  ^

TelegramError: 429: Too Many Requests: retry after 6
    at Telegram.callApi (/app/node_modules/telegraf/lib/core/network/client.js:258:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  response: {
    ok: false,
    error_code: 429,
    description: 'Too Many Requests: retry after 6',
    parameters: { retry_after: 6 }
  },
  on: {
    method: 'setMyCommands',

this error terminates the container, which then when launched again will run in the same issue until the rate limiting is over

the error message is always on the setMyCommands method, but my guess is that it happens after the runMessageRecycling starts spinning up multiple promises to delete certain messages: https://github.com/armand1m/gringobot/blob/main/src/autoDeleteMessages.ts#L68-L72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant