-
-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BridgeOption converts discord.Member wrong with ext command #2394
Comments
@Revnoplex Are you still experiencing this issue ? I cannot reproduce it with the following code: @bot.bridge_command(name='test', description="Hello World")
@bridge.bridge_option('member', discord.Member, description='A server member')
async def test_cmd(
ctx: bridge.BridgeContext,
member: discord.Member
):
await ctx.respond(f"{type(member)}") |
Can you confirm you tried running the command as a prefix command and not a slash command? |
@Revnoplex I tried with both slash and prefix, in cogs and outside of cogs. Would you mind trying yourself again with the latest |
I have been testing on the somewhat latest commit past 2.6.1, I will have to investigate further |
Actually, could you install from the latest github master branch ? |
I'm still getting the same results with the following environment:
I will try creating a new environment all together and try testing again |
Still reproducing it after creating a new project and with the following file: #!./venv/bin/python3.13
import discord
from discord.ext import bridge
bot = bridge.Bot(command_prefix="ra!", intents=discord.Intents.all())
@bot.event
async def on_ready():
print(f"We have logged in as {bot.user}")
@bot.bridge_command(name='test', description="Hello World")
@bridge.bridge_option('member', discord.Member, description='A server member')
async def test_cmd(
ctx: bridge.BridgeContext,
member: discord.Member
):
await ctx.respond(f"{type(member)}")
bot.run("TOKEN") If you still can't reproduce it, Im trying to setup a new environment on another machine where I will test there as well |
I tested on another machine with the same code as above:
And still got the same results |
what about python 3.12 or below? |
Nope, still the same for python 3.12.7 using the code in #2394 (comment) |
How does the converter actually work? Because I traced the function calls that happen when the ext command runs and I don't see any checks for converting it to member. And I have no idea what functions are used when a slash command is run. From what I understand, the functions called by the bridge option at invoke time for prefix commands was: Can someone please point out where this |
Ok so this is specifically an issue with If you typehint the option as |
Can you assign me pls ? |
Finish the other prs / issues first please |
@Lulalaby I think all are ready for review |
Summary
BridgeOption converts
discord.Member
to adiscord.User
object when using the ext version unlike the slash version. Specifying discord.Member withoutBridgeOption
works fine with both variants of the bridge commandReproduction Steps
Use a bridge command with an argument that has the
BridgeOption
converter withdiscord.Member
as an argument.Minimal Reproducible Code
Expected Results
For both the ext and slash command version to return a
discord.Member
objects like usingdiscord.Member
without aBridgeOption
converterActual Results
The ext variant of the command gets a
discord.User
object instead of adiscord.Member
object like the slash variant gets or the version without the converter gets.This can cause unexpected
discord.User
objects when running the ext variant that can cause problems likeNote: traceback not related to minimal reproduction code
Intents
all
System Information
Checklist
Additional Context
No response
The text was updated successfully, but these errors were encountered: