From c357efd4591d1cf7e54aff6f64473cf8a2696fb8 Mon Sep 17 00:00:00 2001 From: BFlow Date: Fri, 17 Apr 2020 12:29:11 +0200 Subject: [PATCH] Mute 1er essai --- kabot/kabot/kabot.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index 0066a7c..3dd0f16 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -214,6 +214,21 @@ class Mybot(commands.Cog): result = avec_verbe await ctx.send(result) + @commands.command(help="Toi tu fermes ta gueule! Tu la fermes définitivement") + async def mute(ctx, member: discord.Member=None, mute_time = 10): + if not member: + await ctx.channel.send("Qui veux-tu mute?") + return + if mute_time > 60: + await ctx.channel.send("Doucement sur le temps!") + return + role = discord.utils.get(ctx.guild.roles, name="muted") + await member.add_roles(role) + await ctx.send("Tu sors %s!" % member.mention) + await asyncio.sleep(mute_time) + await member.remove_roles(role) + await ctx.channel.send("Tu peux reparler %s!" % member.mention) + @tasks.loop(seconds=1.5) async def play_next(self): if self.sounds: