#ping.js is missing a required "data" or "execute" property

17 messages · Page 1 of 1 (latest)

heady gazelleBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
  • Marked as resolved by staff
knotty furnace
#
import { SlashCommandBuilder } from 'discord.js';

export const data = new SlashCommandBuilder()
    .setName('ping')
    .setDescription('Replies with Pong!');
export async function execute(interaction) {
    await interaction.reply('Pong!');
}```
I suppose its supposed to be converted into this
oak tundra
#

thats typescript so not really the guide but it means one or more commands are lacking properties

#

log them

mint lakeBOT
knotty furnace
#

@oak tundra That's what I've been using

oak tundra
#

the above code is ts though

#

regardless

#

log your commands

knotty furnace
mint lakeBOT
#

mdn console: log() static method
The console.log() static method outputs a message to the console. The message may be a single string (with optional substitution values), or it may be any one or more JavaScript objects.

knotty furnace
#

idk how to do that.

oak tundra
#

you should learn js first before making a discord bot, #rules 3 #resources