RKochenderfer / BruhBot

Custom discord bot
Apache License 2.0
1 stars 0 forks source link

/roll causes application to crash #56

Closed RKochenderfer closed 1 year ago

RKochenderfer commented 1 year ago

Error:

bruhbot-dev                   | /app/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:640
bruhbot-dev                   |       throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
bruhbot-dev                   |             ^
bruhbot-dev                   | 
bruhbot-dev                   | DiscordAPIError[10062]: Unknown interaction
bruhbot-dev                   |     at handleErrors (/app/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:640:13)
bruhbot-dev                   |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
bruhbot-dev                   |     at async BurstHandler.runRequest (/app/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:736:23)
bruhbot-dev                   |     at async REST.request (/app/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:1387:22)
bruhbot-dev                   |     at async ChatInputCommandInteraction.reply (/app/node_modules/.pnpm/discord.js@14.9.0/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:111:5) {
bruhbot-dev                   |   requestBody: {
bruhbot-dev                   |     files: [],
bruhbot-dev                   |     json: {
bruhbot-dev                   |       type: 4,
bruhbot-dev                   |       data: {
bruhbot-dev                   |         content: '`| Roll  || Values  || Total  |\n' +
bruhbot-dev                   |           '------------------------------\n' +
bruhbot-dev                   |           '| 2d6   || 2,5     || 7      |`',
bruhbot-dev                   |         tts: false,
bruhbot-dev                   |         nonce: undefined,
bruhbot-dev                   |         embeds: undefined,
bruhbot-dev                   |         components: undefined,
bruhbot-dev                   |         username: undefined,
bruhbot-dev                   |         avatar_url: undefined,
bruhbot-dev                   |         allowed_mentions: undefined,
bruhbot-dev                   |         flags: undefined,
bruhbot-dev                   |         message_reference: undefined,
bruhbot-dev                   |         attachments: undefined,
bruhbot-dev                   |         sticker_ids: undefined,
bruhbot-dev                   |         thread_name: undefined
bruhbot-dev                   |       }
bruhbot-dev                   |     }
bruhbot-dev                   |   },
bruhbot-dev                   |   rawError: { message: 'Unknown interaction', code: 10062 },
bruhbot-dev                   |   code: 10062,
bruhbot-dev                   |   status: 404,
bruhbot-dev                   |   method: 'POST',
bruhbot-dev                   |   url: 'https://discord.com/api/v10/interactions/1128386145319915570/aW50ZXJhY3Rpb246MTEyODM4NjE0NTMxOTkxNTU3MDpNYjB0OWU3ODJseHNDaXZERW02SkEwRUxBVlZHMHQ1OWhGVldvT05mNkdIeGEzVkNiVTVkVUhzTWVTSHpZbGxoVEZuNHg3YmFtclAxMjJiR0JRSE1iZENJVmZGUXRpOG5aTEhFbG9pUVZDbXZ6ZXl6RXRJblpJc2szWmNnYWh6dQ/callback'
bruhbot-dev                   | }
bruhbot-dev                   | 

This appears to be happening after deploying the commands. Duplicated this on server and local machine.

Roll command still works when attempting on dev discord server.

RKochenderfer commented 1 year ago

Seeing this log after running !deploy in guild to have commands added to:

{
  "_id": {
    "$oid": "64ad9afa68bbb74f8fd1f441"
  },
  "level": 50,
  "time": {
    "$date": "2023-07-11T18:10:02.621Z"
  },
  "pid": 1,
  "hostname": "e5349b47f663",
  "err": {
    "type": "DiscordAPIError",
    "message": "Unknown application command",
    "stack": "DiscordAPIError[10063]: Unknown application command\n    at handleErrors (/app/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:640:13)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async SequentialHandler.runRequest (/app/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:1021:23)\n    at async SequentialHandler.queueRequest (/app/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:862:14)\n    at async REST.request (/app/node_modules/.pnpm/@discordjs+rest@1.7.1/node_modules/@discordjs/rest/dist/index.js:1387:22)\n    at async updateCommands (/app/build/command-updater.js:74:9)\n    at async Client.onMessageCreate (/app/build/listeners.js:19:9)",
    "requestBody": {},
    "rawError": {
      "type": "Object",
      "message": "Unknown application command",
      "stack": "",
      "code": 10063
    },
    "code": 10063,
    "status": 404,
    "method": "DELETE",
    "url": "https://discord.com/api/v10/applications/758113760761479189/guilds/784580416610631761/commands/1034827085463695435"
  },
  "msg": "Unknown application command"
}
RKochenderfer commented 1 year ago

Looks like the error could be related to the command deployer method.

RKochenderfer commented 1 year ago

This is still not working when deployed to the server. The commands are now refreshing properly but still getting unregistered command issues when attempting to use interactions.

RKochenderfer commented 1 year ago

This appeared to be a server issue. Restarting the computer fixed the issue.