Skip to content

Commit

Permalink
Merge pull request #336 from sysblok/dev
Browse files Browse the repository at this point in the history
fix: fix missing await
  • Loading branch information
alexeyqu authored Nov 5, 2024
2 parents bd1ae57 + e5f3187 commit bf60dd8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tg/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ def send_to_chat_id(self, message_text: str, chat_id: int, **kwargs) -> bool:
return True
except telegram.error.TelegramError as e:
logger.error(f"Could not send a message to {chat_id}: {e}")

username = self.bot.get_chat(chat_id).username
loop = asyncio.get_event_loop()
username = loop.run_until_complete(
self.bot.get_chat(chat_id)
).username
for error_logs_recipient in self.error_logs_recipients:
try:
# Try redirect unsended message to error_logs_recipients
Expand Down

0 comments on commit bf60dd8

Please sign in to comment.