fix(command): 🐛 fix bot address regex returning undefined
Waits till spawn to make sure `bot.username` is definitely initialized
This commit is contained in:
@@ -30,11 +30,10 @@ const events = {
|
||||
whisper: function command_whisper(username, message) {
|
||||
if ([bot.username, "me"].includes(username)) return
|
||||
if (/^gossip/.test(message)) return
|
||||
// if (/^!/.test(message) && username === cfg.admin){
|
||||
if (username === cfg.admin) {
|
||||
message = message.replace("\\", "@")
|
||||
console.info("whispered command", message)
|
||||
if (/^!/.test(message)) {
|
||||
if (message.startsWith(cfg.botAddressPrefix)) {
|
||||
command(username, message)
|
||||
} else {
|
||||
bot.chat(message)
|
||||
|
Reference in New Issue
Block a user