@NOOns

Выдает ошибку 'ydl_opts' is not defined?

@Bot.command(brief="Plays a single video, from a youtube URL")
async def play(ctx, url):
	YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist':'True'}
	FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
	voice = ctx.message.guild.voice_client
	print(voice)

	if not voice.is_playing():
		with youtube_dl(ydl_opts) as ydl:
			info = ydl.extract_info(video_link, download=False)
		URL = info['formats'][0]['url']
		voice.play(FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
		voice.is_playing()
	else:
		await ctx.send("Already playing song")
		return

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'ydl_opts' is not defined
  • Вопрос задан
  • 214 просмотров
Пригласить эксперта
Ответы на вопрос 1
alternativshik
@alternativshik
все правильно пишет
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы