-
Notifications
You must be signed in to change notification settings - Fork 147
Open
Labels
unconfirmed bugSomething might not be workingSomething might not be working
Description
Summary
ColourConverter.convert returns a tuple upon receiving the string holographic_style (or "holographic style")
Reproduction Steps
- Create a prefix command with a parameter annotated with
commands.Color. - Run the bot.
- Run the command, passing it
holographic_styleas an argument. - Boom, the converter returns a tuple rather than
commands.Color(or failing)
Minimal Reproducible Code
import os
import disnake
from disnake.ext import commands
intents = disnake.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix=",", intents=intents)
@bot.command()
async def woo(ctx: commands.Context, color: disnake.Color) -> None:
await ctx.send(str(color))
bot.run(os.getenv("BOT_TOKEN"))Expected Results
The converter should fail with an exception
Actual Results
The converter returns a tuple of 3 Colors, while it's annotated as returning a Color
Intents
.default() + message_content
System Information
- Python v3.10.18-final
- disnake v2.11.0-alpha
- disnake importlib.metadata: v2.12.0a4863+g3aa64412
- aiohttp v3.12.15
- system info: Windows 10 10.0.26100 AMD64Checklist
- 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
Bad code!
disnake/disnake/ext/commands/converter.py
Lines 753 to 757 in 9ebc9de
| arg = arg.replace(" ", "_") | |
| method = getattr(disnake.Colour, arg, None) | |
| if arg.startswith("from_") or method is None or not inspect.ismethod(method): | |
| raise BadColourArgument(arg) | |
| return method() |
Metadata
Metadata
Assignees
Labels
unconfirmed bugSomething might not be workingSomething might not be working