You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using utils.get to fetch a voice channel will fail with a TypeError if a command is executed that contains a VoiceChannel as an option.
Reproduction Steps
Execute a slash command that has an option parameter of type discord.VoiceChannel.
Attempt to run any code that uses utils.get to fetch a VoiceChannel afterwards. It will fail, and any subsequent attempts to use utils.get to fetch a VoiceChannel will fail too.
Minimal Reproducible Code
I reproduced this using the following two bot commands in a bot implementation. These commands were created in a cog:
Use /bug-test, which will continually show a fetched channel, then at any point use /bug-test-two. The loop in the first command's task will then fail with a traceback, as will any subsequent attempts anywhere to use utils.get() to fetch a VoiceChannel.
Expected Results
The utils.get() method continues to function after commands with VoiceChannel as an option are used.
Actual Results
07/10/2022 04:24:11 PM - asyncio - ERROR -> Task exception was never retrieved
future: <Task finished name='Task-37' coro=<WaitlistQueue.bug_test.<locals>.test_task() done, defined at C:\Users\Tiffany\dev\bot\cogs\av_fleet_queue\fleet_queue_main.py:736> exception=TypeError("'<' not supported between instances of 'NoneType' and 'int'")>
Traceback (most recent call last):
File "C:\Users\Tiffany\dev\bot\cogs\av_fleet_queue\fleet_queue_main.py", line 739, in test_task
channel = utils.get(ctx.guild.voice_channels, name=channel_name)
File "c:\Users\Tiffany\dev\bot\venv\lib\site-packages\discord\guild.py", line 620, in voice_channels
r.sort(key=lambda c: (c.position, c.id))
TypeError: '<' not supported between instances of 'NoneType' and 'int'
Intents
All
System Information
Python v3.9.2-final
py-cord v2.0.0-final
aiohttp v3.8.1
system info: Windows 8.1 6.3.9600
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 error did not occur in 2.0.0rc1. This causes the stable release of 2.0.0 to be unsuitable for live deployments for any bot that has any meaningful interaction with voice channels.
It would seem whatever fix was applied to keep cached channel data up to date specifically from slash options completely breaks the cache for VCs.
The text was updated successfully, but these errors were encountered:
According to your traceback statement, the code you showed isn't even remotely related to the problem. Could you maybe elaborate on how the code you showed is related to the actual error?
According to your traceback statement, the code you showed isn't even remotely related to the problem. Could you maybe elaborate on how the code you showed is related to the actual error?
Apologies for the hastily thrown together report when I originally filed it. I have updated the initial report with proper information that should allow you to replicate this issue easily.
Summary
Using utils.get to fetch a voice channel will fail with a TypeError if a command is executed that contains a VoiceChannel as an option.
Reproduction Steps
Execute a slash command that has an option parameter of type discord.VoiceChannel.
Attempt to run any code that uses utils.get to fetch a VoiceChannel afterwards. It will fail, and any subsequent attempts to use utils.get to fetch a VoiceChannel will fail too.
Minimal Reproducible Code
I reproduced this using the following two bot commands in a bot implementation. These commands were created in a cog:
Use
/bug-test
, which will continually show a fetched channel, then at any point use/bug-test-two
. The loop in the first command's task will then fail with a traceback, as will any subsequent attempts anywhere to use utils.get() to fetch a VoiceChannel.Expected Results
The utils.get() method continues to function after commands with VoiceChannel as an option are used.
Actual Results
Intents
All
System Information
Checklist
Additional Context
This error did not occur in 2.0.0rc1. This causes the stable release of 2.0.0 to be unsuitable for live deployments for any bot that has any meaningful interaction with voice channels.
It would seem whatever fix was applied to keep cached channel data up to date specifically from slash options completely breaks the cache for VCs.
The text was updated successfully, but these errors were encountered: