Skip to content

Tag flag command silently fails for parsing errors #102

@mysistersbrother

Description

@mysistersbrother

There are two parts where this can happen

  1. 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.

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions