correction cmd say

This commit is contained in:
BFlow 2020-09-04 22:57:25 +02:00
parent 6b3e0a0b4f
commit ec84a18e76

View file

@ -360,15 +360,16 @@ class Mybot(commands.Cog):
async def say(self, ctx, *message):
sentence = ' '.join(message)
channel = [x for x in self.bot.get_all_channels() if x.name == "général"][0]
guild = self.bot.guilds[0]
if sentence.startswith('!'):
command_name = sentence.split()[0].replace('!', '')
cmd = self.bot.get_command(command_name)
ctx.channel = channel
ctx.guild = guild
await cmd.invoke(ctx)
else:
for word in sentence.split():
if word.startswith('@'):
guild = self.bot.guilds[0]
members = guild.members
for member in members:
if member.name == word[1:]: