fix(command): 🚸 make bot address regex (prefix) more lenient

Should also accept server commands now on address
This commit is contained in:
jay 2021-05-03 07:20:33 +05:00
parent 356f83e39b
commit cbb105fe49

View File

@ -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 })