1
0
Fork 0
mirror of synced 2024-05-20 20:42:27 +12:00

Handle playing when voice is None

This commit is contained in:
Phxntxm 2017-04-23 17:28:13 -05:00
parent 90598f26bf
commit ead82dc4aa

View file

@ -31,7 +31,10 @@ class VoiceState:
@property
def playing(self):
return self.voice.is_playing() or self.voice.is_paused()
if self.voice is None:
return False
else:
return self.voice.is_playing() or self.voice.is_paused()
def skip(self):
self.skip_votes.clear()
@ -209,7 +212,7 @@ class Music:
if after is None or after.channel is None:
return
state = self.voice_states.get(after.channel.guild.id)
if state is None or state.voice is None:
if state is None or state.voice is None or state.voice.channel is None:
return
voice_channel = state.voice.channel
num_members = len(voice_channel.members)