#Unknown message
1 messages · Page 1 of 1 (latest)
.
Can you send me an updated version of your code?
It's really hard to tell what's what now as I don't really know what changed in your code
@crystal mango
Why do you have multiple collectors for the same message?
different modals
Can you send me the full error?
node:events:368
throw er; // Unhandled 'error' event
^
DiscordAPIError[40060]: Interaction has already been acknowledged.
at SequentialHandler.runRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:667:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:464:14)
at async REST.request (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:910:22)
at async ModalSubmitInteraction.update (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:233:5)
at async Client.<anonymous> (C:\Users\USER\Desktop\multi-purpose\commands\zajjel.js:170:4)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:251:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
requestBody: {
files: [],
json: {
type: 7,
data: {
content: '**__message sent!__**',
tts: false,
nonce: undefined,
embeds: [],
components: [],
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: 64,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
}
},
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1079927134224662570/aW50ZXJhY3Rpb246MTA3OTkyNzEzNDIyNDY2MjU3MDpwa3I4VXBsVGs3ek1JdWIzRUFFVTh5bU9OTU1WYUc3UUlzZkxvMjhYSUcxaWVJUlBRMENHRFhJNjI2OFRtekVMZDVOUjV1ZEExZThTckVYZ3dzekVKbnhDS2hibTk1TkF2Z3Z2elQ1Qk1QTzFUTjdGTUlmSFpkZFFGRUZ4OXpsSg/callback'
}
@crystal mango
First I moved all your modals into the same collector as it's on the same message so there's no need for multiple collectors.
Then I changed some of your interactions is as I guess you misunderstood me, my bad for not being clear enough 😄
ah thanks you didn't really have to
but there is something else
node:events:368
throw er; // Unhandled 'error' event
^
TypeError: interaction.update is not a function
at Client.<anonymous> (C:\Users\USER\Desktop\multi-purpose\commands\zajjel.js:150:22)
at Client.emit (node:events:402:35)
at InteractionCreateAction.handle (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\client\actions\InteractionCreate.js:97:12)
at Object.module.exports [as INTERACTION_CREATE] (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\client\websocket\handlers\INTERACTION_CREATE.js:4:36)
at WebSocketManager.handlePacket (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\client\websocket\WebSocketManager.js:352:31)
at WebSocketShard.onPacket (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\client\websocket\WebSocketShard.js:489:22)
at WebSocketShard.onMessage (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\client\websocket\WebSocketShard.js:328:10)
at callListener (C:\Users\USER\Desktop\multi-purpose\node_modules\ws\lib\event-target.js:290:14)
at WebSocket.onMessage (C:\Users\USER\Desktop\multi-purpose\node_modules\ws\lib\event-target.js:209:9)
at WebSocket.emit (node:events:390:28)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:251:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21)
it seems the interaction.update didn't work out
Try interaction.editReply
You won’t need the ephemeral when doing this as it’s already gonna be ephemeral from the first reply
yeah that worked and reply edits and embeds are sent to their places but now it's this lol
btw no error is logged
You need to reply to the modal submit I’m pretty sure
so i return if (i.isModalSubmit()) {... ?
Gimme a bit
I have a solution in mind...
You could delete the old message with the select menu and then reply to the modal submit instead. It's gonna have pretty much the same outcome, let me show you
@crystal mango
yeah i thought of that i'll try it
node:events:368
throw er; // Unhandled 'error' event
^
DiscordAPIError[10008]: Unknown Message
at SequentialHandler.runRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:667:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:464:14)
at async REST.request (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:910:22)
at async MessageManager.delete (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\managers\MessageManager.js:254:5)
at async Message.delete (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\structures\Message.js:784:5)
at async Client.<anonymous> (C:\Users\USER\Desktop\multi-purpose\commands\zajjel.js:150:4)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:251:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Unknown Message', code: 10008 },
code: 10008,
status: 404,
method: 'DELETE',
url: 'https://discord.com/api/v10/channels/1060710564508221522/messages/1079939997244858488'
}
Which d.js version are you on?
Just asked in #djs-help-v14 and you need to use interaction.deleteReply
https://sourceb.in/m3DACeKwEw
@crystal mango
alright i'll try
this happens after i use the command the 2nd time
node:events:368
throw er; // Unhandled 'error' event
^
DiscordAPIError[10008]: Unknown Message
at SequentialHandler.runRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:667:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:464:14)
at async REST.request (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:910:22)
at async InteractionWebhook.deleteMessage (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\structures\Webhook.js:385:5)
at async ChatInputCommandInteraction.deleteReply (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:175:5)
at async Client.<anonymous> (C:\Users\USER\Desktop\multi-purpose\commands\zajjel.js:150:4)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:251:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Unknown Message', code: 10008 },
code: 10008,
status: 404,
method: 'DELETE',
url: 'https://discord.com/api/v10/webhooks/1061915912145481738/aW50ZXJhY3Rpb246MTA3OTk0NDIzMTYwNDQ1MzM5NzpoZk11TTQ5ODJORWFVdVd2bzI0cjh0VVZsU2cyOE1wRWlVdkhFTndjUG43elUzbTJMWHJERnU4WWxJZjJ2OW1vWkoxdkdCZmxiUHJYcmpXclFQWGd5QUh5d1Z2bDRwaUN2Mm9qbXc1anY4aE5rQTJ3cW5aY0M5RXdSQTBEWk5DRw/messages/@original'
}
Let's check if it works moving your interactionCreate event inside your collector.
https://sourceb.in/xSx10bSVL7
I actually believe that might work
Unknown message
node:events:368
throw er; // Unhandled 'error' event
^
DiscordAPIError[10008]: Unknown Message
at SequentialHandler.runRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:667:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:464:14)
at async REST.request (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:910:22)
at async InteractionWebhook.deleteMessage (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\structures\Webhook.js:385:5)
at async ChatInputCommandInteraction.deleteReply (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:175:5)
at async Client.<anonymous> (C:\Users\USER\Desktop\multi-purpose\commands\zajjel.js:145:7)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:251:10)
at processTicksAndRejections (node:internal/process/task_queues:85:21) {
requestBody: { files: undefined, json: undefined },
rawError: { message: 'Unknown Message', code: 10008 },
code: 10008,
status: 404,
method: 'DELETE',
url: 'https://discord.com/api/v10/webhooks/1061915912145481738/aW50ZXJhY3Rpb246MTA3OTk0Nzc1NDM2Njg0OTEwNTo3NXBCdjlxNzRScU5BS0lKOHFPcmRjajA0NWJEb2hBTHlXWTF0VUw1eFJwdXl1S1NZQzdVQ1ZyMk5ibzRaTG9mcFVZSDBGUmY3eUJiM3lDdW1WMmd6bDNYdTNxbkx4VjNsSVZqV3Y3VGpyYWlqaFZJZTlUdDRTYldTZDVmZjVybA/messages/@original'
}
wait wait
i goofed it
How? xd
i moved it inside one of the modals :P
ill try again
yeah
still the same
yeah
i'll check it again
@granite imp yup pretty sure i did it like how you did but still it has this problem
Send updated code again? xd
its the same thing lol
no changes
just the ones you did in the sourcebin
Okay instead of the client.on event lets try something else..
doesn't isModalSubmit only work in a lisenter ?
I actually have no idea
So do I xD
let me try something
https://sourceb.in/oNddYcSxZx
And add InteractionCollector & InteractionType to your require('discord.js')
Actually I don't know why I didn't just do that before sending the sourcebin lol
https://sourceb.in/SC9DJKhYhJ here did it for ya
@crystal mango
okay i'll try
@granite imp it worked lol
2 hours
now i can rest in peace
tysm @granite imp
Thank god xd sry it took so long to figure out lol
@granite imp sorry to bother you but if you have time i request your help once again it's something easy but i just can't wrap my head around it for some reason
What's up?
well im trying to make the bot not send the log message when it catches an error in the first code block
i tried try & catch but doesn't seem to work
maybe i did it the wrong way idk
How did you use try catch?
both code blocks inside try and when it catches an error it sends the editReply
Can you send me the code with your try catch? Cause try catch should work for this (I use it)
What happens when you run that and the bot can't DM the user?
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^
DiscordAPIError[50007]: Cannot send messages to this user
at SequentialHandler.runRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:667:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SequentialHandler.queueRequest (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:464:14)
at async REST.request (C:\Users\USER\Desktop\multi-purpose\node_modules\@discordjs\rest\dist\index.js:910:22)
at async DMChannel.send (C:\Users\USER\Desktop\multi-purpose\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:176:15) {
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [
{
title: 'a message arrived...',
author: {
name: 'david',
url: undefined,
icon_url: 'https://i.imgur.com/ADa9Pnu.png'
},
color: 3447003,
description: 's',
thumbnail: { url: 'https://i.imgur.com/pNBObzV.png' },
image: { url: 'https://i.imgur.com/gDHkR6B.png' }
}
],
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Cannot send messages to this user', code: 50007 },
code: 50007,
status: 403,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1079248267243696198/messages'
}```
@crystal mango and what exactly is the issue? It doesn't editReply?
yeah
and executes the code blocks
What code block?
in the try
Do you mean it executes what's after the catch and you don't want that?
no it supposed to editReply only without sending log and that only when it catches the error
Well if it fails to send the DM to the owner, it shouldn't even get to the log.send part but instead move directly into the catch block?
i worked this way but it the problem with it was it was still sending the log message
yeah
so if it failed it just edits the reply and skips the log message