From 4fcd4e3f2058e873723bd22e06759206d1bf24e1 Mon Sep 17 00:00:00 2001 From: Anri Kennel Date: Tue, 24 Nov 2020 12:39:10 +0100 Subject: [PATCH] =?UTF-8?q?Verification=20dans=20la=20methode=20d'appel=20?= =?UTF-8?q?si=20le=20salon=20sp=C3=A9cifi=C3=A9=20est=20bien=20un=20salon?= =?UTF-8?q?=20vocal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cogs/commands.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cogs/commands.py b/cogs/commands.py index 3de21fe..4bea166 100755 --- a/cogs/commands.py +++ b/cogs/commands.py @@ -221,9 +221,13 @@ class Commands(commands.Cog): """Fais l'appel⁢⁢⁢⁢⁢\n ➡ Syntaxe: .appel [ID salon vocal] """ voice_channels = [] voice_channels.extend(ctx.guild.voice_channels) - if voice_channel: - voice_channels = [self.bot.get_channel(voice_channel)] await ctx.message.add_reaction(emoji = "✅") + if voice_channel: + canal = self.bot.get_channel(voice_channel) + if canal.type.__str__() == "voice": + voice_channels = [canal] + else: + return await ctx.send("Tu as spécifié un channel textuelle et non vocal.") if len(voice_channels) > 0: embed = discord.Embed(title = "Réagissez à ce message avec ✋ pour signaler votre présence.", description = f"(attention, je réagis aussi) — Professeur : {ctx.author.mention}") for channel in voice_channels: