v4.0.0 #169

Merged
profitroll merged 8 commits from dev into main 2024-12-26 19:59:35 +02:00
Showing only changes of commit 0ce4ddcf7c - Show all commits

View File

@ -173,7 +173,7 @@ class PyroClient(Client):
) )
logger.info( logger.info(
"Bot's info for the locale %s has been updated", "Bot's info for the locale %s has been updated",
self.code, code,
) )
except KeyError: except KeyError:
logger.warning( logger.warning(
@ -309,7 +309,9 @@ class PyroClient(Client):
# This part here looks into the handlers and looks for commands # This part here looks into the handlers and looks for commands
# in it, if there are any. Then adds them to self.commands # in it, if there are any. Then adds them to self.commands
for handler in self.dispatcher.groups[0]: for handler in self.dispatcher.groups[0]:
if isinstance(handler, MessageHandler): if isinstance(handler, MessageHandler) and (
hasattr(handler.filters, "base") or hasattr(handler.filters, "other")
):
for entry in [handler.filters.base, handler.filters.other]: for entry in [handler.filters.base, handler.filters.other]:
if hasattr(entry, "commands"): if hasattr(entry, "commands"):
for command in entry.commands: for command in entry.commands: