Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.67k stars 3.74k forks source link

My bot has an issue with returning None for member.voice_channel #360

Closed Alkovalic closed 7 years ago

Alkovalic commented 7 years ago

My bot takes message.author.voice_channel upon a summon command, and joins that particular channel. (using the message obtained via on_message)

voice = await self.join_voice_channel(message.author.voice_channel)

However, message.author.voice_channel returns None unless the user switches voice channels before summoning it.

The exception is myself: if I use the summon command, then the bot joins the channel without issue, without me changing voice channels beforehand.

How do I get message.author.voice_channel to return the voice channel the user is in without having them switch voice channels beforehand?

Rapptz commented 7 years ago

Is this a userbot or a real bot?

Alkovalic commented 7 years ago

Oh, userbot. Sorry.

Rapptz commented 7 years ago

Known bug for user bots due to the guild sync change internally. Hard to fix in the current code base.

Alkovalic commented 7 years ago

Okay, I'll finally make the switch to a real bot.

Thank you for your help!