feat(command): 🎨 make botaddress prefix and regex more flexible and configurable

This commit is contained in:
jay
2021-03-23 14:39:07 +05:00
parent a0ffaf1654
commit 0757776d8b
2 changed files with 12 additions and 6 deletions
+3 -1
View File
@@ -86,7 +86,9 @@ reloadplugin = (event, filename, pluginpath) => {
fs.watch('./lib/plugins', reloadplugin)
cfg.bot = bot
cfg.botAddress = new RegExp(`^${bot.username} (!.+)`)
// TODO better name, or switch to array
cfg.botAddressPrefix = '!'
cfg.botAddressRegex = new RegExp(`^${bot.username} (${cfg.botAddressPrefix}.+)`)
cfg.quiet = true