await self.prom_voice_channel(before.channel, 0)
if after.channel is not None:
await self.prom_voice_channel(after.channel, 1)
- if before.channel is not None and after.channel is not None and before.channel != after.channel:
+ if before.channel is not None and before.channel != after.channel:
log.debug('Before != after and channels differ, setting the VC appropriately')
- # try to get the already established VC and resave
- self.state.set_voice(after.channel.guild, self.state.get_voice(after.channel.guild))
+ if after.channel is None:
+ self.state.set_voice(before.channel.guild, None)
+ else:
+ # try to get the already established VC and resave
+ self.state.set_voice(before.channel.guild, self.state.get_voice(before.channel.guild))
if __name__ == '__main__':