theelitemaster
DIAdiscord.js - Imagine an app
•Created by theelitemaster on 7/3/2023 in #djs-voice
Issue with ffmpeg/avconv
Now, Im getting an error where it says the const resource variable because it says ffmpeg/avconv not found! I want to play audio from a url (or file, I am just trying to see how to play any audio)
module.exports = {
name: "play",
description: "play",
async execute (client, message, args, Discord)
{
const {createAudioPlayer, joinVoiceChannel, createAudioResource} = require("@discordjs/voice");
const player = createAudioPlayer();
const generalvc = "1062726237589602355";
const altvc = "1117625842403659858";
const altaltvc = "1092193592010887259";
const guild = client.guilds.cache.get("1062726236767535185");
const channel = guild.channels.cache.get(altvc);
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator
});
const resource = createAudioResource("https://open.spotify.com/track/3ZCLZ1tQf9Pcl2UO8s6JnN?si=9671529709624c21");
player.play(resource);
connection.subscribe(player);
}
}
module.exports = {
name: "play",
description: "play",
async execute (client, message, args, Discord)
{
const {createAudioPlayer, joinVoiceChannel, createAudioResource} = require("@discordjs/voice");
const player = createAudioPlayer();
const generalvc = "1062726237589602355";
const altvc = "1117625842403659858";
const altaltvc = "1092193592010887259";
const guild = client.guilds.cache.get("1062726236767535185");
const channel = guild.channels.cache.get(altvc);
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator
});
const resource = createAudioResource("https://open.spotify.com/track/3ZCLZ1tQf9Pcl2UO8s6JnN?si=9671529709624c21");
player.play(resource);
connection.subscribe(player);
}
}
6 replies
DIAdiscord.js - Imagine an app
•Created by theelitemaster on 7/3/2023 in #djs-voice
Issue with ffmpeg/avconv
ok ty
6 replies
DIAdiscord.js - Imagine an app
•Created by theelitemaster on 7/3/2023 in #djs-voice
Issue with ffmpeg/avconv
Error:
node:internal/modules/cjs/loader:995
const err = new Error(message);
^
Error: Cannot find module '@discord.js/voice'
Require stack:
- /home/runner/a-ndy/commands/play.js
- /home/runner/a-ndy/handlers/command_handler.js
- /home/runner/a-ndy/main.js
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.execute (/home/runner/a-ndy/commands/play.js:6:53)
at module.exports (/home/runner/a-ndy/events/guild/messageCreate.js:15:26)
at Client.emit (node:events:513:28)
at Client.emit (node:domain:489:12)
at MessageCreateAction.handle (/home/runner/a-ndy/node_modules/discord.js/src/client/actions/MessageCreate.js:28:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/runner/a-ndy/commands/play.js',
'/home/runner/a-ndy/handlers/command_handler.js',
'/home/runner/a-ndy/main.js'
]
}
Node.js v18.12.1
repl process died unexpectedly: exit status 1
node:internal/modules/cjs/loader:995
const err = new Error(message);
^
Error: Cannot find module '@discord.js/voice'
Require stack:
- /home/runner/a-ndy/commands/play.js
- /home/runner/a-ndy/handlers/command_handler.js
- /home/runner/a-ndy/main.js
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Module.require (node:internal/modules/cjs/loader:1061:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.execute (/home/runner/a-ndy/commands/play.js:6:53)
at module.exports (/home/runner/a-ndy/events/guild/messageCreate.js:15:26)
at Client.emit (node:events:513:28)
at Client.emit (node:domain:489:12)
at MessageCreateAction.handle (/home/runner/a-ndy/node_modules/discord.js/src/client/actions/MessageCreate.js:28:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/runner/a-ndy/commands/play.js',
'/home/runner/a-ndy/handlers/command_handler.js',
'/home/runner/a-ndy/main.js'
]
}
Node.js v18.12.1
repl process died unexpectedly: exit status 1
6 replies