The issue is here:
voice_channel = ctx.author.voice.channel
if voice_channel is not None:
Member.voice
returns None
when the member is not in a voice channel, so you should check that first.
voice_state = ctx.author.voice
if voice is not None:
....
CLICK HERE to find out more related problems solutions.