Skip to content

Commit 357364b

Browse files
committed
Fix converter instance check
1 parent dddf38d commit 357364b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

discord/commands/core.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,9 +854,10 @@ async def _invoke(self, ctx: ApplicationContext) -> None:
854854
elif op.input_type == SlashCommandOptionType.string and (converter := op.converter) is not None:
855855
from discord.ext.commands import Converter
856856
if isinstance(converter, Converter):
857-
arg = await converter.convert(ctx, arg)
858-
elif isinstance(converter, type) and hasattr(converter, "convert"):
859-
arg = await converter().convert(ctx, arg)
857+
if isinstance(converter, type):
858+
arg = await converter().convert(ctx, arg)
859+
else:
860+
arg = await converter.convert(ctx, arg)
860861

861862
elif op._raw_type in (SlashCommandOptionType.integer,
862863
SlashCommandOptionType.number,

0 commit comments

Comments
 (0)