def status(self, ctx, color, *words):
if any(color == a for a in green):
color = Status.online
elif any(color == a for a in yellow):
color = Status.idle
elif any(color == a for a in red):
color = Status.dnd
elif any(color == a for a in gray):
color = Status.offline
else:
color = None
if len(words) > 0:
mention = ctx.bot.user.mention
if ctx.guild is not None:
mention = ctx.guild.get_member(ctx.bot.user.id).mention
words = " ".join(words).replace(mention, "@" + ctx.bot.user.name)
activity = Game(name=words)
words = '"{}"'.format(words)
else:
activity = None
words = "nothing"
await self.nyx.change_presence(game=activity, status=color)
await respond(ctx, 'I changed my status to {}...'.format(words))
评论列表
文章目录