Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
Why do I get the error 'Invalid interaction application command' when I use this Slash command in discord.js?

When I try do use this slash command it says 'Invalid interaction application command'. How do I fix this? I can show more code if needed.

const Command = require('../structures/command.js');
const config = require('../data/config.json');
const { MessageEmbed } = require('discord.js');
const Discord = require('discord.js');

module.exports = new Command({
    name: "ping",
    description: "Shows the ping of the bot.",
    type: "BOTH",
    slashCommandOptions: [],
    permission: "ADMINISTRATOR",

    async run(message, args, client) {
        if (message.author.id === config.dev) {
            // const pingEmbed = new MessageEmbed()
            //     .setTitle(`Bot Ping: ${client.ws.ping} ms`)
            //     .setAuthor('System')
            //     // .setFooter(`${client.ws.ping} ms`)
            //     .setColor('5FA6E0')

            const m = await message.reply(`Bot Ping: ${client.ws.ping} ms`);
            const msg = message instanceof Discord.CommandInteraction ? await message.fetchReply() : m;
            msg.edit(`Ping: ${client.ws.ping} ms\nMessage Ping: ${msg.createdTimestamp - message.createdTimestamp} ms`);
        } else {
            message.reply(`Must be a developer to use the command [${this.name}]`);
        }
    }

});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!