Skip to content

Commit

Permalink
debranched msg filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Twiggeh committed Sep 1, 2020
1 parent c218228 commit 2b9196a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion utils/coach.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getDBCoach = async id => {
export const isCoachCmd = msg => {
let result = 1;
result &= !msg.author.bot;
result &= !(msg.channel.type !== 'dm');
result &= msg.channel.type === 'dm';

const userRoles = msg.client.guilds.cache.array()[0].members.cache.get(msg.author.id)
._roles;
Expand Down
9 changes: 8 additions & 1 deletion utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ export const sleep = async time => new Promise(resolve => setTimeout(resolve, ti

/** @param {Message} msg @returns {boolean} */
export const shouldHandleMsg = msg => {
let result = 1;
result &= !msg.author.bot;
result &= msg.attachments !== undefined;
result &= msg.channel.name === 'replays-1' || msg.channel.name === 'replays-2';
return result;
};

/**
* @param {MessageReaction} msgReact
*/
Expand Down Expand Up @@ -336,7 +343,7 @@ import {
missingDataError,
isSC2Replay,
} from '../messages.js';
import { User, Message, DMChannel } from 'discord.js';
import { User, Message, DMChannel, MessageReaction } from 'discord.js';
import { client } from '../app.js';
import { DATA_FLOW } from '../provider/dataFlow.js';
import { buildTicket } from './ticket.js';
Expand Down

0 comments on commit 2b9196a

Please sign in to comment.