Skip to content

Commit

Permalink
Merge pull request #2 from SayakMukhopadhyay/quickfix
Browse files Browse the repository at this point in the history
Fix @here and @everyone mention triggering
  • Loading branch information
SayakMukhopadhyay authored Jul 17, 2017
2 parents 6971b1a + 73b8b30 commit 749f5c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/modules/discord/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ export class DiscordClient {
});

this.client.on("message", (message) => {
if (message.isMemberMentioned(this.client.user)) {
if (message.mentions.users.filterArray(user => {
if (user.id === this.client.user.id) {
return true;
} else {
return false;
}
}).length > 0) {
let messageString = message.content.replace(this.client.user.toString(), "").replace(/\s+/g, ' ').trim();
let messageArray = messageString.split(" ");
let command = messageArray[0].toLowerCase();
Expand Down

0 comments on commit 749f5c2

Please sign in to comment.