Gabizoc
Gabizoc
DIAdiscord.js - Imagine an app
Created by Gabizoc on 8/30/2024 in #djs-questions
BitFieldInvalid djs 14.15.3
sorry and thank's
12 replies
DIAdiscord.js - Imagine an app
Created by Gabizoc on 8/30/2024 in #djs-questions
BitFieldInvalid djs 14.15.3
😅
12 replies
DIAdiscord.js - Imagine an app
Created by Gabizoc on 8/30/2024 in #djs-questions
BitFieldInvalid djs 14.15.3
ha hum very sorry
12 replies
DIAdiscord.js - Imagine an app
Created by Gabizoc on 8/30/2024 in #djs-questions
BitFieldInvalid djs 14.15.3
if (!interaction.guild.members.me.permissions.has(cmd.botPermissions || [])) { return interaction.followUp({ content: I need the following permissions to run this command: [${cmd.botPermissions}] }); }
12 replies
DIAdiscord.js - Imagine an app
Created by Gabizoc on 8/30/2024 in #djs-questions
BitFieldInvalid djs 14.15.3
// Vérification des permissions
if (!interaction.guild || !interaction.member) {
return interaction.followUp({ content: 'This command can only be used in a server.' });
}

if (!interaction.member.permissions.has(PermissionsBitField.Flags.SendMessages, true)) {
return interaction.followUp({ content: 'You do not have permission to send messages.' });
}

if (!interaction.guild.members.me.permissions.has(PermissionsBitField.Flags.SendMessages, true)) {
return interaction.followUp({ content: 'I do not have permission to send messages.' });
}

if (!interaction.member.permissions.has(cmd.userPermissions || [])) {
return interaction.followUp({ content: 'You do not have the required permissions to run this command.' });
}

if (!interaction.guild.members.me.permissions.has(cmd.botPermissions || [])) {
return interaction.followUp({ content: `I need the following permissions to run this command: [${cmd.botPermissions}]` });
}

cmd.run(client, interaction, args);
}
// Vérification des permissions
if (!interaction.guild || !interaction.member) {
return interaction.followUp({ content: 'This command can only be used in a server.' });
}

if (!interaction.member.permissions.has(PermissionsBitField.Flags.SendMessages, true)) {
return interaction.followUp({ content: 'You do not have permission to send messages.' });
}

if (!interaction.guild.members.me.permissions.has(PermissionsBitField.Flags.SendMessages, true)) {
return interaction.followUp({ content: 'I do not have permission to send messages.' });
}

if (!interaction.member.permissions.has(cmd.userPermissions || [])) {
return interaction.followUp({ content: 'You do not have the required permissions to run this command.' });
}

if (!interaction.guild.members.me.permissions.has(cmd.botPermissions || [])) {
return interaction.followUp({ content: `I need the following permissions to run this command: [${cmd.botPermissions}]` });
}

cmd.run(client, interaction, args);
}
12 replies
DIAdiscord.js - Imagine an app
Created by Gabizoc on 8/30/2024 in #djs-questions
BitFieldInvalid djs 14.15.3
node:events:496
throw er; // Unhandled 'error' event
^

RangeError [BitFieldInvalid]: Invalid bitfield flag or number: SEND_MESSAGES.
at PermissionsBitField.resolve (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\BitField.js:174:11)
at C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\BitField.js:168:35
at Array.map (<anonymous>)
at PermissionsBitField.resolve (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\BitField.js:168:18)
at PermissionsBitField.has (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\BitField.js:60:28)
at PermissionsBitField.has (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\PermissionsBitField.js:92:82)
at Client.<anonymous> (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\events\interactionCreate.js:41:55)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:401:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
code: 'BitFieldInvalid'
}

Node.js v20.11.1
node:events:496
throw er; // Unhandled 'error' event
^

RangeError [BitFieldInvalid]: Invalid bitfield flag or number: SEND_MESSAGES.
at PermissionsBitField.resolve (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\BitField.js:174:11)
at C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\BitField.js:168:35
at Array.map (<anonymous>)
at PermissionsBitField.resolve (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\BitField.js:168:18)
at PermissionsBitField.has (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\BitField.js:60:28)
at PermissionsBitField.has (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\node_modules\discord.js\src\util\PermissionsBitField.js:92:82)
at Client.<anonymous> (C:\Users\gabiz\3D Objects\Discord Bot - Autres\WinBot\events\interactionCreate.js:41:55)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:401:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
code: 'BitFieldInvalid'
}

Node.js v20.11.1
12 replies