SlashCommandBuilder 不是构造函数

问题描述 投票:0回答:0
const { SlashCommandBuilder} = require('discord.js');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('smurf')
        .setDescription('Show time until smurf. 5 Minute warning will be executed as well.')
        .addStringOption(option =>
            option
                .setName('points')
                .setDescription('Points to win. Ex: 145,000')
                .setRequired(true))
        .addStringOption(option =>
            option
                .setName('current-score')
                .setDescription('Current score. Ex: 50,000')
        .setRequired(true))
  .addStringOption(option =>
            option
                .setName('point-gain')
                .setDescription('Point gain. Ex: 30')
        .setRequired(true))
};

module.exports = {
    async execute(interaction) {
        const points = interaction.options.getString('points');
        const cScore = interaction.options.getString('current-score');
    const pGain = interaction.options.getString('point-gain');

    },
};

那是我的代码。我不知道为什么当我做的一切都正确时它一直说它不是构造函数(根据 discordjs 指南)虽然我在 v13 上。那会有什么不同吗?

我把 SlashCommandBuilder 改成大写的 B 还是不行。我不知道为什么。

javascript discord.js slash
© www.soinside.com 2019 - 2024. All rights reserved.