RAH3RI
RAH3RI
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
Sure, thanks for the help though!
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
sorry to bother you but how exactly am I supposed to achieve that?
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
now I need to learn about launch configurations I guess
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
ah, alright, weird that it wasn't doing that before then
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
wow I really feel dumb rn, as a CS student who haven't coded in months
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
no, didn't change anything... Anyway isn't it weird not to be able to run a single file with F5?
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
oh I see this
"program": "${workspaceFolder}\\index.js"
"program": "${workspaceFolder}\\index.js"
but how come I didn't have to bother with that before?
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
never touched the launch.json, what should I edit?
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
(please ping me if you're able to help, I won't be checking the channel all the time)
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 10/12/2023 in #djs-questions
Cannot run deployment scripts
node : v16.16.0 discord.js : 14.13.0
12 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 4/2/2023 in #djs-questions
Best approach for this ?
I see, thanks
7 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 4/2/2023 in #djs-questions
Best approach for this ?
then should I dispatch the code with a simple if statement ?
7 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 4/2/2023 in #djs-questions
Best approach for this ?
oh right, didn't think of using subfiles for this kind of stuff, thanks
7 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 4/2/2023 in #djs-questions
Best approach for this ?
Isn't it a bit heavy in terms of CPU usage ? And what if I make multiple scripts triggered by the same event ? They would all be triggered each time ?
7 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 4/2/2023 in #djs-questions
Best approach for this ?
7 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 3/27/2023 in #djs-questions
Receiving button interactions
oh and, as we're here, I'd like to move my handlers code to a dedicated file in a handlers folder (just so the code is cleaner) but I don't really know how to do that (I want to move those : https://discord.com/channels/222078108977594368/1089990904451960903/1090355280090509424) My problem is that I don't know how to exactly setup the file and have the index.js to run them correctly before login
19 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 3/27/2023 in #djs-questions
Receiving button interactions
got it :)
19 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 3/27/2023 in #djs-questions
Receiving button interactions
thank you again !
19 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 3/27/2023 in #djs-questions
Receiving button interactions
oh I didn't know I needed an interaction.reply(), I just added one anyway
19 replies
DIAdiscord.js - Imagine an app
Created by RAH3RI on 3/27/2023 in #djs-questions
Receiving button interactions
well I handle it like that :
} else if (interaction.isButton()) {
// Buttons
const button = interaction.client.buttons.get(interaction.customId);

// Check if the button exists
if (!button) {
console.error(`No button matching ${interaction.customId} was found.`);
return;
}

try {
// Execute the button function
await button.execute(interaction);
// Log
console.log(`Button ${interaction.customId} executed by ${interaction.user.tag} in ${interaction.guild.name} at ${interaction.createdAt}`);

} catch (error) {
// Catch and log any errors
console.error(error);
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: "Il semblerait qu'il y ait eu une erreur...", ephemeral: true });
} else {
await interaction.reply({ content: 'Une erreur est survenue !', ephemeral: true });
}
}
} else if (interaction.isButton()) {
// Buttons
const button = interaction.client.buttons.get(interaction.customId);

// Check if the button exists
if (!button) {
console.error(`No button matching ${interaction.customId} was found.`);
return;
}

try {
// Execute the button function
await button.execute(interaction);
// Log
console.log(`Button ${interaction.customId} executed by ${interaction.user.tag} in ${interaction.guild.name} at ${interaction.createdAt}`);

} catch (error) {
// Catch and log any errors
console.error(error);
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: "Il semblerait qu'il y ait eu une erreur...", ephemeral: true });
} else {
await interaction.reply({ content: 'Une erreur est survenue !', ephemeral: true });
}
}
19 replies