danparizher / Pax-Academia

General purpose utility bot for the Homework Help Discord server
MIT License
13 stars 5 forks source link

fix: pycord cannot process string type hints #239

Closed GabeMillikan closed 1 year ago

GabeMillikan commented 1 year ago

from __future__ import annotations converts all type annotations into strings. Pycord reads these type hints at runtime to determine the schema of slash commands, which makes it incompatible with __future__.annotations.

Rather than removing this import, we can just explicitly tell pycord the type for each option (via @option(name, type)) so that it doesn't need to be inferred.