链接单独的JS文件(非HTML)

时间:2019-07-01 13:21:10

标签: javascript discord.js

我正在使用discord.js,但创建了2条!warn和!mute命令,控制台未显示任何错误,该bot处于联机状态,但是一旦我尝试执行其中一条命令,便不会发生任何事情。

这可能是因为文件未链接到主index.js

对此我是一个全新的人,只是按照教程学习,因此对您的帮助表示感谢。

https://pastebin.com/Mg5trYFW

const Discord = require("discord.js")

module.exports.run = async (bot, message, args) => {
// check if the command caller has permission to use the command
if (!message.member.hasPermissions("MANAGE_ROLES") || !message.guild.owner) return message.channel.send(":x: You do not have permission to use this command");

if (!message.guild.me.hasPermission(["MANAGE_ROLES", "ADMININISTRATOR"])) return message.channel.send(":x: I do not have permissions to add roles!")
//define the reason and mutee
let mutee = message.mentions.members.first() || message.guild.members.get(args[0]);
if (!mutee) return message.channel.send("Please supply a user to be muted!");

let reason = args.slice(1).join(" ");
if (!reason) reason = "No reason given"

0 个答案:

没有答案