我需要 Discord.JS 的帮助命令

时间:2021-01-29 19:36:25

标签: javascript discord

我向您寻求帮助命令的帮助,因为这种情况与通过反应进行切换有关。这是目前代码的样子:

const { MessageEmbed, ReactionCollector } = require("discord.js");
const prefix = process.env.prefix;
module.exports = {
    name: 'help',
    aliases: [],
    run: async (bot, message, args) => {
        const begin = '⏮';
        const left = '⏪';
        const close = '❎';
        const right = '⏩';
        const end = '⏭';
        const firstEmbed = new MessageEmbed();
        firstEmbed.setTitle('List of commands');
        firstEmbed.addField(`General commands`, [
            `\`${prefix}about\` **»** show information about me`,
            `\`${prefix}avatar\` **»** show your or mentioned user's avatar, alias \`${prefix}userpic\``,
            `\`${prefix}channelinfo\` **»** show information about the channel, alias \`${prefix}channel\``,
            `\`${prefix}guildinfo\` **»** show information about the guild, alias \`${prefix}guild\``,
            `\`${prefix}userinfo\` **»** show your or mentined user's detailed information, alias \`${prefix}user\``
        ]);
        firstEmbed.setColor(0xff69b4);
        firstEmbed.setThumbnail(bot.user.displayAvatarURL({format: 'png', size: 2048, dynamic: false}));
        firstEmbed.setTimestamp();
        let editor = await message.channel.send(firstEmbed);
        editor.react(begin);
        editor.react(left);
        editor.react(close);
        editor.react(right);
        editor.react(end);
        const secondEmbed = new MessageEmbed();
        secondEmbed.setTitle('List of commands');
        secondEmbed.addField(`Fun commands`, [
            `\`${prefix}mc\` **»** simulates commands from the game Minecraft`,
            `\`${prefix}profile\` **»** show your or mentioned user's information about berries and fishes`,
            `\`${prefix}voice\` **»** I raise my voice`
        ]);
        secondEmbed.setColor(0xff69b4);
        secondEmbed.setThumbnail(bot.user.displayAvatarURL({format: 'png', size: 2048, dynamic: false}));
        secondEmbed.setTimestamp();
        const thirdEmbed = new MessageEmbed();
        thirdEmbed.setTitle('List of commands');
        thirdEmbed.addField(`Another commands`, [
            `\`${prefix}emojilist\` **»** I show my list of emojis`,
            `\`${prefix}emote\` **»** I send emoji in the chat with the specified name (if emoji exists)`,
            `\`${prefix}ping\` **»** I show your and my latency`
        ]);
        thirdEmbed.setColor(0xff69b4);
        thirdEmbed.setThumbnail(bot.user.displayAvatarURL({format: 'png', size: 2048, dynamic: false}));
        thirdEmbed.setTimestamp();
        const pages = [firstEmbed, secondEmbed, thirdEmbed];
        let page = 1;
    }
}

Discord.JS: 12.5.1! 我试着自己做,然后,当我意识到有问题时,我开始在互联网上寻找答案。我什至试过:

bot.on('messageReactionAdd', async (reaction, user) => {
  // code
});
结果,我能做的就是删除消息,但我无法在页面之间进行切换。我是编程新手,现在如果没有别人的帮助,即使任务很简单,也很难应付。

0 个答案:

没有答案