add sleep quand l'autre con il parle

This commit is contained in:
BFlow 2020-04-20 16:35:07 +02:00
parent 1804f6d1e2
commit d89024d32f

View file

@ -107,6 +107,8 @@ class Mybot(commands.Cog):
with open(path, 'r') as f: with open(path, 'r') as f:
lines = f.read().splitlines() lines = f.read().splitlines()
nb_lines = len(lines) nb_lines = len(lines)
with ctx.channel.typing():
await asyncio.sleep(0.5)
await ctx.channel.send("j'ai %s lignes dans mon stock" % nb_lines) await ctx.channel.send("j'ai %s lignes dans mon stock" % nb_lines)
@commands.command(help='slap this ass') @commands.command(help='slap this ass')
@ -129,8 +131,12 @@ class Mybot(commands.Cog):
user = ctx.message.mentions[0] user = ctx.message.mentions[0]
user = user.mention user = user.mention
if user == self.bot.user.mention: if user == self.bot.user.mention:
with ctx.channel.typing():
await asyncio.sleep(0.5)
await ctx.channel.send("je tribuche par terre et je sais pas comment") await ctx.channel.send("je tribuche par terre et je sais pas comment")
else: else:
with ctx.channel.typing():
await asyncio.sleep(len(slap_multiple)/4)
await ctx.channel.send(random.choice(slap_multiple) % user) await ctx.channel.send(random.choice(slap_multiple) % user)
@commands.command(help="Interrogation issues") @commands.command(help="Interrogation issues")
@ -211,24 +217,36 @@ class Mybot(commands.Cog):
result = sans_verbe result = sans_verbe
elif piece == "face": elif piece == "face":
result = avec_verbe result = avec_verbe
with ctx.channel.typing():
await asyncio.sleep(len(result)/4)
await ctx.send(result) await ctx.send(result)
@commands.command(help="Toi tu fermes ta gueule! Tu la fermes définitivement") @commands.command(help="Toi tu fermes ta gueule! Tu la fermes définitivement")
async def mute(self, ctx, member: discord.Member=None, mute_time = 10): async def mute(self, ctx, member: discord.Member=None, mute_time = 10):
if member.voice.mute: if member.voice.mute:
with ctx.channel.typing():
await asyncio.sleep(1)
await ctx.channel.send("Tu ne vas pas m'avoir si facilement") await ctx.channel.send("Tu ne vas pas m'avoir si facilement")
return return
if not member: if not member:
with ctx.channel.typing():
await asyncio.sleep(1)
await ctx.channel.send("Qui veux-tu mute?") await ctx.channel.send("Qui veux-tu mute?")
return return
if mute_time > 60: if mute_time > 60:
with ctx.channel.typing():
await asyncio.sleep(1)
await ctx.channel.send("Doucement sur le temps!") await ctx.channel.send("Doucement sur le temps!")
return return
member = ctx.message.mentions[0] member = ctx.message.mentions[0]
await member.edit(mute=True) await member.edit(mute=True)
with ctx.channel.typing():
await asyncio.sleep(1)
await ctx.send("Tu sors %s!" % member.mention) await ctx.send("Tu sors %s!" % member.mention)
await asyncio.sleep(mute_time) await asyncio.sleep(mute_time)
await member.edit(mute=False) await member.edit(mute=False)
with ctx.channel.typing():
await asyncio.sleep(1)
await ctx.channel.send("Tu peux reparler %s!" % member.mention) await ctx.channel.send("Tu peux reparler %s!" % member.mention)
@commands.command(help="Appuie sur la detente PUSSY!") @commands.command(help="Appuie sur la detente PUSSY!")
@ -240,12 +258,18 @@ class Mybot(commands.Cog):
if bullet == True: if bullet == True:
await self.joke(ctx, "omawa_shindeiru.mp3") await self.joke(ctx, "omawa_shindeiru.mp3")
await member.edit(mute=True) await member.edit(mute=True)
with ctx.channel.typing():
await asyncio.sleep(0.5)
await ctx.channel.send("Perdu, tu es mute pendant 60 secondes!") await ctx.channel.send("Perdu, tu es mute pendant 60 secondes!")
else: else:
with ctx.channel.typing():
await asyncio.sleep(0.5)
await ctx.channel.send("Gagné, tu ne seras pas mute!") await ctx.channel.send("Gagné, tu ne seras pas mute!")
return return
await asyncio.sleep(mute_time) await asyncio.sleep(mute_time)
await member.edit(mute=False) await member.edit(mute=False)
with ctx.channel.typing():
await asyncio.sleep(0.5)
await ctx.channel.send("Tu peux reparler %s!" % member.mention) await ctx.channel.send("Tu peux reparler %s!" % member.mention)
@tasks.loop(seconds=1.5) @tasks.loop(seconds=1.5)
@ -272,6 +296,8 @@ class Mybot(commands.Cog):
"tu sera DSI chez jacky et Michel", "tu sera DSI chez jacky et Michel",
"tu seras arroseur de plante aquatique.") "tu seras arroseur de plante aquatique.")
choix = random.choice(list_mot) choix = random.choice(list_mot)
with ctx.channel.typing():
await asyncio.sleep(len(choix)/4)
await ctx.channel.send(choix) await ctx.channel.send(choix)