Queer European MD passionate about IT
Explorar o código

Format unknown command message text passing self as bot.

Davte %!s(int64=5) %!d(string=hai) anos
pai
achega
f8cc0c1a22
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      davtelepot/bot.py

+ 4 - 2
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):