From 73b8b30e9d5bb8bf98b624e7d69b586d3999c4d4 Mon Sep 17 00:00:00 2001 From: Sayak Mukhopadhyay Date: Mon, 17 Jul 2017 21:43:15 +0530 Subject: [PATCH] Fix @here and @everyone mention triggering --- src/modules/discord/client.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/modules/discord/client.ts b/src/modules/discord/client.ts index 2dacbb8..ed48189 100644 --- a/src/modules/discord/client.ts +++ b/src/modules/discord/client.ts @@ -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();