question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slash commands API error 500 (method: get)

See original GitHub issue

Which package is this bug report for?

rest

Issue description

Hello,

I have been using the /slash commands for 5 months now, however, for the last 2/3 days I have been getting this error constantly.


/www/wwwroot/bot/node_modules/discord.js/src/rest/RequestHandler.js:201
        throw new HTTPError(error.message, error.constructor.name, error.status, request);
              ^

HTTPError [AbortError]: The user aborted a request.
    at RequestHandler.execute (/www/wwwroot/bot/node_modules/discord.js/src/rest/RequestHandler.js:201:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async RequestHandler.push (/www/wwwroot/bot/node_modules/discord.js/src/rest/RequestHandler.js:51:14)
    at async ApplicationCommandManager.fetch (/www/wwwroot/bot/node_modules/discord.js/src/managers/ApplicationCommandManager.js:97:18)
    at async module.exports (/www/wwwroot/bot/node_modules/discord-sync-commands/index.js:12:29) {
  code: 500,
  method: 'get',
  path: '/applications/905544503258120272/commands',
  requestData: { json: undefined, files: [] }
}

So I don’t know what to do, and there is no subject to help me with that.

Thank you,

Code sample



const Discord = require('discord.js');
const { SlashCommandBuilder } = require('@discordjs/builders');
const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { encode } = require('html-entities');

client.commands_slashs = new Discord.Collection();

const synchronizeSlashCommands = require('discord-sync-commands');

fs.readdir("./commands/slash/", (_err, files) => {
    files.forEach((file) => {
        if (!file.endsWith(".js")) return;
        let props = require(`./commands/slash/${file}`);
        let commandName = file.split(".")[0];
        client.commands_slashs.set(commandName, {
            name: commandName,
            ...props
        });
        console.log(`👌 Command loaded: ${commandName}`);
    });
    synchronizeSlashCommands(client, client.commands_slashs.map((c) => ({
        name: c.name,
        description: c.description,
        options: c.options,
        type: 'CHAT_INPUT'
    })), {
        debug: false,
        clientId: "905544503258120272"
    });
});

Package version

v13.6.0 latest

Node.js version

16.14.2

Operating system

Linux - Debian

Priority this issue should have

High (immediate attention needed)

Which partials do you have configured?

User, Channel, GuildMember, Message, Reaction, GuildScheduledEvent, ThreadMember

Which gateway intents are you subscribing to?

Guilds, GuildMembers, GuildEmojisAndStickers, GuildIntegrations, GuildWebhooks, GuildInvites, GuildVoiceStates, GuildPresences, GuildMessages, GuildMessageReactions

I have tested this issue on a development release

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
DevKilioZOfficielcommented, May 1, 2022

Discord has some issues with there slash commands atm.

Yes, and I’m not the only one, I see a lot of developers yelling against Discord and their crappy API.

And I’m not even talking about the new restrictions added

0reactions
DevKilioZOfficielcommented, May 2, 2022

This is not my server, on the contrary, many Bot discord developers via Slash have this problem. It’s a bug coming from Discord or Discord.js and not from the user. Especially since it’s the Discord API that says shit in the rendering, not the developer’s server, because otherwise it would be our server that would have said “timeout” or whatever.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gitlab returns error 500 when visiting Admin Area -> Settings ...
When visiting "Admin Area -> Settings -> Integrations -> Mattermost Slash Commands" gitlab returns error 500 instead of displaying the system ...
Read more >
slash commands result in `dispatch_failed` · Issue #579 - GitHub
Description I'm using a localtunnel type service to send commands to my bot But on sending /commands, I just get an error message...
Read more >
Enabling interactivity with Slash Commands - Slack API
By enabling Slash Commands, your app can be summoned by users from any conversation in Slack. What are Slash Commands? Getting Started with...
Read more >
Web API POST method returns HTTP/1.1 500 Internal Server ...
The Get method is working fine, just getting error in POST. I am using fidler to send post request : Response Header: HTTP/1.1...
Read more >
What is “HTTP 500 Internal Server Error” and How to Fix It?
The HTTP 500 error, in particular, indicates that the server encountered an unexpected condition that prevented it from fulfilling the request. In other...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found