music.py 文件源码

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

项目:vlt-Music 作者: Mondanzo 项目源码 文件源码
def add(self, song_url: str, voice_client: discord.VoiceClient, user=None):
        try:
            song_player = await voice_client.create_ytdl_player(song_url, ytdl_options=ytdl_format_options)
        except youtube_dl.DownloadError:
            return youtube_dl.DownloadError
        except youtube_dl.SameFileError:
            return youtube_dl.SameFileError
        except youtube_dl.utils.ExtractorError:
            return youtube_dl.utils.ExtractorError
        except youtube_dl.utils.UnavailableVideoError:
            return youtube_dl.utils.UnavailableVideoError
        user_name = "********"
        if user is not None:
            user_name = user.display_name
        song = {"player": None, "url": song_player.url, "title": song_player.title,
                "uploader": song_player.uploader, "user": user_name}
        await self.__queue.put(song)
        return song

    # Get next song and delete it
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号