Actually check commands
All checks were successful
Build and Publish Jimmy.2 / build_and_publish (push) Successful in 5s

This commit is contained in:
Nexus 2024-05-27 17:43:20 +01:00
parent 0da4ec5d63
commit 98a73d534f

View file

@ -122,10 +122,12 @@ class Client(commands.Bot):
for command in cmds:
log.debug("Checking %r", command)
try:
assert command.input_type is not None, "Input type was None!"
for option in command.options:
if option.input_type is None:
raise TypeError("Input type is None")
_ = command.to_dict()
except Exception as e:
log.error("Failed to convert %r to dict", command, exc_info=e)
log.error("Failed to validate %r", command, exc_info=e)
self.remove_application_command(command)
else:
log.debug("Loaded command %r.", command)