Делал бота 24\7 бота по гайду. Выскакивает ошибка ниже.
Ignoring exception in on_ready
Traceback (most recent call last):
File "C:\Users\Влад\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\client.py", line 703, in _run_event
await coro(*args, **kwargs)
File "D:\Файлы\Бот_дискорд\Рокер\main.py", line 20, in on_ready
audio_source = disnake.FFmpegOpusAudio(source="http://193.108.118.145:8004/stream")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Влад\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\player.py", line 412, in __init__
super().__init__(source, executable=executable, args=args, **subprocess_kwargs)
File "C:\Users\Влад\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\player.py", line 149, in __init__
self._process: subprocess.Popen[bytes] = self._spawn_process(args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Влад\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\player.py", line 167, in _spawn_process
raise ClientException(f"{executable} was not found.") from None
disnake.errors.ClientException: ffmpeg was not found.
Exception ignored in: <function AudioSource.__del__ at 0x0000025968A56DE0>
Traceback (most recent call last):
File "C:\Users\Влад\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\player.py", line 100, in __del__
self.cleanup()
File "C:\Users\Влад\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\player.py", line 221, in cleanup
self._kill_process()
File "C:\Users\Влад\AppData\Local\Programs\Python\Python311\Lib\site-packages\disnake\player.py", line 172, in _kill_process
proc = self._process
^^^^^^^^^^^^^
AttributeError: 'FFmpegOpusAudio' object has no attribute '_process'
Код бота:
import disnake
from disnake import FFmpegPCMAudio, Activity, ActivityType
from disnake.ext import commands
import os
import keep_alive
intents = disnake.Intents.default()
intents.members = True
intents.message_content = True
bot = commands.Bot(command_prefix=commands.when_mentioned_or("+"), intents=intents)
@bot.event
async def on_ready() -> None:
print(f"Бот {bot.user} успешно запущен.")
await bot.change_presence(activity=Activity(name="музыку", type=ActivityType.listening)) # статус бота (Слушает ... (действие в кавычках))
voice_channel = bot.get_channel(1131889109120581694) # айди голосового канала
player = await voice_channel.connect()
audio_source = await disnake.FFmpegOpusAudio.from_probe("http://192.95.18.39:5508/stream")
player.play(audio_source, after=None)
keep_alive.keep_alive()
bot.run("токен")