From f8cc0c1a224d718dbb820406638ca85aeadef2c8 Mon Sep 17 00:00:00 2001 From: Davte Date: Mon, 15 Jul 2019 15:30:22 +0200 Subject: [PATCH] Format unknown command message text passing self as bot. --- davtelepot/bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/davtelepot/bot.py b/davtelepot/bot.py index 60cf17d..34f0705 100644 --- a/davtelepot/bot.py +++ b/davtelepot/bot.py @@ -347,8 +347,10 @@ class Bot(TelegramBot, ObjectWithDatabase): If instance message is not set, class message is returned. """ if self._unknown_command_message: - return self._unknown_command_message - return self.__class__._unknown_command_message + message = self._unknown_command_message + else: + message = self.__class__._unknown_command_message + return message.format(bot=self) @property def callback_data_separator(self):