def game(self, ctx, *, game=None):
"""Sets the bot's playing status
Leaving this empty will clear it."""
# [p]set game <game>
server = ctx.message.server
current_status = server.me.status if server is not None else None
if game:
game = game.strip()
await self.bot.change_presence(game=discord.Game(name=game),
status=current_status)
await self.bot.say('Game set to "{}".'.format(game))
else:
await self.bot.change_presence(game=None, status=current_status)
await self.bot.say('Not playing a game now.')
评论列表
文章目录