- The cmd $issou now accept a user in parameter to send the bot shout 'Issou' at someone connected in a vocal channel.

This commit is contained in:
Florian SYLVAIN
2021-02-04 17:34:09 +01:00
parent 94ada7b487
commit 430b9b31f2
+11 -4
View File
@@ -81,10 +81,17 @@ async def rank(ctx, arg, argF=None):
await ctx.send("Si vous essayez d'entrer un pseudo aved des espaces, veillez à l'entourer avec des guillemets.") await ctx.send("Si vous essayez d'entrer un pseudo aved des espaces, veillez à l'entourer avec des guillemets.")
@bot.command() @bot.command()
async def issou(ctx): async def issou(ctx, arg1:discord.User=None):
user = ctx.message.author if arg1 is not None:
user = arg1
else:
user = ctx.message.author
await ctx.message.delete() await ctx.message.delete()
voice_channel = ctx.message.author.voice.channel try:
voice_channel = user.voice.channel
except AttributeError:
voice_channel = None
channel = None channel = None
if voice_channel != None: if voice_channel != None:
channel = voice_channel.name channel = voice_channel.name
@@ -94,7 +101,7 @@ async def issou(ctx):
await asyncio.sleep(1) await asyncio.sleep(1)
await vc.disconnect() await vc.disconnect()
else: else:
await ctx.send('Vous n\'êtes connecté à aucun salon.') await ctx.send('Vous ou la personne ciblée n\'êtes connecté à aucun salon.')
@bot.command() @bot.command()
async def chat_set(ctx, arg1, argF=None): async def chat_set(ctx, arg1, argF=None):