-
-
Notifications
You must be signed in to change notification settings - Fork 482
Description
Summary
With python 3.11+, using Flag
results in a TypeError
about unexpected __init__
arguments
Reproduction Steps
- Use python 3.11+
- Install pycord master
- Use
discord.commands.ext.flag
Minimal Reproducible Code
class BasicText(FlagConverter):
text: str = flag(aliases=["t", "-t"])
reverse: bool = False
@bot.command()
async def echo(ctx, *, flags: BasicText):
text = flags.text[::-1] if flags.reverse else flags.text
await ctx.send(f"Echo: {text}")
Expected Results
The bot to run.
Actual Results
Traceback (most recent call last):
File "C:\Users\Jérémie\Documents\GitHub\pycord\thing.py", line 23, in <module>
class BasicText(FlagConverter):
File "C:\Users\Jérémie\Documents\GitHub\pycord\thing.py", line 24, in BasicText
text: str = flag(aliases=["t", "-t"])
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jérémie\Documents\GitHub\pycord\discord\ext\commands\flags.py", line 136, in flag
return Flag(
^^^^^
TypeError: Flag.__init__() got an unexpected keyword argument 'name'
Intents
n/a
System Information
- Python v3.11.9-final
- py-cord v2.6.1-final
- aiohttp v3.10.10
- system info: Windows 10 10.0.26120
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
I will open a pr to fix this.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done