-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Open
Labels
unconfirmed bugA bug report that needs triagingA bug report that needs triaging
Description
Summary
FlagConvert not usable on app_commands
Reproduction Steps
This might be a duplicate of #9641. If yes, feel free to close this.
Minimal Reproducible Code
class RaceFlags(commands.FlagConverter):
goal: str | None = None
when: str | None = None
streaming_required: bool = False
race_info: str | None = None
announce: bool = False
class LadxrRace(commands.Cog):
@app_commands.command()
@app_commands.guild_only()
async def communityrace(
self,
interaction: Interaction,
*,
flags: RaceFlags,
) -> None:
passExpected Results
it should just work :)
Actual Results
| Traceback (most recent call last):
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/ext/commands/bot.py", line 962, in _load_from_module_spec
| spec.loader.exec_module(lib) # type: ignore
| ~~~~~~~~~~~~~~~~~~~~~~~^^^^^
| File "<frozen importlib._bootstrap_external>", line 762, in exec_module
| File "<frozen importlib._bootstrap>", line 491, in _call_with_frames_removed
| File "/home/marcel/projects/discord_bot/v2.0/src/windfish/discord/cogs/ladxr_race.py", line 32, in <module>
| class LadxrRace(commands.Cog):
| ...<65 lines>...
| await interaction.followup.send(f"Your raceroom url: {url}")
| File "/home/marcel/projects/discord_bot/v2.0/src/windfish/discord/cogs/ladxr_race.py", line 45, in LadxrRace
| @app_commands.command()
| ~~~~~~~~~~~~~~~~~~~~^^
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/app_commands/commands.py", line 2065, in decorator
| return Command(
| name=name if name is not MISSING else func.__name__,
| ...<5 lines>...
| extras=extras,
| )
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/app_commands/commands.py", line 688, in __init__
| self._params: Dict[str, CommandParameter] = _extract_parameters_from_callback(callback, callback.__globals__)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/app_commands/commands.py", line 384, in _extract_parameters_from_callback
| param = annotation_to_parameter(resolved, parameter)
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/app_commands/transformers.py", line 837, in annotation_to_parameter
| (inner, default, validate_default) = get_supported_annotation(annotation)
| ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/app_commands/transformers.py", line 796, in get_supported_annotation
| raise TypeError(f'unsupported type annotation {annotation!r}')
| TypeError: unsupported type annotation <class 'windfish.discord.cogs.ladxr_race.RaceFlags'>
|
| The above exception was the direct cause of the following exception:
|
| Traceback (most recent call last):
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/client.py", line 846, in start
| await self.login(token)
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/client.py", line 689, in login
| await self.setup_hook()
| File "/home/marcel/projects/discord_bot/v2.0/src/windfish/discord/discord.py", line 47, in setup_hook
| await self.load_extension(mod, package=str(__package__))
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/ext/commands/bot.py", line 1040, in load_extension
| await self._load_from_module_spec(spec, name)
| File "/home/marcel/projects/discord_bot/v2.0/.venv/lib/python3.14/site-packages/discord/ext/commands/bot.py", line 965, in _load_from_module_spec
| raise errors.ExtensionFailed(key, e) from e
| discord.ext.commands.errors.ExtensionFailed: Extension 'windfish.discord.cogs.ladxr_race' raised an error: TypeError: unsupported type annotation <class 'windfish.discord.cogs.ladxr_race.RaceFlags'>
Intents
all
System Information
- Python v3.14.0-final
- discord.py v2.6.4-final
- aiohttp v3.13.2
- system info: Linux 6.17.8-arch1-1 Fix issue with author changing type #1 SMP PREEMPT_DYNAMIC Fri, 14 Nov 2025 06:54:20 +0000
Checklist
- I have searched the open issues for duplicates.
- I have shown the entire traceback, if possible.
- I have removed my token from display, if visible.
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
unconfirmed bugA bug report that needs triagingA bug report that needs triaging