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
评论列表
文章目录