From 4cccbdda3496aad74bdb3b4b2ad746f4367b13d9 Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Thu, 23 Jul 2026 22:39:33 +0100 Subject: opti refactor --- .../discord-bot/source/utilities/notifyRoleByName.js | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 174bg/discord-bot/source/utilities/notifyRoleByName.js (limited to '174bg/discord-bot/source/utilities/notifyRoleByName.js') diff --git a/174bg/discord-bot/source/utilities/notifyRoleByName.js b/174bg/discord-bot/source/utilities/notifyRoleByName.js deleted file mode 100644 index 1b2b82a..0000000 --- a/174bg/discord-bot/source/utilities/notifyRoleByName.js +++ /dev/null @@ -1,19 +0,0 @@ -export default async (guild, roleName, message) => { - // get the role by name - const role = guild.roles.cache.find( - (role) => role.name.toLowerCase() === roleName.toLowerCase(), - ); - - if (!role) { - console.error(`Role "${roleName}" not found.`); - return; - } - - // get all members with the role - const membersWithRole = role.members; - - // send a DM to each member with the role - for (const member of membersWithRole.values()) { - await member.send(message); - } -}; -- cgit v1.2.3