From 08bfb3c744dd44a7b1e4bba18518db154f8705a2 Mon Sep 17 00:00:00 2001 From: BFlow Date: Sat, 25 Apr 2020 20:10:39 +0200 Subject: [PATCH] =?UTF-8?q?correction=20n=C2=B04=20command=20say?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kabot/kabot/kabot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index c4b37c1..87d9e50 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -292,6 +292,12 @@ class Mybot(commands.Cog): @commands.command(help="Faire dire des choses au bot") async def say(self, ctx, *message): sentence = ' '.join(message) + for word in sentence.split(): + if word.startswith('@'): + members = ctx.guild.members + for member in members: + if member.name == word: + sentence.replace(word, member) channel = [x for x in self.bot.get_all_channels() if x.name == "général"][0] await channel.send(sentence)