【发布时间】:2021-08-03 05:45:14
【问题描述】:
module.exports = {
name: "slowmode",
description: "Set the slowmode of a channel.",
execute(message, args, Discord) {
if(!message.member.hasPermission("ADMINISTRATOR")) {
return message.reply("You don't have enough perms to use this command!")
}
let duration = args[0]
if(isNaN(duration)) return message.reply("Please give the time in seconds.")
let reason = args.slice(1).join(" ")
if(!reason) return message.reply("Please specify a reason!")
const embed = new Discord.MessageEmbed()
.setTitle("SlowMode!")
.addFields(
{name: 'Mod', value: 'message.author.tag'},
{name: 'Reason', value: 'message.author.tag has set the slowmode to ${duration} because ${reason}'},
message.channel.sendEmbed(embed)
)
}
}
这是我的代码,每当我尝试发送嵌入时,我都会收到错误 ReferenceError: Cannot access 'embed' before initialization.
【问题讨论】:
标签: javascript node.js