mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
Fix voice
This commit is contained in:
parent
ea07b5af3e
commit
2054a3ee5a
1 changed files with 9 additions and 3 deletions
|
@ -226,9 +226,15 @@ class Events(commands.Cog):
|
|||
if "it just works" in message.content.lower():
|
||||
file = Path.cwd() / "assets" / "it-just-works.ogg"
|
||||
if message.author.voice is not None and message.author.voice.channel is not None:
|
||||
if message.guild.me.voice is not None and message.guild.me.voice.channel != message.author.voice.channel:
|
||||
await message.guild.voice_state.disconnect()
|
||||
voice = await message.author.voice.channel.connect()
|
||||
voice: discord.VoiceClient = None
|
||||
if message.guild.me.voice is not None:
|
||||
voice = message.guild.me.voice
|
||||
else:
|
||||
voice = await message.author.voice.channel.connect()
|
||||
|
||||
if voice.channel != message.author.voice.channel:
|
||||
await voice.move_to(message.author.voice.channel)
|
||||
|
||||
if message.guild.me.voice.self_mute or message.guild.me.voice.mute:
|
||||
await voice.disconnect()
|
||||
await message.channel.trigger_typing()
|
||||
|
|
Loading…
Reference in a new issue