diff --git a/src/bot.py b/src/bot.py index dc45521..f8af2a5 100644 --- a/src/bot.py +++ b/src/bot.py @@ -391,9 +391,11 @@ def init_handlers(self): "db_fetch_strings_sheet", self.admin_reply_handler("db_fetch_strings_sheet_job"), ) - self.add_handler( + self.add_admin_handler( "db_fetch_all_team_members", + CommandCategories.DATA_SYNC, self.admin_reply_handler("db_fetch_all_team_members_job"), + "db_fetch_all_team_members", ) # general purpose cmds diff --git a/src/tg/sender.py b/src/tg/sender.py index 0c14f86..ad375d0 100644 --- a/src/tg/sender.py +++ b/src/tg/sender.py @@ -90,7 +90,7 @@ def send_to_chat_id(self, message_text: str, chat_id: int, **kwargs) -> bool: ) ) return True - except telegram.TelegramError as e: + 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 @@ -109,7 +109,7 @@ def send_to_chat_id(self, message_text: str, chat_id: int, **kwargs) -> bool: **kwargs, ), ) - except telegram.TelegramError as e: + except telegram.error.TelegramError as e: logger.error( "Could not redirect unsended message " f"to error_logs_recipients {error_logs_recipient}: {e}" @@ -131,7 +131,7 @@ def send_to_chat_id(self, message_text: str, chat_id: int, **kwargs) -> bool: ), ) return True - except telegram.TelegramError as e: + except telegram.error.TelegramError as e: logger.error( f"Could not send a plain-text message to {chat_id}: {e}" )