Compare commits

..

No commits in common. 'cbb105fe49675c08c62cc33f1b41b747d99ef1cc' and '5b3804893b3ff6e71c1f277b93661b6ae107051b' have entirely different histories.

  1. 3
      lib/index.js
  2. 8
      lib/plugins/command.js

@ -120,8 +120,7 @@ bot.once("spawn", () => {
}
cfg.plugins = plugins
// cfg.botAddressPrefix = ${bot.username.substr(-2,2)}
cfg.botAddressRegex = new RegExp(`^${bot.username}:? (/|${cfg.botAddressPrefix}.+)`)
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 })

@ -27,12 +27,12 @@ function checkItemExists(name) {
}
const events = {
whisper: function command_whisper(username, _botusername, message, ...history) {
if ([bot.username, "me"].includes(username)) return // whisper back from server (afk msges, etc)
whisper: function command_whisper(username, message) {
if ([bot.username, "me"].includes(username)) return
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", _botusername, message)
console.info(username, "whispered", message)
}
}
, chat: command

Loading…
Cancel
Save