Skip to content

Missing Application ID #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cablethewizard opened this issue Sep 25, 2024 · 1 comment
Open

Missing Application ID #122

cablethewizard opened this issue Sep 25, 2024 · 1 comment

Comments

@cablethewizard
Copy link

When attempting to set a command using the discordCommandManager node, I receive the following response from the Discord API

DiscordAPIError[50035]: Invalid Form Body
application_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.

The following node setup is used to attempt to set the command.

[
    {
        "id": "bfd2ebc4b35ef7bc",
        "type": "debug",
        "z": "4527d3913f0dc485",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 640,
        "y": 200,
        "wires": []
    },
    {
        "id": "d4b6205d1c2f64a4",
        "type": "discordCommandManager",
        "z": "4527d3913f0dc485",
        "name": "Send Commmands to Discord",
        "guild": "",
        "token": "",
        "x": 710,
        "y": 340,
        "wires": [
            [
                "bfd2ebc4b35ef7bc"
            ]
        ]
    },
    {
        "id": "4f04c316eb435bba",
        "type": "function",
        "z": "4527d3913f0dc485",
        "name": "Set Commands",
        "func": "msg.action = \"set\";\nmsg.command =  {\n    name: \"fetchfashion\",\n    description: \"Gets latest Fashion Report\"\n};\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 420,
        "y": 340,
        "wires": [
            [
                "d4b6205d1c2f64a4",
                "bfd2ebc4b35ef7bc"
            ]
        ]
    },
    {
        "id": "cb51d48a1360a362",
        "type": "inject",
        "z": "4527d3913f0dc485",
        "name": "Run Once On Deploy",
        "props": [],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "x": 120,
        "y": 340,
        "wires": [
            [
                "4f04c316eb435bba",
                "c469036eb3a1a8ef",
                "bfd2ebc4b35ef7bc"
            ]
        ]
    }
]

As best I can tell, there is no issue with the bot token, as I am able to send & receive messages in other flows using package. I'm not really sure what to do at this point.

@tryy3
Copy link

tryy3 commented Mar 9, 2025

I ran into similar issues when I tried testing both slash commands and context menu commands.
Where I sometimes got it working and more then often got the same error as you DiscordAPIError[50035]: Invalid Form Body application_id[NUMBER_TYPE_COERCE]: Value "undefined" is not snowflake.

Occasionally I managed to get simple slash commands working with the CommandManager but I did find this example in the repo https://github.com/Markoudstaal/node-red-contrib-discord-advanced/blob/main/examples/creatingCommands.json which seems to work better.

From some googling and quick research it looks like the error is complaining about the discord bot's client_id is not being sent. Maybe discord.js or discord API have updated and now requires a client_id being sent which the CommandManager node doesn't provide.

I haven't looked any further but thought I would share how I got commands to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants