#no voice

20 messages · Page 1 of 1 (latest)

halcyon sedgeBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
lyric venture
#

We don’t support TOS violations.

pseudo rover
#

What are TOS Violations?

random larkBOT
lyric venture
#

In your case you violate them by proxy, because you violate YouTube‘s TOS

pseudo rover
#

YouTube bans bot playback of its videos?

#

But I tried to play a video that I downloaded on my computer, and there was no sound either

random larkBOT
#

To debug your voice connection and player:

  • Use debug: true when creating your VoiceConnection and AudioPlayer
  • Add an event listener to the <VoiceConnection> and the <AudioPlayer>:
// Add one for each class if applicable
<AudioPlayer | VoiceConnection>
    .on('debug', console.log)
    .on('error', console.error)
  • Add an error listener to the stream you are passing to the resource:
<Stream>.on('error', console.error)

Note: The <> represents classes that need to be adapted to their respective name in your code

#

guide Getting Started: Installation - Extra Dependencies
read more

lyric venture
#

Show your dependency report

pseudo rover
#
const fs = require('fs'); 



if (command === 'playlocal') {
    const voiceChannel = message.member.voice.channel;
    if (!voiceChannel) return message.channel.send('в канал зайди долбаеб.');

    const connection = joinVoiceChannel({
        channelId: voiceChannel.id,
        guildId: voiceChannel.guild.id,
        adapterCreator: voiceChannel.guild.voiceAdapterCreator,
    });

    const filePath = './test.mp3'; 
    const stream = fs.createReadStream(filePath);

    const resource = createAudioResource(stream);
    const player = createAudioPlayer();

    player.play(resource);
    connection.subscribe(player);

    player.on('error', error => {
        console.error(`ошибка долбаеб: ${error}`);
        connection.destroy();
    });

    return message.channel.send(`сейчас хуярит: ${filePath}`);
} ```
random larkBOT
#

guide Getting Started: Debugging Dependencies
read more

lyric venture
#

This one, run it and show the result

#

And show your intents of your client constructor

pseudo rover
#
Подключение к голосовому каналу...
Подключено. Получение потока...
Поток получен. Создание ресурса...
Ресурс создан. Воспроизведение...
Воспроизведение началось.
--------------------------------------------------
Core Dependencies
- @discordjs/voice: 0.16.0
- prism-media: 1.3.5

Opus Libraries
- @discordjs/opus: not found
- opusscript: not found

Encryption Libraries
- sodium-native: not found
- sodium: not found
- libsodium-wrappers: not found
- tweetnacl: not found

FFmpeg
- version: 5.0.1-essentials_build-www.gyan.dev
- libopus: yes
--------------------------------------------------```
lyric venture
#

There’s your issue. You need to have an opus and a sodium lib installed

pseudo rover
#

And what to install them for?

lyric venture
#

To… have sound?

#

Discord voice connections send encrypted opus packages. So unless your audio already is encoded as that /voice needs to transcode it before sending

pseudo rover
#

Ok, I installed opus, do I need to change anything in the code?