commands.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Dwarf 作者: Dwarf-Community 项目源码 文件源码
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.')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号