From 8ac12707b60e700b500b75dd6b3b2d786509a30e Mon Sep 17 00:00:00 2001 From: Davte Date: Tue, 9 Jul 2019 17:11:06 +0200 Subject: [PATCH] If bot has no `messages` attribute, set it --- davtelepot/admin_tools.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/davtelepot/admin_tools.py b/davtelepot/admin_tools.py index d3a433d..3bfa8aa 100644 --- a/davtelepot/admin_tools.py +++ b/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: