const { RichEmbed } = require("discord.js");
const { stripIndents } = require("common-tags");
module.exports = {
name: "report",
category: "moderation",
description: "Reports a member",
usage: "<mention, id>",
run: async (client, message, args) => {
if (message.deletable) message.delete();
let rMember = message.mentions.members.first() || message.guild.members.get(args[0]);
if (!rMember)
return message.reply("Couldn't find that person?").then(m => m.delete(5000));
if (rMember.hasPermission("BAN_MEMBERS") || rMember.user.bot)
return message.channel.send("Can't report that member").then(m => m.delete(5000));
if (!args[1])
return message.channel.send("Please provide a reason for the Arrest").then(m => m.delete(5000));
const channel = message.guild.channels.find(c => c.name === "arrest-log")
if (!channel)
return message.channel.send("Couldn't find a `#arrest-log` channel").then(m => m.delete(5000));
const embed = new RichEmbed()
.setColor("#ff0000")
.setTimestamp()
.setFooter(message.guild.name, message.guild.iconURL)
.setAuthor("Arrest Log", rMember.user.displayAvatarURL )
.setDescription(stripIndents`**> User:** ${rMember}
**> Arrested by:** ${message.member}
**> Reason:** ${args.slice(1).join("")}`);
return channel.send(embed);
}
}
答案 0 :(得分:0)
只需添加更多选项。添加一个选项以按名称查找,然后按名称过滤成员列表。也可以添加按ID查找选项,然后按ID过滤成员列表。