Skip to content

Commit

Permalink
stop staff from getting banned for 20+ mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev authored Sep 2, 2023
1 parent 7f29c5e commit 71ad437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/discord/events/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const cap = require("../util/cap");

module.exports = async (client, message) => {
// Ban members which ping 20+ users
if (message.mentions.users.size >= 20) {
if (message.mentions.users.size >= 20 && !message.member.roles.cache.find((r) => r.id === "898041751099539497")) {
message.member.ban({ reason: "Suspected raid. Pinging more than 20 users." });
message.reply(`${message.member.toString()} has been banned for pinging more than 20 users`);

Expand Down Expand Up @@ -59,7 +59,7 @@ module.exports = async (client, message) => {
try {
const msg = await client.channels.cache.get(args[0]).send(cap(message.content.split(" ").slice(1).join(" "), 2000));
// message.react("<:Yes:768256004655677451>");
message.channel.send(`<:Yes:768256004655677451> The message has been sent\n${msg.url}`);
message.channel.send(`<:Yes:768256004655677451> Message sent\n${msg.url}`);
} catch(err) {
message.channel.send(`<:No:768256005426511912> An error occurred\n\`\`\`${err.message}\`\`\``);
}
Expand Down

0 comments on commit 71ad437

Please sign in to comment.