-
Notifications
You must be signed in to change notification settings - Fork 23
Description
There are two parts where this can happen
- Parsing of the command
The flags argument uses an Optional type annotation which is treated specially by discord.py. This results in any error when parsing this argument to be ignored. Instead of this, a default value of None should simply be used, this will preserve the auto-generated signature which represents the argument as optional. To maintain proper typing, typing.Annotated can be used. This can cause problems as explored in #101.
- Deserializing the JSON input
json.loads is called without any error handling. This results in any JSON error silently failing and the bot not responding to a command input. This should be updated to provide useful feedback to the user. Optionally, the resulting object can be validated against the expected Flags structure.