Skip to content

Commit

Permalink
Dont tell Dyno to not ping staff (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
tadhgboyle authored Nov 4, 2021
1 parent 076e0df commit 9edf0c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/no-ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ const STAFF_ROLES = process.env.DISCORD_STAFF_ROLES.split(',');

module.exports = client => {
client.on('message', async msg => {
// Ignore DMs, messages that don't mention anyone, and messages that are a reply.
// Ignore DMs, messages that don't mention anyone, messages that are a reply, and messages from bots.
if (msg.channel.type !== 'text') return;
if (msg.mentions.members.size === 0) return;
if (msg.reference !== null) return;
if (msg.member.user.bot) return;

const senderIsStaff = msg.member.roles.cache.some(
role => STAFF_ROLES.indexOf(role.name) !== -1
Expand Down

0 comments on commit 9edf0c0

Please sign in to comment.