Gripz
Gripz
DIAdiscord.js - Imagine an app
Created by Gripz on 6/4/2024 in #djs-questions
content: '' even when there's a content.
worked thanks. I am noob in discrodjs
4 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/17/2024 in #djs-questions
How can I make the following thing happen
No description
12 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/17/2024 in #djs-questions
How can I make the following thing happen
@chewie 🌈 is there any way ?
12 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/17/2024 in #djs-questions
How can I make the following thing happen
So, the problem arises that either am able to interaction.showModal or do interaction.update.
12 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/17/2024 in #djs-questions
How can I make the following thing happen
Wait, lemme explain a bit. I have a message (message is ephemeral) which has button. I was listening to this button by the InteractionCreate event. - So what I want is that, when I click this button, the message which had this button, to be updated and get changed to "Creating modal" and then the modals shows up. - When the modal is submitted, the same message which was "Creating modal" gets changed to "Modal submitted". How can I achieve this ?
12 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/1/2024 in #djs-questions
How to get never timeout buttons
yes
15 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/1/2024 in #djs-questions
How to get never timeout buttons
Yes. I got what you said now. Thanks for help.
15 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/1/2024 in #djs-questions
How to get never timeout buttons
Sorry to mention but still waiting for an answer. @NyR
15 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/1/2024 in #djs-questions
How to get never timeout buttons
I ain't getting what are you saying. I am kinda new to discordjs. I added this line to the file where interactions are handled, inside the client.on.
if (interaction.isButton()) { await handlebuttons(interaction);
}
if (interaction.isButton()) { await handlebuttons(interaction);
}
And added this inside my command file -
async function handlebuttons(interaction) {
if (interaction.customId === "rules") {
await interaction.reply({content:"Rules"})
}
if (interaction.customId === "posts") {
await interaction.reply({content:"Posts"})
}
}
async function handlebuttons(interaction) {
if (interaction.customId === "rules") {
await interaction.reply({content:"Rules"})
}
if (interaction.customId === "posts") {
await interaction.reply({content:"Posts"})
}
}
I can't figure out by what The Gobbler said. Which line should I put in which file.
15 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/1/2024 in #djs-questions
How to get never timeout buttons
Yep. That works. But I have one more thing to ask. This method is good but everything looks cluttered now. Can I use the same
client.on(Events.InteractionCreate, async (interaction) => {})
client.on(Events.InteractionCreate, async (interaction) => {})
in my command files too? like for buttons in a file, I will make a new client.on in that file only.
15 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 4/1/2024 in #djs-questions
How to get never timeout buttons
I have no idea how do I handle buttons. Please elaborate. Here's my part of code that handles slash command interactions.
client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isChatInputCommand()) return;
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, client);
} catch (error) {
console.error(error);
if (interaction.replied || interaction.deferred) {
const errorEmbed = new EmbedBuilder()
.setTitle("Error")
.setDescription(
"There was an error while executing this command! Please [contact the developer](https://discord.com/users/844863061907210251).",
)
.setTimestamp()
.setColor(0xff0000)
.setThumbnail(client.user.displayAvatarURL());
await interaction.followUp({ embeds: [errorEmbed], ephemeral: true });
} else {
const errorEmbed = new EmbedBuilder()
.setTitle("Error")
.setDescription(
"There was an error while executing this command! Please [contact the developer](https://discord.com/users/844863061907210251).",
)
.setTimestamp()
.setColor(0xff0000)
.setThumbnail(client.user.displayAvatarURL());
await interaction.reply({ embeds: [errorEmbed], ephemeral: true });
}
}
});
client.on(Events.InteractionCreate, async (interaction) => {
if (!interaction.isChatInputCommand()) return;
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, client);
} catch (error) {
console.error(error);
if (interaction.replied || interaction.deferred) {
const errorEmbed = new EmbedBuilder()
.setTitle("Error")
.setDescription(
"There was an error while executing this command! Please [contact the developer](https://discord.com/users/844863061907210251).",
)
.setTimestamp()
.setColor(0xff0000)
.setThumbnail(client.user.displayAvatarURL());
await interaction.followUp({ embeds: [errorEmbed], ephemeral: true });
} else {
const errorEmbed = new EmbedBuilder()
.setTitle("Error")
.setDescription(
"There was an error while executing this command! Please [contact the developer](https://discord.com/users/844863061907210251).",
)
.setTimestamp()
.setColor(0xff0000)
.setThumbnail(client.user.displayAvatarURL());
await interaction.reply({ embeds: [errorEmbed], ephemeral: true });
}
}
});
15 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 3/20/2024 in #djs-questions
How do I get target's presence ?
Thanks. It works 👍
6 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 3/20/2024 in #djs-questions
How do I get target's presence ?
ok
6 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 3/15/2024 in #djs-questions
Discord API Error
Ok. Thanks 👍🏼 I got it what you said. In line 128, it tries to delete a message. But if I run the purge command again and again before waiting for 30 seconds the publicLog message gets deleted and that throws an error because.
6 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 3/15/2024 in #djs-questions
Discord API Error
The interaction reply ?
6 replies
DIAdiscord.js - Imagine an app
Created by Gripz on 3/15/2024 in #djs-questions
Discord API Error
how ?
6 replies
DIAdiscord.js - Imagine an app
Created by AL3M4ND1Y3 on 3/14/2024 in #djs-questions
Hello, I would like to know how to call the functionality that only one user can see the message, th
while in response object, set ephemeral
interaction.reply({content: 'Whatever your messages is', ephemeral: true})
interaction.reply({content: 'Whatever your messages is', ephemeral: true})
8 replies