[commands] Fix when_mentioned when handling nicknames.
This commit is contained in:
parent
21c88cf727
commit
fdaa4299a3
@ -49,6 +49,9 @@ def _get_variable(name):
|
|||||||
def when_mentioned(bot, msg):
|
def when_mentioned(bot, msg):
|
||||||
"""A callable that implements a command prefix equivalent
|
"""A callable that implements a command prefix equivalent
|
||||||
to being mentioned, e.g. ``@bot ``."""
|
to being mentioned, e.g. ``@bot ``."""
|
||||||
|
server = msg.server
|
||||||
|
if server is not None:
|
||||||
|
return '{0.me.mention} '.format(server)
|
||||||
return '{0.user.mention} '.format(bot)
|
return '{0.user.mention} '.format(bot)
|
||||||
|
|
||||||
def when_mentioned_or(*prefixes):
|
def when_mentioned_or(*prefixes):
|
||||||
@ -67,7 +70,7 @@ def when_mentioned_or(*prefixes):
|
|||||||
"""
|
"""
|
||||||
def inner(bot, msg):
|
def inner(bot, msg):
|
||||||
r = list(prefixes)
|
r = list(prefixes)
|
||||||
r.append('{0.user.mention} '.format(bot))
|
r.append(when_mentioned(bot, msg))
|
||||||
return r
|
return r
|
||||||
|
|
||||||
return inner
|
return inner
|
||||||
|
Loading…
x
Reference in New Issue
Block a user