diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-07-23 22:39:33 +0100 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-07-23 22:39:33 +0100 |
| commit | 4cccbdda3496aad74bdb3b4b2ad746f4367b13d9 (patch) | |
| tree | 38f8d27bee36eab2295dc5a2b044e6075bd20faf /174bg/discord-bot/source/utilities/notifyRoleByName.js | |
| parent | 2d7362b6fc73f4807f09f6f522fd2e1e2b306e04 (diff) | |
| download | unnamed-group-4cccbdda3496aad74bdb3b4b2ad746f4367b13d9.tar unnamed-group-4cccbdda3496aad74bdb3b4b2ad746f4367b13d9.tar.gz unnamed-group-4cccbdda3496aad74bdb3b4b2ad746f4367b13d9.tar.bz2 unnamed-group-4cccbdda3496aad74bdb3b4b2ad746f4367b13d9.tar.xz unnamed-group-4cccbdda3496aad74bdb3b4b2ad746f4367b13d9.zip | |
opti refactor
Diffstat (limited to '174bg/discord-bot/source/utilities/notifyRoleByName.js')
| -rw-r--r-- | 174bg/discord-bot/source/utilities/notifyRoleByName.js | 19 |
1 files changed, 0 insertions, 19 deletions
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); - } -}; |
