/home/container/node_modules/discord.js/src/structures/CommandInteractionOptionResolver.js:112 throw new TypeError('COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND'); ^ TypeError [COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND]: No subcommand specified for interaction. at CommandInteractionOptionResolver.getSubcommand (/home/container/node_modules/discord.js/src/structures/CommandInteractionOptionResolver.js:112:13) at Client. (/home/container/index.js:302:32) at Client.emit (node:events:394:28) at InteractionCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/InteractionCreate.js:66:12) at Object.module.exports [as INTERACTION_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36) at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:345:31) at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:443:22) at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:300:10) at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16) at WebSocket.emit (node:events:394:28) { [Symbol(code)]: 'COMMAND_INTERACTION_OPTION_NO_SUB_COMMAND' } if (interaction.options.getSubcommand() === 'user') { const user = interaction.options.getUser('target'); if (user) { await interaction.reply(`Username: ${user.username}\nID: ${user.id}`); let user = interaction.member; const roles = interaction.member.roles.cache.map(role => role); let roleStuff = [] roles.forEach(role => { roleStuff.push(role.id); }); const embed = new Discord.MessageEmbed() .setColor("ff2445") .setThumbnail(user.user.avatarURL()) .setTitle(`${user.tag}`) .addField("ID:", `\`${user.id}\``, true) .addField("Nickname:", `${user.nickname !== null ? `${user.nickname}` : '`None`'}`, true) .addField("Status:", `\`${user.presence}\``, true) .addField("In Server", `\`${user.guild.name}\``, true) .addField("Bot:", `\`${user.user.bot}\``, true) .addField("Joined The Server On:", `\`${user.joinedAt}\``, true) .addField("Account Created On:", `\`${user.user.createdAt}\``, true) .addField("Roles:", user.roles.cache.map(roles => `${roles}`).join(', '), true) await interaction.reply( {embeds: [embed]} ); } else { await interaction.reply(`Your username: ${interaction.user.username}\nYour ID: ${interaction.user.id}`); } // When registering a new slash command, open a PowerShell window locally (on computer not Ptero panel) // and do node deploy-commands.js. const { SlashCommandBuilder } = require('@discordjs/builders'); const { REST } = require('@discordjs/rest'); const { Routes } = require('discord-api-types/v9'); const { clientId, guildId, token } = require('./config.json'); const commands = [ new SlashCommandBuilder().setName('ping').setDescription('Replies with pong!'), new SlashCommandBuilder().setName('server').setDescription('Replies with server info!'), new SlashCommandBuilder().setName('user').setDescription('Gets user\'s info').addUserOption(option => option.setName('mentionable').setDescription('User stuff')), ] .map(command => command.toJSON()); const rest = new REST({ version: '9' }).setToken(token); rest.put(Routes.applicationGuildCommands(clientId, guildId), { body: commands }) .then(() => console.log('Successfully registered application commands.')) .catch(console.error);