#Unknown message

1 messages · Page 1 of 1 (latest)

granite imp
#

.

crystal mango
#

.

granite imp
#

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

granite imp
#

Why do you have multiple collectors for the same message?

crystal mango
granite imp
#

Can you send me the full error?

crystal mango
#
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'
}
granite imp
#

@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 😄

crystal mango
#

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

granite imp
#

Try interaction.editReply
You won’t need the ephemeral when doing this as it’s already gonna be ephemeral from the first reply

crystal mango
granite imp
#

You need to reply to the modal submit I’m pretty sure

crystal mango
granite imp
#

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

crystal mango
crystal mango
# granite imp <@309692055087742978>
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'
}
granite imp
crystal mango
#

lastest

#

14.7.1

granite imp
#

@crystal mango

crystal mango
# granite imp <@309692055087742978>

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'
}
granite imp
#

I actually believe that might work

#

Unknown message

crystal mango
# granite imp I actually believe that might work
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

granite imp
#

How? xd

crystal mango
#

ill try again

#

yeah

#

still the same

granite imp
#

You sure you did it correctly?

#

@crystal mango

#

You copy pasted the code I sent?

crystal mango
#

i'll check it again

#

@granite imp yup pretty sure i did it like how you did but still it has this problem

crystal mango
#

no changes

#

just the ones you did in the sourcebin

granite imp
#

Okay instead of the client.on event lets try something else..

crystal mango
granite imp
#

I actually have no idea

crystal mango
#

i have something in mind

granite imp
#

So do I xD

crystal mango
#

let me try something

granite imp
#

Actually I don't know why I didn't just do that before sending the sourcebin lol

#

@crystal mango

crystal mango
#

@granite imp it worked lol

#

2 hours

#

now i can rest in peace

#

tysm @granite imp

granite imp
#

Thank god xd sry it took so long to figure out lol

crystal mango
#

@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

crystal mango
# granite imp 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

granite imp
#

How did you use try catch?

crystal mango
granite imp
#

Can you send me the code with your try catch? Cause try catch should work for this (I use it)

granite imp
crystal mango
# granite imp 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'
}```
granite imp
#

@crystal mango and what exactly is the issue? It doesn't editReply?

crystal mango
#

and executes the code blocks

granite imp
#

What code block?

crystal mango
#

in the try

granite imp
#

Do you mean it executes what's after the catch and you don't want that?

crystal mango
granite imp
#

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?

crystal mango
crystal mango
#

so if it failed it just edits the reply and skips the log message

granite imp
#

I'd say, try to await ownerbye.send

#

That way it shouldn't move on to the logging until the message i sent or it fails to

crystal mango
#

wow

#

that was it

#

@granite imp tysm and sorry if i bothered you