1
0
Fork 0
mirror of synced 2024-06-03 11:14:33 +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,6 +31,9 @@ class VoiceState:
@property
def playing(self):
if self.voice is None:
return False
else:
return self.voice.is_playing() or self.voice.is_paused()
def skip(self):
@ -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)