From cbb105fe49675c08c62cc33f1b41b747d99ef1cc Mon Sep 17 00:00:00 2001 From: jay Date: Mon, 3 May 2021 07:20:33 +0500 Subject: [PATCH] fix(command): :children_crossing: make bot address regex (prefix) more lenient Should also accept server commands now on address --- lib/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 94d9ff0..5b4cad4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -120,7 +120,8 @@ bot.once("spawn", () => { } cfg.plugins = plugins - cfg.botAddressRegex = new RegExp(`^${bot.username} (${cfg.botAddressPrefix}.+)`) + // cfg.botAddressPrefix = ${bot.username.substr(-2,2)} + cfg.botAddressRegex = new RegExp(`^${bot.username}:? (/|${cfg.botAddressPrefix}.+)`) // FIXME leaks every load, so adding here instead of command.js to load only once bot.addChatPattern("web", /\[WEB\] (\[.+\])?\s*([\w.]+): (.+)/, { parse: true })