correction cmd say
This commit is contained in:
parent
ec84a18e76
commit
ef4ebf1c35
1 changed files with 7 additions and 0 deletions
|
@ -366,6 +366,13 @@ class Mybot(commands.Cog):
|
||||||
cmd = self.bot.get_command(command_name)
|
cmd = self.bot.get_command(command_name)
|
||||||
ctx.channel = channel
|
ctx.channel = channel
|
||||||
ctx.guild = guild
|
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)
|
await cmd.invoke(ctx)
|
||||||
else:
|
else:
|
||||||
for word in sentence.split():
|
for word in sentence.split():
|
||||||
|
|
Loading…
Reference in a new issue