fauteen
fauteen
DIAdiscord.js - Imagine an app
Created by fauteen on 8/16/2024 in #djs-questions
Catching an error and sending custom error
if (error.message.includes('Interaction has already been acknowledged')) {
if (error.message.includes('Interaction has already been acknowledged')) {
will this work?
7 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/22/2024 in #djs-questions
Interaction already replied issue
Yep, I've found out the issue. Thanks!
15 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/22/2024 in #djs-questions
Interaction already replied issue
when i changed that line to editreply, it worked. but i got this error when trying to run other commands.
rror [INTERACTION_NOT_REPLIED]: The reply to this interaction has not been sent or deferred.
at CommandInteraction.editReply (/home/runner/System-Bot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:149:48)
at module.exports (/home/runner/System-Bot/src/events/interactionCreate.js:5:23)
at Client.emit (node:events:394:28)
at InteractionCreateAction.handle (/home/runner/System-Bot/node_modules/discord.js/src/client/actions/InteractionCreate.js:83:12)
at Object.module.exports [as INTERACTION_CREATE] (/home/runner/System-Bot/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/home/runner/System-Bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:346:31)
at WebSocketShard.onPacket (/home/runner/System-Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:493:22)
at WebSocketShard.onMessage (/home/runner/System-Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:327:10)
at callListener (/home/runner/System-Bot/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/runner/System-Bot/node_modules/ws/lib/event-target.js:209:9) {
[Symbol(code)]: 'INTERACTION_NOT_REPLIED'
}

rror [INTERACTION_NOT_REPLIED]: The reply to this interaction has not been sent or deferred.
at CommandInteraction.editReply (/home/runner/System-Bot/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:149:48)
at module.exports (/home/runner/System-Bot/src/events/interactionCreate.js:5:23)
at Client.emit (node:events:394:28)
at InteractionCreateAction.handle (/home/runner/System-Bot/node_modules/discord.js/src/client/actions/InteractionCreate.js:83:12)
at Object.module.exports [as INTERACTION_CREATE] (/home/runner/System-Bot/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (/home/runner/System-Bot/node_modules/discord.js/src/client/websocket/WebSocketManager.js:346:31)
at WebSocketShard.onPacket (/home/runner/System-Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:493:22)
at WebSocketShard.onMessage (/home/runner/System-Bot/node_modules/discord.js/src/client/websocket/WebSocketShard.js:327:10)
at callListener (/home/runner/System-Bot/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/runner/System-Bot/node_modules/ws/lib/event-target.js:209:9) {
[Symbol(code)]: 'INTERACTION_NOT_REPLIED'
}

15 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/22/2024 in #djs-questions
Interaction already replied issue
let me fix that and see
15 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/22/2024 in #djs-questions
Interaction already replied issue
^^
15 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/22/2024 in #djs-questions
Interaction already replied issue
const { MessageEmbed, Collection } = require('discord.js')
module.exports = async (client, interaction) => {

if (interaction.isCommand()) {
await interaction.deferReply({ ephemeral: false })
let embed = new MessageEmbed()

const cmd = client.commands.get(interaction.commandName);

if (!cmd) return interaction.followUp({ content: "An error has occured " });

const args = [];

for (let option of interaction.options.data) {
if (option.type === "SUB_COMMAND") {
if (option.name) args.push(option.name);
option.options ?.forEach((x) => {
if (x.value) args.push(x.value);
});
} else if (option.value) args.push(option.value);
}

if (cmd.cooldown) {
if (!client.cooldown.has(cmd.name)) { client.cooldown.set(cmd.name, new Collection()) }

if (client.cooldown.get(cmd.name).has(interaction.user.id)) {

if (Date.now() < client.cooldown.get(cmd.name).get(interaction.user.id) + (cmd.cooldown) * 1000) {

const time_left = (client.cooldown.get(cmd.name).get(interaction.user.id) + (cmd.cooldown) * 1000 - Date.now()) / 1000;

return interaction.followUp({
content: `cooldown for \`${time_left.toFixed(1)}\` seconds`,
ephemeral: true
})

}
}

client.cooldown.get(cmd.name).set(interaction.user.id, Date.now());

setTimeout(() => client.cooldown.get(cmd.name).delete(interaction.user.id), (cmd.cooldown) * 1000);

}

if (cmd.permissions) {
if (!client.vaildPermissions.includes(cmd.permissions)) return;

if (!interaction.member.permissions.has(cmd.permissions)) return interaction.followUp({
content: `You don\'t have \`${cmd.permissions}\` permission`,
ephemeral: true
})
}

cmd.run(client, interaction, args);
}
}
const { MessageEmbed, Collection } = require('discord.js')
module.exports = async (client, interaction) => {

if (interaction.isCommand()) {
await interaction.deferReply({ ephemeral: false })
let embed = new MessageEmbed()

const cmd = client.commands.get(interaction.commandName);

if (!cmd) return interaction.followUp({ content: "An error has occured " });

const args = [];

for (let option of interaction.options.data) {
if (option.type === "SUB_COMMAND") {
if (option.name) args.push(option.name);
option.options ?.forEach((x) => {
if (x.value) args.push(x.value);
});
} else if (option.value) args.push(option.value);
}

if (cmd.cooldown) {
if (!client.cooldown.has(cmd.name)) { client.cooldown.set(cmd.name, new Collection()) }

if (client.cooldown.get(cmd.name).has(interaction.user.id)) {

if (Date.now() < client.cooldown.get(cmd.name).get(interaction.user.id) + (cmd.cooldown) * 1000) {

const time_left = (client.cooldown.get(cmd.name).get(interaction.user.id) + (cmd.cooldown) * 1000 - Date.now()) / 1000;

return interaction.followUp({
content: `cooldown for \`${time_left.toFixed(1)}\` seconds`,
ephemeral: true
})

}
}

client.cooldown.get(cmd.name).set(interaction.user.id, Date.now());

setTimeout(() => client.cooldown.get(cmd.name).delete(interaction.user.id), (cmd.cooldown) * 1000);

}

if (cmd.permissions) {
if (!client.vaildPermissions.includes(cmd.permissions)) return;

if (!interaction.member.permissions.has(cmd.permissions)) return interaction.followUp({
content: `You don\'t have \`${cmd.permissions}\` permission`,
ephemeral: true
})
}

cmd.run(client, interaction, args);
}
}
this is my interactioncreate
15 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/22/2024 in #djs-questions
Interaction already replied issue
i am only using this command, and this command gets the error only
15 replies
DIAdiscord.js - Imagine an app
Created by Unicorn. on 6/22/2024 in #djs-questions
How to send custom emoji in embed description
^^
12 replies
DIAdiscord.js - Imagine an app
Created by Unicorn. on 6/22/2024 in #djs-questions
How to send custom emoji in embed description
if you are using a custom emoji
12 replies
DIAdiscord.js - Imagine an app
Created by Unicorn. on 6/22/2024 in #djs-questions
How to send custom emoji in embed description
it should give you something like :js:
12 replies
DIAdiscord.js - Imagine an app
Created by Unicorn. on 6/22/2024 in #djs-questions
How to send custom emoji in embed description
for the emojis you want, you but a \ before it so like \⚠️
12 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
alot
34 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
i really appreciate it
34 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
thank you so much for your help
34 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
sure
34 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
i can show you my interactioncreate.js if you want
34 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
mb i was getting confused with the dyno is thinking thing
34 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
wait
34 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
let me get it
34 replies
DIAdiscord.js - Imagine an app
Created by fauteen on 6/21/2024 in #djs-questions
Unknown Interaction
yep
34 replies