Compare commits
2 Commits
5b3804893b
...
cbb105fe49
Author | SHA1 | Date | |
---|---|---|---|
|
cbb105fe49 | ||
|
356f83e39b |
|
@ -120,7 +120,8 @@ bot.once("spawn", () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.plugins = plugins
|
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
|
// FIXME leaks every load, so adding here instead of command.js to load only once
|
||||||
bot.addChatPattern("web", /\[WEB\] (\[.+\])?\s*([\w.]+): (.+)/, { parse: true })
|
bot.addChatPattern("web", /\[WEB\] (\[.+\])?\s*([\w.]+): (.+)/, { parse: true })
|
||||||
|
|
||||||
|
|
|
@ -27,12 +27,12 @@ function checkItemExists(name) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const events = {
|
const events = {
|
||||||
whisper: function command_whisper(username, message) {
|
whisper: function command_whisper(username, _botusername, message, ...history) {
|
||||||
if ([bot.username, "me"].includes(username)) return
|
if ([bot.username, "me"].includes(username)) return // whisper back from server (afk msges, etc)
|
||||||
if (/^gossip/.test(message)) return
|
if (/^gossip/.test(message)) return
|
||||||
if (username === cfg.admin) {
|
if (username === cfg.admin) {
|
||||||
|
console.info("whispered command", _botusername, message)
|
||||||
message = message.replace("\\", "@")
|
message = message.replace("\\", "@")
|
||||||
console.info("whispered command", message)
|
|
||||||
if (message.startsWith(cfg.botAddressPrefix)) {
|
if (message.startsWith(cfg.botAddressPrefix)) {
|
||||||
command(username, message)
|
command(username, message)
|
||||||
} else {
|
} else {
|
||||||
|
@ -41,7 +41,7 @@ const events = {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bot.whisper(cfg.admin, `gossip ${username}: ${message}`)
|
bot.whisper(cfg.admin, `gossip ${username}: ${message}`)
|
||||||
console.info(username, "whispered", message)
|
console.info(username, "whispered", _botusername, message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
, chat: command
|
, chat: command
|
||||||
|
|
Loading…
Reference in New Issue
Block a user