Aiwoz[old]
Aiwoz[old]
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 5/2/2024 in #djs-questions
Difference between canvas and @napi-rs/canvas
Okay, thank you. ^^
9 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 5/2/2024 in #djs-questions
Difference between canvas and @napi-rs/canvas
Okay and @napi is faster than canva ?
9 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 5/2/2024 in #djs-questions
Difference between canvas and @napi-rs/canvas
And sorry for unrelated. 😭
9 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 5/2/2024 in #djs-questions
Difference between canvas and @napi-rs/canvas
Why do you seggest this ?
9 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 5/2/2024 in #djs-questions
Difference between canvas and @napi-rs/canvas
9 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 5/2/2024 in #djs-questions
Difference between canvas and @napi-rs/canvas
9 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/27/2024 in #djs-questions
crash even if I have a trycatch
Thank you. ^^
7 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/27/2024 in #djs-questions
crash even if I have a trycatch
No description
7 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/27/2024 in #djs-questions
crash even if I have a trycatch
Command handler :
try {
member.setNickname(newNickname);
} catch (error) {
console.error( error);
}
try {
member.setNickname(newNickname);
} catch (error) {
console.error( error);
}
Error :
C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:722
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50013]: Missing Permissions
at handleErrors (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:1120:23)
at async SequentialHandler.queueRequest (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:953:14)
at async _REST.request (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async GuildMemberManager.edit (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\discord.js\src\managers\GuildMemberManager.js:381:15) {
requestBody: { files: undefined, json: { nick: 'Test' } },
rawError: { message: 'Missing Permissions', code: 50013 },
code: 50013,
status: 403,
method: 'PATCH',
url: 'https://discord.com/api/v10/guilds/1187082722401861765/members/693160609398653010'
}

Node.js v20.11.1
C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:722
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50013]: Missing Permissions
at handleErrors (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:1120:23)
at async SequentialHandler.queueRequest (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:953:14)
at async _REST.request (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\@discordjs\rest\dist\index.js:1266:22)
at async GuildMemberManager.edit (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\discord.js\src\managers\GuildMemberManager.js:381:15) {
requestBody: { files: undefined, json: { nick: 'Test' } },
rawError: { message: 'Missing Permissions', code: 50013 },
code: 50013,
status: 403,
method: 'PATCH',
url: 'https://discord.com/api/v10/guilds/1187082722401861765/members/693160609398653010'
}

Node.js v20.11.1
7 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/24/2024 in #djs-questions
Partials with GuildMember
Thank you. ^^
8 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/24/2024 in #djs-questions
Partials with GuildMember
It has already happened to me that when a member leaves the server, the bot does not react.
8 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/24/2024 in #djs-questions
Partials with GuildMember
Why use partials with GuildMember?
8 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/20/2024 in #djs-questions
messageDelete does not work with old messages.
Thank you. ^^
17 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/20/2024 in #djs-questions
messageDelete does not work with old messages.
?
17 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/20/2024 in #djs-questions
messageDelete does not work with old messages.
Okay, but it is not possible to retrieve one of the following elements: Author of the message, content, reaction.
17 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/20/2024 in #djs-questions
messageDelete does not work with old messages.
Yes but what is the utility of partials ?
17 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/20/2024 in #djs-questions
messageDelete does not work with old messages.
Something went wrong when fetching the message: DiscordAPIError[10008]: Unknown Message at handleErrors (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules@discordjs\rest\dist\index.js:722:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SequentialHandler.runRequest (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules@discordjs\rest\dist\index.js:1120:23) at async SequentialHandler.queueRequest (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules@discordjs\rest\dist\index.js:953:14) at async _REST.request (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules@discordjs\rest\dist\index.js:1266:22) at async GuildMessageManager._fetchSingle (C:\Users\Aiwoz\Desktop\Bot Discord\Bot-Aiwoz\node_modules\discord.js\src\managers\MessageManager.js:107:18) { requestBody: { files: undefined, json: undefined }, rawError: { message: 'Unknown Message', code: 10008 }, code: 10008, status: 404, method: 'GET', url: 'https://discord.com/api/v10/channels/1190031214942376067/messages/1209197420735496253' }
17 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/20/2024 in #djs-questions
messageDelete does not work with old messages.
const { EmbedBuilder } = require(`discord.js`);

module.exports = {
name: `messageDelete`,
description: `Événement lorsqu'un message est supprimé du serveur.`,
async execute(message) {

if (message.partial) {
message.fetch()
.then(fullMessage => {
console.log(fullMessage.content);
})
.catch(error => {
console.log('Something went wrong when fetching the message: ', error);
});
} else {
const messageLog = new EmbedBuilder()
.setColor(`#4CE1FE`)
.setTitle(`__Un Message a été supprimé :__`)
.setDescription(`**Message :** \n ${message.content} \n **ID du message :** ${message.id} \n **Salon :** <#${message.channel.id}> \n **Par :** ${message.author.displayName} \n **ID :** ${message.author.id}`)
.setTimestamp();
if (message.attachments.size > 0) {
const mediaUrls = message.attachments.map(attachment => attachment.url);
messageLog.setDescription(`**Message :** \n ${message.content} \n **ID du message :** ${message.id} \n **Salon :** <#${message.channel.id}> \n **Par :** ${message.author.displayName} \n **ID :** ${message.author.id} \n **Médias :** \n` + mediaUrls.join('\n'));
}
message.guild.channels.cache.get("1190563847224954980").send({embeds: [messageLog]});
}
}
}
const { EmbedBuilder } = require(`discord.js`);

module.exports = {
name: `messageDelete`,
description: `Événement lorsqu'un message est supprimé du serveur.`,
async execute(message) {

if (message.partial) {
message.fetch()
.then(fullMessage => {
console.log(fullMessage.content);
})
.catch(error => {
console.log('Something went wrong when fetching the message: ', error);
});
} else {
const messageLog = new EmbedBuilder()
.setColor(`#4CE1FE`)
.setTitle(`__Un Message a été supprimé :__`)
.setDescription(`**Message :** \n ${message.content} \n **ID du message :** ${message.id} \n **Salon :** <#${message.channel.id}> \n **Par :** ${message.author.displayName} \n **ID :** ${message.author.id}`)
.setTimestamp();
if (message.attachments.size > 0) {
const mediaUrls = message.attachments.map(attachment => attachment.url);
messageLog.setDescription(`**Message :** \n ${message.content} \n **ID du message :** ${message.id} \n **Salon :** <#${message.channel.id}> \n **Par :** ${message.author.displayName} \n **ID :** ${message.author.id} \n **Médias :** \n` + mediaUrls.join('\n'));
}
message.guild.channels.cache.get("1190563847224954980").send({embeds: [messageLog]});
}
}
}
17 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/20/2024 in #djs-questions
messageDelete does not work with old messages.
Thank you but i have an error too.
17 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz[old] on 4/20/2024 in #djs-questions
messageDelete does not work with old messages.
How to make this ?
17 replies