【发布时间】:2021-07-09 01:27:58
【问题描述】:
所以,我正在使用 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(" ")}`);
}
}
有谁知道我怎样才能使它真正起作用?谢谢!
【问题讨论】:
-
另外,我还不太擅长 JS,以防你们中的任何人想知道我是如何让它不起作用的。
-
谢谢,但我遇到的问题是保存用户发送的消息并使用机器人发送该消息。抱歉没有那么具体。我现在解决这个问题。
-
您是否遇到任何错误?
-
如果不提供错误,很难知道出了什么问题。
-
你能告诉我们调用命令的代码吗?
标签: javascript discord.js arguments command