发送不和谐“说”命令消息参数时遇到问题

时间:2021-04-14 01:10:49

标签: javascript discord.js arguments command

所以,我正在使用 discord.js 编写一个不和谐的机器人,并且我正在制作一个“说”命令。看了几个教程都不行,问了几个朋友,都一无所获。这是文件的代码:

const Discord = require('discord.js');

module.exports = {
    name: 'say',
    description: "Says message",

    async run (client, message, args) {


        if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send('?You dont have the permissions to do this command!?')
        if(!message.guild.me.hasPermission("MANAGE_MESSAGES")) return message.channel.send('?Sorry, it seems I dont have the permissions to do that command.?')


        if(!args[0]) return message.reply('please tell me what to say.');

        message.channel.send(`${args.join(" ")}`);
    }
}


有谁知道我怎样才能使它真正起作用?谢谢!

1 个答案:

答案 0 :(得分:-1)

我不确定,但可能是因为您没有在模块中包含参数。

module.exports = {
    name: 'say',
    description: "Says message",

    args: true,

参数:真实