【发布时间】:2020-08-24 04:32:31
【问题描述】:
我正在尝试使用角色发出静音命令,但我不断收到错误消息,指出删除角色不是函数。我很困惑
let mainrole = message.guild.roles.cache.find(role => role.name === "Verified");
let role = message.guild.roles.cache.find(role => role.name === "Muted");
if (!role) return message.reply("Sorry! Couldn't find the mute role.")
let time = args[2];
if (!time) {
return message.reply("You didnt specify a time!");
}
person.removeRole(mainrole.id)
person.addRole(role.id);
message.channel.send(`@${person.user.tag} has now been muted for ${ms(ms(time))}`)
setTimeout(function() {
person.addRole(mainrole.id)
person.removeRole(role.id);
错误:TypeError: person.removeRole is not a function
【问题讨论】:
标签: discord.js