mirror of
https://github.com/PaiGramTeam/GramCore.git
synced 2024-11-16 03:55:27 +00:00
fix a bug
This commit is contained in:
parent
9aef99fd1a
commit
b3b849e55b
@ -199,6 +199,7 @@ class Application(Singleton):
|
||||
if application_config.bot.is_webhook and application_config.webserver.enable:
|
||||
await self.bot.set_webhook(application_config.bot.webhook_url)
|
||||
else:
|
||||
await self.bot.delete_webhook()
|
||||
await self.telegram.updater.start_polling(
|
||||
error_callback=error_callback, allowed_updates=Update.ALL_TYPES
|
||||
)
|
||||
|
@ -60,6 +60,9 @@ class RateLimiter(BaseRateLimiter[int]):
|
||||
await self._on_called_api(endpoint, data, result)
|
||||
return result
|
||||
except RetryAfter as exc:
|
||||
if endpoint == "setWebhook" and exc.retry_after == 1:
|
||||
# webhook 已被正确设置
|
||||
return True
|
||||
logger.warning("chat_id[%s] 触发洪水限制 当前被服务器限制 retry_after[%s]秒", chat_id, exc.retry_after)
|
||||
self._limiter_info[chat_id] = time + (exc.retry_after * 2)
|
||||
sleep = exc.retry_after + 0.1
|
||||
|
Loading…
Reference in New Issue
Block a user