@commands.command()
async def play(self, ctx, *, arg):
vc = await ctx.message.author.voice.channel.connect()
await ctx.send(f'Бот подключился к каналу: {channel}')
with YoutubeDL(YDL_OPTIONS) as ydl:
if 'https://' in arg:
info = ydl.extract_info(arg, download=False)
else:
info = ydl.extract_info(f"ytsearch:{arg}", download=False)['entries'][0]
url = info['formats'][0]['url']
vc.play(discord.FFmpegPCMAudio(executable="ffmpeg", source=url, **FFMPEG_OPTIONS))
while a < n
(пока а меньше n, мы исполняем код ниже) и повторяется.def function(argument):
print(argument)
function(argument="test")
Traceback (most recent call last):
File "/Users/antongorestov/Desktop/PrimetimeBot/bot.py", line 48, in <module>
bot.polling(none_stop=True)
File "/Users/antongorestov/PycharmProjects/PRIMETIME_BOT/venv/lib/python3.9/site-packages/telebot/__init__.py", line 196, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "/Users/antongorestov/PycharmProjects/PRIMETIME_BOT/venv/lib/python3.9/site-packages/telebot/__init__.py", line 220, in __threaded_polling
self.worker_pool.raise_exceptions()
File "/Users/antongorestov/PycharmProjects/PRIMETIME_BOT/venv/lib/python3.9/site-packages/telebot/util.py", line 103, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "/Users/antongorestov/PycharmProjects/PRIMETIME_BOT/venv/lib/python3.9/site-packages/six.py", line 719, in reraise
raise value
File "/Users/antongorestov/PycharmProjects/PRIMETIME_BOT/venv/lib/python3.9/site-packages/telebot/util.py", line 54, in run
task(*args, **kwargs)
File "/Users/antongorestov/Desktop/PrimetimeBot/bot.py", line 20, in handle_text
a = types.ReplyKeyboardRemove(selective=None)
AttributeError: module 'telebot.types' has no attribute 'ReplyKeyboardRemove'
intents=discord.Intents().all()