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
39 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
h
hOP15mo ago
I've seen the tag that says: - Initial response took more than 3 seconds ➞ defer the response *. - Wrong interaction object inside a collector. - Two processes handling the same command (the first consumes the interaction, so it won't be valid for the - other instance) But it shouldn't take 3 seconds to reply / console log The problem is sometimes if I add the .reply it will reply but after that I get the error Or sometimes if I use the .reply instead of deferReply it won't even reply and get the error instantly
LISPlaysYT
LISPlaysYT15mo ago
can you send me the error?
h
hOP15mo ago
Yes for sure!
h
hOP15mo ago
Pastebin
throw new DiscordAPIError(data, "code" in data ? data.code : data....
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
h
hOP15mo ago
So I get the error no matter what I do Reply, deferReply just console log as well
LISPlaysYT
LISPlaysYT15mo ago
hmmm is this in index.js or a different file
h
hOP15mo ago
A different file When I console log the interaction, it gives me it
LISPlaysYT
LISPlaysYT15mo ago
send me all the code
h
hOP15mo ago
Of the index ?
LISPlaysYT
LISPlaysYT15mo ago
of this file that you are getting the error from
h
hOP15mo ago
Pastebin
import {ButtonInteraction, Events, Interaction, InteractionButtonCo...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
LISPlaysYT
LISPlaysYT15mo ago
hmmm
h
hOP15mo ago
And like I said it's weird sometimes it sends me a reply and sometimes not But it always gives me that error
LISPlaysYT
LISPlaysYT15mo ago
oh yea thats weird @Hiro can you send me a vid if you can of it working then it not working
h
hOP15mo ago
No description
h
hOP15mo ago
For example I got this but after that I got the error Sure But when I mean working it's just replying and still getting the error right after It's like 50/50 sometimes I get the reply sometimes not but 100% get the error Without code change it's 50/50
LISPlaysYT
LISPlaysYT15mo ago
i actually have no idea why thats like that
h
hOP15mo ago
That's why it's so weird I would understand if it's 0% or 100% But sometimes I get a reply sometimes not but still get the error anyway
LISPlaysYT
LISPlaysYT15mo ago
yea i dont know why its random
h
hOP15mo ago
.....
LISPlaysYT
LISPlaysYT15mo ago
?
h
hOP15mo ago
I mean I've been on this for like a day
LISPlaysYT
LISPlaysYT15mo ago
shit
d.js docs
d.js docs15mo ago
Common causes of DiscordAPIError[10062]: Unknown interaction: - Initial response took more than 3 seconds ➞ defer the response *. - Wrong interaction object inside a collector. - Two processes handling the same command (the first consumes the interaction, so it won't be valid for the other instance) * Note: you cannot defer modal or autocomplete value responses
h
hOP15mo ago
Yes but non of those 3 apply The reply is instant and still get error, no 2 bots on the same moment
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
h
hOP15mo ago
But why do I get the error If I get a reply
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
h
hOP15mo ago
No description
h
hOP15mo ago
I get a reply
h
hOP15mo ago
No description
h
hOP15mo ago
I just did it now
Unknown User
Unknown User15mo ago
Message Not Public
Sign In & Join Server To View
h
hOP15mo ago
I only have one terminal open and restarted full pc to make sure
h
hOP15mo ago
Yes I think it is Seems like there is no fix nice
LISPlaysYT
LISPlaysYT15mo ago
great...
Want results from more Discord servers?
Add your server