From ef4ebf1c354cf287af526db7024825ca0f32aa30 Mon Sep 17 00:00:00 2001 From: BFlow Date: Fri, 4 Sep 2020 23:01:24 +0200 Subject: [PATCH] correction cmd say --- kabot/kabot/kabot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index f1e162c..0e28ef0 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -366,6 +366,13 @@ class Mybot(commands.Cog): cmd = self.bot.get_command(command_name) ctx.channel = channel ctx.guild = guild + for word in sentence.split(): + if word.startswith('@'): + members = guild.members + for member in members: + if member.name == word[1:]: + sentence = sentence.replace(word, member.mention) + ctx.message = sentence await cmd.invoke(ctx) else: for word in sentence.split():