2019-11-06 17:31:31 +00:00
|
|
|
exports.run = async (message, args) => {
|
2020-04-10 02:40:52 +00:00
|
|
|
if (!args[0].match(/^<?[@#]?[&!]?\d+>?$/) && args[0] < 21154535154122752) return `${message.author.mention}, that's not a valid snowflake!`;
|
2019-11-06 17:31:31 +00:00
|
|
|
try {
|
2020-04-10 02:40:52 +00:00
|
|
|
const id = args[0].replace("@", "").replace("#", "").replace("!", "").replace("&", "").replace("<", "").replace(">", "");
|
|
|
|
await message.channel.guild.banMember(id, 0, `Hackban command used by @${message.author.username}#${message.author.discriminator}`);
|
|
|
|
return `Successfully banned user with ID \`${id}\`.`;
|
2019-11-06 17:31:31 +00:00
|
|
|
} catch (e) {
|
2019-12-10 15:53:43 +00:00
|
|
|
throw e;
|
|
|
|
//return `${message.author.mention}, I was unable to ban the member. Have you given me permissions?`;
|
2019-11-06 17:31:31 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-12-02 20:47:22 +00:00
|
|
|
exports.aliases = ["prevent", "preban"];
|
|
|
|
exports.category = 2;
|
2019-12-05 16:58:46 +00:00
|
|
|
exports.help = "Bans a member via user id";
|
|
|
|
exports.params = "[id]";
|