montur
montur
DIAdiscord.js - Imagine an app
Created by montur on 2/16/2024 in #djs-questions
how do i play audio with my discord bot?
i ran
npm install ffmpeg
npm install ffmpeg
and it still says it
9 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/16/2024 in #djs-questions
how do i play audio with my discord bot?
now it gives me this error
Error: FFmpeg/avconv not found!
at FFmpeg.getInfo (C:\Users\Alex\Desktop\discord bot\node_modules\prism-media\src\core\FFmpeg.js:143:11)
at FFmpeg.create (C:\Users\Alex\Desktop\discord bot\node_modules\prism-media\src\core\FFmpeg.js:156:38)
at new FFmpeg (C:\Users\Alex\Desktop\discord bot\node_modules\prism-media\src\core\FFmpeg.js:45:27)
at Object.transformer (C:\Users\Alex\Desktop\discord bot\node_modules\@discordjs\voice\dist\index.js:2248:29)
at C:\Users\Alex\Desktop\discord bot\node_modules\@discordjs\voice\dist\index.js:2457:58
at Array.map (<anonymous>)
at createAudioResource (C:\Users\Alex\Desktop\discord bot\node_modules\@discordjs\voice\dist\index.js:2457:39)
at Object.execute (C:\Users\Alex\Desktop\discord bot\commands\utility\play.js:24:30)
at Client.<anonymous> (C:\Users\Alex\Desktop\discord bot\main.js:50:17)
at Client.emit (node:events:514:28)
node:events:492
throw er; // Unhandled 'error' event
^


Node.js v18.17.1
Error: FFmpeg/avconv not found!
at FFmpeg.getInfo (C:\Users\Alex\Desktop\discord bot\node_modules\prism-media\src\core\FFmpeg.js:143:11)
at FFmpeg.create (C:\Users\Alex\Desktop\discord bot\node_modules\prism-media\src\core\FFmpeg.js:156:38)
at new FFmpeg (C:\Users\Alex\Desktop\discord bot\node_modules\prism-media\src\core\FFmpeg.js:45:27)
at Object.transformer (C:\Users\Alex\Desktop\discord bot\node_modules\@discordjs\voice\dist\index.js:2248:29)
at C:\Users\Alex\Desktop\discord bot\node_modules\@discordjs\voice\dist\index.js:2457:58
at Array.map (<anonymous>)
at createAudioResource (C:\Users\Alex\Desktop\discord bot\node_modules\@discordjs\voice\dist\index.js:2457:39)
at Object.execute (C:\Users\Alex\Desktop\discord bot\commands\utility\play.js:24:30)
at Client.<anonymous> (C:\Users\Alex\Desktop\discord bot\main.js:50:17)
at Client.emit (node:events:514:28)
node:events:492
throw er; // Unhandled 'error' event
^


Node.js v18.17.1
9 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/16/2024 in #djs-questions
how do i play audio with my discord bot?
so far i have this
const { SlashCommandBuilder } = require('discord.js');
const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice');
const player = createAudioPlayer();

module.exports = {
data: new SlashCommandBuilder()
.setName('play')
.setDescription('Plays music'),
async execute(interaction) {
const guild = interaction.guild;
const member = interaction.member;

// Check if the member is in a voice channel
if (member.voice.channel) {
interaction.reply('Joining: ' + member.voice.channel.name);
// The member is in a voice channel
const connection = joinVoiceChannel({
channelId: member.voice.channel.id,
guildId: guild.id,
adapterCreator: guild.voiceAdapterCreator,
});
const resource = createAudioResource('discord bot/sound/AAAAUUUGHHHH.mp3');

// Play "track.mp3" across two voice connections
connection.subscribe(player);
player.play(resource);


} else {
interaction.reply('You need to be in a voice channel to use this command!');
}
},
};
const { SlashCommandBuilder } = require('discord.js');
const { joinVoiceChannel, createAudioPlayer, createAudioResource } = require('@discordjs/voice');
const player = createAudioPlayer();

module.exports = {
data: new SlashCommandBuilder()
.setName('play')
.setDescription('Plays music'),
async execute(interaction) {
const guild = interaction.guild;
const member = interaction.member;

// Check if the member is in a voice channel
if (member.voice.channel) {
interaction.reply('Joining: ' + member.voice.channel.name);
// The member is in a voice channel
const connection = joinVoiceChannel({
channelId: member.voice.channel.id,
guildId: guild.id,
adapterCreator: guild.voiceAdapterCreator,
});
const resource = createAudioResource('discord bot/sound/AAAAUUUGHHHH.mp3');

// Play "track.mp3" across two voice connections
connection.subscribe(player);
player.play(resource);


} else {
interaction.reply('You need to be in a voice channel to use this command!');
}
},
};
it joins the vc but it still doesnt play
9 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/16/2024 in #djs-questions
how do i play audio with my discord bot?
i have it installed im just looking for some example code
9 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
thx!
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
that should fix it?
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates
] });
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates
] });
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
oh
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
but guilds is for everything right?
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
i only have 1 intent
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
const client = new Client({
intents: [
GatewayIntentBits.Guilds
] });
const client = new Client({
intents: [
GatewayIntentBits.Guilds
] });
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
or even when i left the vc
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
even when i changed vc
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
this command only works the first time i use it and when i run it a 2nd time it gives the same output
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
v18.17.1
21 replies
DIAdiscord.js - Imagine an app
Created by montur on 2/15/2024 in #djs-questions
no reliable output and i dont know why:
21 replies