__main__.py 文件源码

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

项目:AutomaBot 作者: 73VW 项目源码 文件源码
def bot_main(token, queue, channel, prefix, desc):
    """Run bot."""
    bot = AutomaBot(get=queue, update_channel=channel,
                    command_prefix=prefix,
                    description=desc, self_bot=False)

    @bot.command(pass_context=True)
    @commands.check(is_owner)
    async def sleep(ctx):
        await bot.change_presence(status=discord.Status.dnd, afk=True)
        msg = 'Going to sleep. See you :wave:'
        for comm in bot.commands:
            if comm is not "wakeup":
                bot.commands[comm].enabled = False
        await bot.say(msg)

    @bot.command(pass_context=True, hidden=True)
    @commands.check(is_owner)
    async def wakeup(ctx):
        for comm in bot.commands:
            if comm is not "wakeup":
                bot.commands[comm].enabled = True
        await bot.change_presence(status=discord.Status.online, afk=False)
        msg = 'Goooooooooood morniiing vietnammmmmm :bomb:'
        await bot.say(msg)

    await bot.start(token)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号