mangobyte.py 文件源码

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

项目:MangoByte 作者: mdiller 项目源码 文件源码
def on_ready():
    print('Logged in as:\n{0} (ID: {0.id})'.format(bot.user))
    print('Connecting to voice channels if specified in botdata.json ...')

    await bot.change_presence(game=discord.Game(name="DOTA 3 [?help]", url="http://github.com/mdiller/MangoByte"))
    cog = bot.get_cog("Audio")

    for guildinfo in botdata.guildinfo_list():
        if guildinfo.voicechannel is not None:
            try:
                print(f"connecting voice to: {guildinfo.voicechannel}")
                await cog.connect_voice(guildinfo.voicechannel)
            except UserError as e:
                if e.message == "channel not found":
                    guildinfo.voicechannel = None
                else:
                    raise
            except asyncio.TimeoutError:
                guildinfo.voicechannel = None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号