_Main.py 文件源码

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

项目:Sparcli 作者: 4Kaylum 项目源码 文件源码
def on_ready():
    print('-----')
    print('User :: {}'.format(sparcli.user))
    print('ID :: {}'.format(sparcli.user.id))
    print('-----')

    # Load the extentions
    for extension in initialExtentions:
        # This is necessary because I'm bad at code lol
        try:
            sparcli.load_extension(extension)

        # Print out any errors
        except Exception as e:
            exc = '{}: {}'.format(type(e).__name__, e)
            print('Failed to load extension {}\n{}'.format(extension, exc))

    # Load up any changes that would have been made to the configs
    for server in sparcli.servers:
        z = getServerJson(server.id)
        z = fixJson(z)
        saveServerJson(server.id, z)

    # Reccursively fix any globals too
    z = getServerJson('Globals')
    z = fixJson(z)
    saveServerJson('Globals', z)

    # Changed the bot's game
    game = '@Spar.cli help'
    await sparcli.change_presence(game=discord.Game(name=game))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号