Hugo4774
Hugo4774
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 8/12/2023 in #djs-voice
musique in loop
let stream = ytdl(args[0], {
filter: "audioonly",
quality: 'highestaudio',
seek: 0
});
const player = createAudioPlayer();
const resource = createAudioResource(stream);

const connection = joinVoiceChannel({
channelId: vc.id,
guildId: vc.guild.id,
adapterCreator: vc.guild.voiceAdapterCreator,
})
player.play(resource);
connection.subscribe(player);
let stream = ytdl(args[0], {
filter: "audioonly",
quality: 'highestaudio',
seek: 0
});
const player = createAudioPlayer();
const resource = createAudioResource(stream);

const connection = joinVoiceChannel({
channelId: vc.id,
guildId: vc.guild.id,
adapterCreator: vc.guild.voiceAdapterCreator,
})
player.play(resource);
connection.subscribe(player);
is there a param that can play the music in loop ?
2 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 3/12/2023 in #djs-questions
AudioPlayerError: aborted
Hello, after one minute (exactly) of playing a music in a vocal, i got the following error :
node:events:491
throw er; // Unhandled 'error' event
^

AudioPlayerError: aborted
at connResetException (node:internal/errors:704:14)
at TLSSocket.socketCloseListener (node:_http_client:441:19)
at TLSSocket.emit (node:events:525:35)
at node:net:757:14
at TCP.done (node:_tls_wrap:584:7)
Emitted 'error' event on AudioPlayer instance at:
at OggDemuxer.onStreamError
node:events:491
throw er; // Unhandled 'error' event
^

AudioPlayerError: aborted
at connResetException (node:internal/errors:704:14)
at TLSSocket.socketCloseListener (node:_http_client:441:19)
at TLSSocket.emit (node:events:525:35)
at node:net:757:14
at TCP.done (node:_tls_wrap:584:7)
Emitted 'error' event on AudioPlayer instance at:
at OggDemuxer.onStreamError
my code to launch music :
let stream = ytdl(maZic, {
filter: "audioonly",
quality: 'highestaudio',
seek: 0
});
const player = createAudioPlayer();
const resource = createAudioResource(stream);

const connection = joinVoiceChannel({
channelId: vc.id,
guildId: vc.guild.id,
adapterCreator: vc.guild.voiceAdapterCreator,
})
player.play(resource);
connection.subscribe(player);
let stream = ytdl(maZic, {
filter: "audioonly",
quality: 'highestaudio',
seek: 0
});
const player = createAudioPlayer();
const resource = createAudioResource(stream);

const connection = joinVoiceChannel({
channelId: vc.id,
guildId: vc.guild.id,
adapterCreator: vc.guild.voiceAdapterCreator,
})
player.play(resource);
connection.subscribe(player);
8 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 3/12/2023 in #djs-voice
Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running
Error [ERR_SOCKET_DGRAM_NOT_RUNNING]: Not running after a certain time, the sound in the vocal cut and i catch this error, idk where did this come from
3 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 1/29/2023 in #djs-voice
after some times, the bot retrieve an error
AudioPlayerError: aborted
at connResetException (node:internal/errors:704:14)
at TLSSocket.socketCloseListener (node:_http_client:441:19)
at TLSSocket.emit (node:events:525:35)
at node:net:757:14
at TCP.done (node:_tls_wrap:584:7)
Emitted 'error' event on AudioPlayer instance at:
at OggDemuxer.onStreamError
AudioPlayerError: aborted
at connResetException (node:internal/errors:704:14)
at TLSSocket.socketCloseListener (node:_http_client:441:19)
at TLSSocket.emit (node:events:525:35)
at node:net:757:14
at TCP.done (node:_tls_wrap:584:7)
Emitted 'error' event on AudioPlayer instance at:
at OggDemuxer.onStreamError
I don't know what does this 🤔
12 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 1/27/2023 in #djs-questions
check if author of message has roleId
if (message.guild.members.cache.get(message.author).roles.cache.has(roleID)) { TypeError: Cannot read properties of undefined (reading 'roles') How can i have a member object with my author and then check if he has a role ?
7 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 1/27/2023 in #djs-questions
Await reactions stop at 4 reactions of 4 different user
theMessage.awaitReactions({ filter, maxEmojis: 4, maxUsers: 4, time: time1 * 1000 }) theMessage.awaitReactions({ filter, max: 4, time: time1 * 1000 }) I tried both of this options, however, both of them stopped when i react four time with one user. Is anybody knows how can i have this ? Should i do it in the filter ?
8 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 1/19/2023 in #djs-questions
awaitreactions on message 14.3.0
message.awaitReactions({ filter, maxEmojis: 4, maxUsers: 4, time: time1 * 1000 })
message.awaitReactions({ filter, maxEmojis: 4, maxUsers: 4, time: time1 * 1000 })
why can i react 4 time with the same account ? I want to await until i have 4 users who react in my message of 4 reactions
6 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 1/19/2023 in #djs-questions
get emoji with his id in 14.3.0
message.guild.emojis.cache.get(emojiA) Can i do more easily than that ? I tried client.emojis.resolve(emojiA) and client.emojis.cache.resolve(emojiA) but it doesn't work
18 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 1/17/2023 in #djs-questions
message on reaction add event v14.3.0
client.rest.on(Events.MessageReactionAdd, async (reaction, user) => { Hello, is anyone knows how i can get the reaction that are added from a specific message in 14.3.0 ?
39 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 1/15/2023 in #djs-questions
manage slash commands and originals commands in the same time
Hello, i have multiple commands which works fine with normal ?command. I have now slash commands and my execute function nows only have an interaction Object and not a message, args, Discord, Client... what is the best way to combine these two ?
9 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 9/11/2022 in #djs-questions
on slash commands, execute command
on client.on('interactionCreate', async interaction => how can i execute the command ?
35 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 9/11/2022 in #djs-questions
how to play youtube audio on a voice channel ?
i recently updated my project to the last version and now ytdl doesn't works. I made some research on google about it, but everything i test doesn't works. Is it still possible or we can't do that anymore ? Thinks for help
15 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 9/10/2022 in #djs-questions
avatar.js Cannot send an empty message
i recently update my node version, my discord.js version and my npm version. While doing ?avatar @pingOne @pingTwo, i get the error :
throw new DiscordAPIError.DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50006]: Cannot send an empty message
throw new DiscordAPIError.DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50006]: Cannot send an empty message
My code is :
const avatarList = message.mentions.users.map(user => {
return `L'avatar de ${user.username} est : ${user.displayAvatarURL({ format: 'png' })}`;
});
message.channel.send(avatarList);
const avatarList = message.mentions.users.map(user => {
return `L'avatar de ${user.username} est : ${user.displayAvatarURL({ format: 'png' })}`;
});
message.channel.send(avatarList);
8 replies
DIAdiscord.js - Imagine an app
Created by Hugo4774 on 8/28/2022 in #djs-questions
can i do otherwise than `node index.js` to relaunch my bot ?
i would like to stop stop and restart my bot by doing node index.js, do you know if there is a something that i can do ? Thinks.
14 replies