所以,我正在使用 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(" ")}`);
}
}
有谁知道我怎样才能使它真正起作用?谢谢!
答案 0 :(得分:-1)
我不确定,但可能是因为您没有在模块中包含参数。
module.exports = {
name: 'say',
description: "Says message",
args: true,
参数:真实