Hiro
Hiro
DIAdiscord.js - Imagine a boo! 👻
Created by Hiro on 10/3/2023 in #djs-questions
invite.delete()
for (const invite of invites.values()) {
if (invite.uses === undefined) {
continue; // skip this invite and move on to the next one
}
await invite.delete();
}
for (const invite of invites.values()) {
if (invite.uses === undefined) {
continue; // skip this invite and move on to the next one
}
await invite.delete();
}
Does anyoen know why the invite is not being deleted? When I console.log invites size I get 980 but it only loop through one invite and stays stuck on the invite.delete() and when I console log the invite I actually get the invite
2 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Hiro on 10/2/2023 in #djs-questions
DiscordAPError[10062]: Unknown Interaction
ts
const event: BotEvent = {
name: Events.InteractionCreate,
once: false,
async execute(interaction: Interaction) {

try {
// Check if the interaction is a button interaction and has the customId 'checkverif'
if (!interaction.isButton()) return;

if (interaction.customId !== 'checkverif') return;
await interaction.deferReply({ ephemeral: true })
ts
const event: BotEvent = {
name: Events.InteractionCreate,
once: false,
async execute(interaction: Interaction) {

try {
// Check if the interaction is a button interaction and has the customId 'checkverif'
if (!interaction.isButton()) return;

if (interaction.customId !== 'checkverif') return;
await interaction.deferReply({ ephemeral: true })
Sometimes it loads sometimes I get an instant error, while the first thing to do is to defer it. The id is good because when I console log the interaction it gives me the details
61 replies