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