Temp Ban command discord.js



我尝试编写临时禁令命令。不幸的是,这个命令似乎不起作用,我不知道为什么。我没有得到任何错误代码,它就是不工作。


case 'tempban':
if(!message.member.permissions.has(Discord.Permissions.FLAGS.BAN_MEMBERS)) return;
const member = message.mentions.first()
if(!member) return;
let time = args[1]
if(!time) return;
let timer = ms(time)
message.channel.send('The User is banned')

await member.ban({reason: `User was banned by ${message.author.tag} for ${time}` })
await setTimeout(async function () {
await message.guild.members.unban(member.id)
}, timer)

break;

尝试删除setTimeout和…

member.ban({ days: days, reason: reason });

相关内容

  • 没有找到相关文章

最新更新