Channel selection not working
Closed this issue · 4 comments
Summary
In a slash command, when using discord.VoiceChannel or discord.TextChannel (could be more), it is unable to retrieve the guild ID for some reason.
Reproduction Steps
Use a type-hint of discord.VoiceChannel
for a parameter in a slash command.
Execute slash command.
Minimal Reproducible Code
@commands.group(invoke_without_command=True)
async def lobby(self, ctx: vbu.Context):
"""
Placeholder method
:param ctx: Command context.
:return:
"""
@lobby.command()
@commands.defer()
async def test(self, ctx: vbu.Context):
await respond(ctx, msg=str(ctx.guild.id))
@lobby.command()
@commands.defer()
@commands.guild_only()
async def create(self, ctx: vbu.Context, channel: discord.VoiceChannel):
pass
Expected Results
No errors to be thrown and command to execute normally.
Actual Results
Command threw an error which can be viewed here - https://hastebin.com/abahahamem.sql
Intents
Using vbu, all intents are enabled
System Information
- Python v3.9.7-final
- Novus v0.0.3-final
- aiohttp v3.7.4.post0
- system info: Windows 10 10.0.19043
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
This is the same setup, to my knowledge, as the one used in Apple.Py (https://github.com/Voxel-Fox-Ltd/Apple.Py/blob/11d9de7c708a0fc08e1ed90307493113fa8d25ac/cogs/vc_admin.py#L20) which I used as a reference when creating this command.
Should probably also mention that I suspect this will happen for all channel classes (I.e. discord.TextChannel, discord.StageChannel etc.)
I can't recreate this error on master - could you confirm if this is fixed for you if you update?
I will try doing so when I wake up tomorrow.
I'll try adding the git repo and master branch directly - Depending on how many commits have been made since 0.0.3 was released, it may be missing a commit that fixes it.
This issue is now resolved on the master branch, however does persist in the released version 0.0.3
.