correction n°4 command say
This commit is contained in:
parent
09fe02357b
commit
08bfb3c744
1 changed files with 6 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue