AttributeError: type object '<type>' has no attribute 'value' when using typing.Annotated #2223
Closed
3 tasks done
Labels
unconfirmed bug
A bug report that needs triaging
Summary
When using
typing.Annotated
withdiscord.Option
, the former argument is not respected, and instead raises an error unless it is of typediscord.SlashCommandOptionType
.Reproduction Steps
typing.Annotated
to annotate an argumentAnnotated
toint
(or any other supported type, but I only tested withint
andbool
)Annotated
todiscord.Option
discord.Option
to the same one you put for Annotated (i.e.int
,bool
, etc)discord.Option
values (I usename
,description
,required=False
, anddefault=3
in my instance)to_dict()
raisingAttributeError
Minimal Reproducible Code
Expected Results
I expected the first value of
Annotated
to be ignored, really, prioritising the one passed todiscord.Option
itself. However, regardless, the type is not converted to a suitablediscord.SlashCommandOptionType
inOption.to_dict
.Actual Results
A traceback is thrown while trying to sync commands:
Intents
All
System Information
Not important, however, repro on two machines:
Production (server):
and dev (workstation):
Checklist
Additional Context
Conversation in Basic Pycord Help thread:
I am not using the development release, I installed straight from GitHub. I updated before making this issue, and the problem persists.
The text was updated successfully, but these errors were encountered: