Queer European MD passionate about IT
소스 검색

If bot has no `messages` attribute, set it

Davte 5 년 전
부모
커밋
8ac12707b6
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      davtelepot/admin_tools.py

+ 2 - 0
davtelepot/admin_tools.py

@@ -491,6 +491,8 @@ async def _talk_button(update, bot):
 
 def init(bot):
     """Assign parsers, commands, buttons and queries to given `bot`."""
+    if not hasattr(bot, 'messages'):
+        bot.messages = dict()
     bot.messages['talk'] = TALK_MESSAGES
     with bot.db as db:
         if 'talking_sessions' not in db.tables: