correction n°4 command say

This commit is contained in:
BFlow 2020-04-25 20:10:39 +02:00
parent 09fe02357b
commit 08bfb3c744

View file

@ -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)