#Unknown application

4 messages · Page 1 of 1 (latest)

storm vortex
#

When trying to register commands, i get hit with
DiscordAPIError[10002]: Unknown Application.
My application ID is valid, and i don't know what's going on
Here is my code:

const { SlashCommandBuilder, Routes } = require('discord.js');
const { REST } = require('@discordjs/rest');
const dotenv = require("dotenv")
dotenv.config();
const clientId = 938808677576618004;
const guildId = 941393934725300274;
const token = process.env.TOKEN;

const commands = [
  new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'),
  new SlashCommandBuilder().setName('server').setDescription('Replies with server info!'),
  new SlashCommandBuilder().setName('user').setDescription('Replies with user info!'),
]
  .map(command => command.toJSON());

const rest = new REST({ version: '10' }).setToken(token);

rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands })
  .then((data) => console.log(`Successfully registered ${data.length} application commands.`))
  .catch(console.error);
tardy quailBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

foggy vigil
#

It isn't valid, it needs to be a string

#

If it was valid, it wouldn't throw the error in the first place