From 98cf3c37116c29f68269ae90a341619f79832395 Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Sat, 9 Jun 2018 15:10:03 +0200 Subject: [PATCH] Fix --- index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 2d40891..99820f6 100644 --- a/index.js +++ b/index.js @@ -66,20 +66,20 @@ client.on('update', (msg) => { client.on("notification", (msg) => { if (msg.type !== "mention") return; - if (!admins.some((e) => { return e === msg.account.acct;})) return; - const status = striptags(msg.status.content); - if (!status.startsWith(client.me.acct)) return; + let full_acct = '@' + client.me.acct; + + if (!status.startsWith(full_acct) || !status.startsWith('@' + client.me.username)) return; - const args = stripped.slice(client.me.acct + 1).trim().split(/ +/); + const args = status.slice(client.me.acct.length + 1).trim().split(/ +/); const commandName = args.shift().toLowerCase(); //Check if command exists - if (!this.commands.has(commandName)) { + if (!commands.has(commandName)) { return; } - const command = this.commands.get(commandName); + const command = commands.get(commandName); //Check if command is disabled if (command.disabled === true) return; -- GitLab