Skip to content

Issubclass Error with BridgeCommands. #1972

Closed
@AlphaIru

Description

@AlphaIru

Summary

Issubclass Error Occurs when Option's choice is set to Boolean.

Reproduction Steps

Just used the options decorator with its choice set to boolean. I transfered from Slash_commands and to Bridge_commands, and the bug started showing up, but not for other ones.

This is the MOST important part: Although the slash_commands work FINE, but the prefix_commands does NOT.

Minimal Reproducible Code

@bridge_command.command("test", "this is a test")
@option("boolean", "choose True or False")
async def test_command(ctx, boolean):
    ctx.respond(boolean)

Expected Results

Whatever the result was with that Boolean.
If the choice was True, return True, and vice-versa.

Actual Results

Throw an error on to on_command_error.

Ignoring exception in on_command_error
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/converter.py", line 1147, in _actual_conversion
return await converter.convert(ctx, argument)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/bridge/core.py", line 543, in convert
if issubclass(converter, Converter):
File "/usr/lib/python3.8/abc.py", line 102, in subclasscheck
return _abc_subclasscheck(cls, subclass)
TypeError: issubclass() arg 1 must be a class

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/client.py", line 378, in _run_event
await coro(*args, **kwargs)
File "/home/ubuntu/Yomasete_Iruka_V3/ruka.py", line 327, in on_command_error
raise error
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 347, in invoke
await ctx.command.invoke(ctx)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 1545, in invoke
await ctx.invoked_subcommand.invoke(ctx)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 942, in invoke
await self.prepare(ctx)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 872, in prepare
await self._parse_arguments(ctx)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 774, in _parse_arguments
transformed = await self.transform(ctx, param)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/bridge/core.py", line 94, in transform
return await super().transform(ctx, param)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/core.py", line 618, in transform
return await run_converters(ctx, converter, argument, param) # type: ignore
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/converter.py", line 1255, in run_converters
return await _actual_conversion(ctx, converter, argument, param)
File "/home/ubuntu/.local/lib/python3.8/site-packages/discord/ext/commands/converter.py", line 1151, in _actual_conversion
raise ConversionError(converter, exc) from exc
discord.ext.commands.errors.ConversionError: (<discord.commands.BridgeOption name=boolean>, TypeError('issubclass() arg 1 must be a class'))

Intents

messages=True, message_content=True, guilds=True, members=True, voice_states=True, guild_reactions=True

System Information

  • Python v3.8.10-final
  • py-cord v2.4.None-final
  • aiohttp v3.8.1
  • system info: Linux 5.15.90.1-microsoft-standard-WSL2 Update README.rst #1 SMP Fri Jan 27 02:56:13 UTC 2023

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 maybe not sure, but the similar problem happened with AutoCompleteConetext too.
I did not throughly check it so don't take it seriously, but that also does not work too with prefix_commands.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions