Elyana
Elyana
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 6/21/2023 in #djs-questions
Emoji shows in a server but not on another (host on a third one)
Aaah Charmants tu es là aussi ! merci beaucoup !!
7 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 6/21/2023 in #djs-questions
Emoji shows in a server but not on another (host on a third one)
Ah yeaah it works !!
7 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 6/21/2023 in #djs-questions
Emoji shows in a server but not on another (host on a third one)
bot has admin permission on the server where it can't show those emojis
7 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/24/2023 in #djs-questions
Display "Failed of the interaction" but no logs error and still running well
Oooh, thank you for your advice, you remind me to use the interaction instead of message. And i try the update method instead of edit, editReply
await i.update({
embeds: [updatedEmbed],
});
await i.update({
embeds: [updatedEmbed],
});
And it works well now !! 🥳
6 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/24/2023 in #djs-questions
Display "Failed of the interaction" but no logs error and still running well
oh, now i have a console error when clicking on button : have done this change :
const message = await interaction.reply({
embeds: [embed],
components : [row],
fetchReply : true,
ephemeral: true
});
const message = await interaction.reply({
embeds: [embed],
components : [row],
fetchReply : true,
ephemeral: true
});
DiscordAPIError[10008]: Unknown Message at handleErrors (C:\Users\Propriétaire\Documents\Bot Discord\Nemo\node_modules\@discordjs\rest\dist\index.js:640:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async SequentialHandler.runRequest (C:\Users\Propriétaire\Documents\Bot Discord\Nemo\node_modules\@discordjs\rest\dist\index.js:1021:23) at async SequentialHandler.queueRequest (C:\Users\Propriétaire\Documents\Bot Discord\Nemo\node_modules\@discordjs\rest\dist\index.js:862:14) at async REST.request (C:\Users\Propriétaire\Documents\Bot Discord\Nemo\node_modules\@discordjs\rest\dist\index.js:1387:22) at async MessageManager.edit (C:\Users\Propriétaire\Documents\Bot Discord\Nemo\node_modules\discord.js\src\managers\MessageManager.js:176:15) at async InteractionCollector.<anonymous> (C:\Users\Propriétaire\Documents\Bot Discord\Nemo\commands\stacking.js:661:21)
6 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/11/2023 in #djs-questions
Is there a way to setAutocomplete(true) in function of another option value?
okay got it, thank you
5 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/11/2023 in #djs-questions
Is there a way to setAutocomplete(true) in function of another option value?
data : new SlashCommandBuilder()
.setName(key)
.setDescription("Help you track what you have stack on your production machines")
.addSubcommand(
new SlashCommandSubcommandBuilder()
.setName("account")
.setDescription("Manage your accounts")
.addStringOption(
new SlashCommandStringOption()
.setName("action")
.setDescription("What do you wish to do ?")
.setRequired(true)
.addChoices({
name : "Add",
value : "add"
}, {
name : "Modify",
value : "modify"
}, {
name : "Delete",
value : "delete"
})
)
.addStringOption(
new SlashCommandStringOption()
.setName("account")
.setDescription("Enter the account name")
.setRequired(true)
.setAutocomplete((interaction, option)=>{
if (interaction.options.getString('action') === 'delete') {
return true;
} else {
return false;
}
})
),
data : new SlashCommandBuilder()
.setName(key)
.setDescription("Help you track what you have stack on your production machines")
.addSubcommand(
new SlashCommandSubcommandBuilder()
.setName("account")
.setDescription("Manage your accounts")
.addStringOption(
new SlashCommandStringOption()
.setName("action")
.setDescription("What do you wish to do ?")
.setRequired(true)
.addChoices({
name : "Add",
value : "add"
}, {
name : "Modify",
value : "modify"
}, {
name : "Delete",
value : "delete"
})
)
.addStringOption(
new SlashCommandStringOption()
.setName("account")
.setDescription("Enter the account name")
.setRequired(true)
.setAutocomplete((interaction, option)=>{
if (interaction.options.getString('action') === 'delete') {
return true;
} else {
return false;
}
})
),
5 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
I see, was seduce by that collectors stuff, easier to maintain and more focus on the messages (ressources save). I will redo my code into the traditional way then
16 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
That's why, i try to separate one slash commands from all the others
16 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
I mean, if i add other slash command to the client, i need to restart the script to let the bot take those new commands into consideration, no ? But by doing that, the /poll collector will not be active anymore
16 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
If i need to implement other commands without shutdown a /slashcommand which hold an active collector ?
16 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
My question is, is that possible to run 2 /commands scripts properly ?
16 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
DiscordAPIError[40060]: Interaction has already been acknowledged.
at SequentialHandler.runRequest (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\node_modules\@discordjs\rest\dist\index.js:933:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\node_modules\@discordjs\rest\dist\index.js:712:14)
at async REST.request (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\node_modules\@discordjs\rest\dist\index.js:1321:22)
at async ChatInputCommandInteraction.reply (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5)
at async Client.<anonymous> (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\vicky-commands.js:70:10)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:251:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1104781967985229910/aW50ZXJhY3Rpb246MTEwNDc4MTk2Nzk4NTIyOTkxMDpoU1ZRRmhSUWtUZ0dFY09Ja3NKVEdKTGVrUm82T2ZaWExPYWVJbWFWaWZSUUFVb3lrdGx3WkxPQzNpQ0R4WFVQYTZveGVyOVB6UGY0dzVLZjJXaXhWT3l5SFFkUGhCaVNkUG5nMm96Um9zTmVyY1RUYllHcWE1OXVlUFR0aloxTA/callback',
requestBody: {
files: [],
json: {
type: 4,
content: 'There was an error while executing this command!',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 64,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
}
}
DiscordAPIError[40060]: Interaction has already been acknowledged.
at SequentialHandler.runRequest (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\node_modules\@discordjs\rest\dist\index.js:933:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\node_modules\@discordjs\rest\dist\index.js:712:14)
at async REST.request (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\node_modules\@discordjs\rest\dist\index.js:1321:22)
at async ChatInputCommandInteraction.reply (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:111:5)
at async Client.<anonymous> (C:\Users\Propriétaire\Documents\Bot Discord\Vicky\vicky-commands.js:70:10)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:251:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1104781967985229910/aW50ZXJhY3Rpb246MTEwNDc4MTk2Nzk4NTIyOTkxMDpoU1ZRRmhSUWtUZ0dFY09Ja3NKVEdKTGVrUm82T2ZaWExPYWVJbWFWaWZSUUFVb3lrdGx3WkxPQzNpQ0R4WFVQYTZveGVyOVB6UGY0dzVLZjJXaXhWT3l5SFFkUGhCaVNkUG5nMm96Um9zTmVyY1RUYllHcWE1OXVlUFR0aloxTA/callback',
requestBody: {
files: [],
json: {
type: 4,
content: 'There was an error while executing this command!',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 64,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
}
}
16 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
• Explain what exactly your issue is : running 2 script like this. The other one which have a collector, have the condition
if (interaction.isChatInputCommand() && interaction.commandName === "poll")
if (interaction.isChatInputCommand() && interaction.commandName === "poll")
To upload more easily new features for my bot in the future, i would like to separate the "poll" which need to be always online without interruption, But by doing this, when i run /poll, it shutdown the script above by saying that :
16 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
//======> Declare all function files <======//

// add commands collection
client.commands = new Collection();
const commandsPath = path.join(__dirname, 'commands');
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
// Set a new item in the Collection with the key as the command name and the value as the exported module
if ('data' in command && 'execute' in command) {
client.commands.set(command.data.name, command);
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}

//======> Declare all event <======//

client.on('ready', async c => {

console.log(`Ready! Logged in as ${c.user.tag}`);
});

client.on('interactionCreate', async interaction => {
if (interaction.isChatInputCommand() && interaction.commandName === "fishing") {
const command = interaction.client.commands.get(interaction.commandName);
if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}
try {
await command.execute(interaction);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
} else if (interaction.isChatInputCommand() && interaction.commandName === "fishing") {
const command = interaction.client.commands.get(interaction.commandName);

if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}

try {
await command.autocomplete(interaction);
} catch (error) {
console.error(error);
}
}
});

// connecter le script au bot discord
client.login(process.env.TOKEN);
//======> Declare all function files <======//

// add commands collection
client.commands = new Collection();
const commandsPath = path.join(__dirname, 'commands');
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));

for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
// Set a new item in the Collection with the key as the command name and the value as the exported module
if ('data' in command && 'execute' in command) {
client.commands.set(command.data.name, command);
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}

//======> Declare all event <======//

client.on('ready', async c => {

console.log(`Ready! Logged in as ${c.user.tag}`);
});

client.on('interactionCreate', async interaction => {
if (interaction.isChatInputCommand() && interaction.commandName === "fishing") {
const command = interaction.client.commands.get(interaction.commandName);
if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}
try {
await command.execute(interaction);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
} else if (interaction.isChatInputCommand() && interaction.commandName === "fishing") {
const command = interaction.client.commands.get(interaction.commandName);

if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}

try {
await command.autocomplete(interaction);
} catch (error) {
console.error(error);
}
}
});

// connecter le script au bot discord
client.login(process.env.TOKEN);
16 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Elyana on 5/7/2023 in #djs-questions
Running 2 differents files on the same bot ?
• discord.js :[email protected] • node : v17.3.0
16 replies