mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 18:16:34 +01:00
IT DID SAVE!!!!
This commit is contained in:
parent
a1e00cd3bb
commit
d9552cf6ec
1 changed files with 14 additions and 11 deletions
|
@ -161,7 +161,7 @@ class Events(commands.Cog):
|
|||
member: discord.Member,
|
||||
*_
|
||||
):
|
||||
me_voice = member.guild.voice_state
|
||||
me_voice = member.guild.me.voice
|
||||
if me_voice is None or me_voice.channel is None:
|
||||
return
|
||||
|
||||
|
@ -225,11 +225,14 @@ class Events(commands.Cog):
|
|||
if message.channel.can_send(): # ... and we can send messages
|
||||
if "it just works" in message.content.lower():
|
||||
file = Path.cwd() / "assets" / "it-just-works.ogg"
|
||||
if message.author.voice is not None:
|
||||
if message.guild.voice is not None:
|
||||
await message.guild.voice.disconnect()
|
||||
my_voice = await message.author.voice.channel.connect()
|
||||
if message.author.voice is not None and message.author.voice.channel is not None:
|
||||
if message.guild.me.voice is not None:
|
||||
await message.guild.me.voice.disconnect()
|
||||
voice = await message.author.voice.channel.connect()
|
||||
if voice.self_mute or voice.mute:
|
||||
await voice.disconnect()
|
||||
await message.reply("Unmute me >:(", file=discord.File(file))
|
||||
else:
|
||||
voice.play(
|
||||
discord.FFmpegPCMAudio(str(file), stderr=subprocess.DEVNULL),
|
||||
after=lambda _: asyncio.run_coroutine_threadsafe(
|
||||
|
|
Loading…
Reference in a new issue