Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discord.js Opus #89

Closed
Radjejszyn opened this issue Sep 14, 2021 · 10 comments
Closed

discord.js Opus #89

Radjejszyn opened this issue Sep 14, 2021 · 10 comments

Comments

@Radjejszyn
Copy link

Describe the bug
cant play song

To Reproduce
Steps to reproduce the behavior:

  1. install the bot
  2. launch the bot

Expected behavior
to play song

Desktop (please complete the following information):

  • OS: [debian-10-buster-v20210817]
  • CPU architecture: [e.g. x64]

Dependency versions:

  • Nodejs version: [e.g. 10]
  • YTDL-core version: [e.g. 4.4.5]

Additional context (optional)

  • /home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/Player.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/index.js
  • /home/g1kacper_wysocki/discord-bot/index.js
    Error: Cannot find module 'node-opus'
    Require stack:
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/util/loader.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/opus/Opus.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/opus/index.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/index.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/TransformerGraph.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/AudioResource.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/index.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/index.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/Structures/Queue.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/Player.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/index.js
  • /home/g1kacper_wysocki/discord-bot/index.js
    Error: Cannot find module 'opusscript'
    Require stack:
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/util/loader.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/opus/Opus.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/opus/index.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/index.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/TransformerGraph.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/AudioResource.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/index.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/index.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/Structures/Queue.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/Player.js
  • /home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/index.js
  • /home/g1kacper_wysocki/discord-bot/index.js
    at Object.loader [as require] (/home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/util/loader.js:12:9)
    at loadOpus (/home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/opus/Opus.js:17:17)
    at new OpusStream (/home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/opus/Opus.js:46:10)
    at new Encoder (/home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/node_modules/prism-media/src/opus/Opus.js:149:5)
    at Object.transformer (/home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/TransformerGraph.js:120:24)
    at /home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/AudioResource.js:158:60
    at Array.map ()
    at Object.createAudioResource (/home/g1kacper_wysocki/discord-bot/node_modules/@discordjs/voice/dist/audio/AudioResource.js:158:41)
    at StreamDispatcher.createStream (/home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/VoiceInterface/StreamDispatcher.js:108:38)
    at Queue. (/home/g1kacper_wysocki/discord-bot/node_modules/discord-player/dist/Structures/Queue.js:663:46)
    /home/g1kacper_wysocki/discord-bot/node_modules/discord.js/src/rest/RequestHandler.js:298
    throw new DiscordAPIError(data, res.status, request);

Checklist:

  • [] I included all information required in the sections above
  • [] I made sure there are no duplicates of this report (Use Search)
@TannerGabriel
Copy link
Owner

Are you running the application without Docker? If so, could you make sure that you have Opus and FFMPEG installed on your machine?

@Radjejszyn
Copy link
Author

Are you running the application without Docker? If so, could you make sure that you have Opus and FFMPEG installed on your machine?

I'm running it on Google cloud machine on Debian. I have ffmpeg installed and opus.
I would like to use docker but I don't have any clue how it works and I can't find any good online tutorial how to install it on docker

@TannerGabriel
Copy link
Owner

@Radjejszyn I can recommend this DigitalOcean tutorial for installing Docker on Ubuntu (Debian).

@Radjejszyn
Copy link
Author

@Radjejszyn I can recommend this DigitalOcean tutorial for installing Docker on Ubuntu (Debian).

Oh okay, thanks I will look into in when I come home, should I close the issue?

@TannerGabriel
Copy link
Owner

You can close it if you like, but you could also leave it open until we find the cause of the problem.

@Radjejszyn
Copy link
Author

Okay sure

@Radjejszyn
Copy link
Author

Radjejszyn commented Sep 15, 2021

DiscordAPIError: Missing Access
at RequestHandler.execute (/home/g1kacper_wysocki/discord-bot/node_modules/discord.js/src/rest/RequestHandler.js:298:13)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (/home/g1kacper_wysocki/discord-bot/node_modules/discord.js/src/rest/RequestHandler.js:50:14)
at async GuildApplicationCommandManager.set (/home/g1kacper_wysocki/discord-bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:146:18)
at async module.exports. (/home/g1kacper_wysocki/discord-bot/index.js:66:7) {
method: 'put',
path: '/applications/887002766462058536/guilds/752142704066035733/commands',
code: 50001,
httpStatus: 403,
requestData: {
json: [
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object],
[Object], [Object]
],
files: []
}

this is error which i got now

@Radjejszyn
Copy link
Author

okay i got it working, but i have a question. why do i cant use my commands with prefix for example ?skip (i have changed it to ?)

@Asemco
Copy link

Asemco commented Sep 16, 2021

Hey @Radjejszyn, check out Issue #88 for the answer.

Long story short: It's coming (back) soon™ :)

@Ao1Pointblank
Copy link

I think you need to install node-opus and opusscript manually (i had to, to get mine working)

try:
npm install node-opus opusscript

otherwise the bot can't play audio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants