chatgpt-telegram icon indicating copy to clipboard operation
chatgpt-telegram copied to clipboard

Hitting Telegram rate-limits on message edits

Open lxy1992 opened this issue 2 years ago • 6 comments

I received the similar error frequently. It seems this bot use the edit message api to send(keep editing one message). When the message is long, the edit action will happen too frequently, then hit the api call rate limit. Hope could replace it by the normal send message.

Error Message:

2022/12/06 09:01:25 Couldn't edit message: Too Many Requests: retry after 30
2022/12/06 09:01:26 Couldn't edit message: Too Many Requests: retry after 29
2022/12/06 09:01:26 Couldn't perform final edit on message: Too Many Requests:

Fixes #28

lxy1992 avatar Dec 06 '22 09:12 lxy1992

Have a same problem. I think we should choose between editing and waiting for a full message. If you use language is not an English, chatgpt returns an answer in a very slow → many edits.

May recommendation: increase debounce timer to 3-4 sec (for messages)

Hormold avatar Dec 06 '22 10:12 Hormold

Do you know why it's not authorized?

(base) chatgpt-telegram-Darwin-arm64 % ./chatgpt-telegram 2022/12/06 16:26:58 Started ChatGPT 2022/12/06 16:27:28 Couldn't start Telegram bot: Post Couldn't start Telegram bot: Post "https://api.telegram.org/bot[telegram_token]/getMe": dial tcp 128.242.250.148:443: i/o timeout

there is return value of the above link: {"ok":false,"error_code":401,"description":"Unauthorized"}

zweny avatar Dec 06 '22 12:12 zweny

Do you know why it's not authorized?

(base) chatgpt-telegram-Darwin-arm64 % ./chatgpt-telegram 2022/12/06 16:26:58 Started ChatGPT 2022/12/06 16:27:28 Couldn't start Telegram bot: Post Couldn't start Telegram bot: Post "https://api.telegram.org/bot[telegram_token]/getMe": dial tcp 128.242.250.148:443: i/o timeout

there is return value of the above link: {"ok":false,"error_code":401,"description":"Unauthorized"}

Looks like token is wrong

Hormold avatar Dec 06 '22 15:12 Hormold

Would be down for a PR that makes the number of seconds customizable

m1guelpf avatar Dec 06 '22 19:12 m1guelpf

Would be down for a PR that makes the number of seconds customizable

I have implement this feat in this PR: Fixes #28

lxy1992 avatar Dec 07 '22 04:12 lxy1992

@m1guelpf Hope this PR could be merged, I have tested it on my server, works just fine.

lxy1992 avatar Dec 07 '22 14:12 lxy1992