music.py 文件源码

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

项目:Bonfire 作者: Phxntxm 项目源码 文件源码
def join(self, *, channel: discord.Channel):
        """Joins a voice channel."""
        try:
            await self.create_voice_client(channel)
        # Check if the channel given was an actual voice channel
        except discord.InvalidArgument:
            await self.bot.say('This is not a voice channel...')
        except (asyncio.TimeoutError, discord.ConnectionClosed):
            await self.bot.say("I failed to connect! This usually happens if I don't have permission to join the"
                               " channel, but can sometimes be caused by your server region being far away."
                               " Otherwise this is an issue on Discord's end, causing the connect to timeout!")
            await self.remove_voice_client(channel.server)
        else:
            await self.bot.say('Ready to play audio in ' + channel.name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号