From 356f83e39bc7cf0075aa846ef0e94bf52e2e7ed8 Mon Sep 17 00:00:00 2001 From: jay Date: Mon, 3 May 2021 07:14:45 +0500 Subject: [PATCH] fix(command): :alien: fix `whisper` event api change with an extra parameter Whisper also now includes who it was whispered to --- lib/plugins/command.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/plugins/command.js b/lib/plugins/command.js index 111c2e1..30c4d54 100644 --- a/lib/plugins/command.js +++ b/lib/plugins/command.js @@ -27,12 +27,12 @@ function checkItemExists(name) { } const events = { - whisper: function command_whisper(username, message) { - if ([bot.username, "me"].includes(username)) return + whisper: function command_whisper(username, _botusername, message, ...history) { + if ([bot.username, "me"].includes(username)) return // whisper back from server (afk msges, etc) if (/^gossip/.test(message)) return if (username === cfg.admin) { + console.info("whispered command", _botusername, message) message = message.replace("\\", "@") - console.info("whispered command", message) if (message.startsWith(cfg.botAddressPrefix)) { command(username, message) } else { @@ -41,7 +41,7 @@ const events = { } } else { bot.whisper(cfg.admin, `gossip ${username}: ${message}`) - console.info(username, "whispered", message) + console.info(username, "whispered", _botusername, message) } } , chat: command