Fixed two broken references
Some checks failed
Analysis / SonarCloud (pull_request) Successful in 42s
Tests / Build and Test (3.10) (pull_request) Failing after 57s
Tests / Build and Test (3.11) (pull_request) Successful in 1m2s
Tests / Build and Test (3.12) (pull_request) Successful in 1m11s
Tests / Build and Test (3.9) (pull_request) Has been cancelled

This commit is contained in:
Profitroll 2024-12-26 18:37:55 +01:00
parent aa2c778a6a
commit 0ce4ddcf7c

View File

@ -173,7 +173,7 @@ class PyroClient(Client):
)
logger.info(
"Bot's info for the locale %s has been updated",
self.code,
code,
)
except KeyError:
logger.warning(
@ -309,7 +309,9 @@ class PyroClient(Client):
# This part here looks into the handlers and looks for commands
# in it, if there are any. Then adds them to self.commands
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]:
if hasattr(entry, "commands"):
for command in entry.commands: