Skip to content

Commit

Permalink
fix(tg_signer): handle bad request errors(such as 'InputUserDeactivat…
Browse files Browse the repository at this point in the history
…ed') when sending messages
  • Loading branch information
amchii committed Jan 16, 2025
1 parent 957b67a commit 59cc38d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tg_signer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,14 @@ async def run(
for chat in config.chats:
self.context["sign_chats"][chat.chat_id].append(chat)
self.log(f"发送消息至「{chat.chat_id}」")
await self.sign(
chat.chat_id, chat.sign_text, chat.delete_after
)
try:
await self.sign(
chat.chat_id, chat.sign_text, chat.delete_after
)
except errors.BadRequest as e:
self.log(f"发送消息失败:{e}")
continue

if chat.has_keyboard:
self.context["waiting_counter"].add(chat.chat_id)
await asyncio.sleep(0.5)
Expand Down

0 comments on commit 59cc38d

Please sign in to comment.