question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

voicechannel.members result in a error ('NoneType' object has no attribute 'id')

See original GitHub issue

Summary

Due to a new update on discord (stage channels) getting members from a voice channel results in a error.

Reproduction Steps

I enabled community on my guild and then made a stage channel after that I joined a normal voice channel and when I tried to grab the members of a voice channel I would always get a error

Minimal Reproducible Code

Aivo.get_channel(channelid).members

Expected Results

Returns all the members in a normal voice channel

Actual Results

It errors out

Screenshot: https://cdn.discordapp.com/attachments/821520339242057749/826935480531943424/Discord_tE2MBXrLAD.png

Error:

Ignoring exception in on_voice_state_update Traceback (most recent call last): File “/usr/local/lib/python3.8/dist-packages/discord/client.py”, line 343, in _run_event await coro(*args, **kwargs) File “/root/Azure/Azure.py”, line 137, in on_voice_state_update await if_channel_empty_delete(member, before, after) File “/root/Azure/Azure.py”, line 118, in if_channel_empty_delete check = checkch.members File “/usr/local/lib/python3.8/dist-packages/discord/channel.py”, line 630, in members if state.channel.id == self.id: AttributeError: ‘NoneType’ object has no attribute ‘id’

Intents

All intents enabled

System Information

  • Python v3.8.5-final
  • discord.py v1.6.0-final
  • aiohttp v3.7.4.post0
  • system info: Linux 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021

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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Rapptzcommented, Apr 4, 2021

Fixed by #6608

2reactions
Minlorcommented, Apr 1, 2021

I just accidentally pressed close the close button since I was replying from my phone.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discord.py - AttributeError: 'NoneType' object has no attribute ...
This error happens when I'm in a voice channel. If I'm not, the bot follows the code that I wrote and sent a...
Read more >
Getting 'NoneType' object has no attribute 'id' error - Reddit
I am getting this error with this specific code: latest =… ... Getting 'NoneType' object has no attribute 'id' error.
Read more >
API Reference - discord.py
Represents a client connection that connects to Discord. This class is used to interact with the Discord WebSocket and API. async with x....
Read more >
API Reference - disnake
Retrieves an Invite from a discord.gg URL or ID. Note. If the invite is for a guild you have not joined, the guild...
Read more >
'bot' object has no attribute 'slash_command' - You.com
Discord Bot - AttributeError: 'Client' object has no attribute 'commands' ... role_get = get(member.guild.roles, id=1009168101344030851) AttributeError: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found