diff --git a/api/network/intercept.ts b/api/network/intercept.ts index ea4fd75..30b8ff1 100644 --- a/api/network/intercept.ts +++ b/api/network/intercept.ts @@ -39,10 +39,6 @@ export async function isBotMsg(msg:Msg, sentByMe:boolean): Promise { await asyncForEach(botsInTribe, async botInTribe=>{ console.log('botInTribe.botPrefix',botInTribe.botPrefix) - if(txt.startsWith(`${botInTribe.botPrefix} `)){ - builtinBotEmit(msg) - didEmit = true - } if(botInTribe.msgTypes){ try { const msgTypes = JSON.parse(botInTribe.msgTypes) @@ -51,6 +47,9 @@ export async function isBotMsg(msg:Msg, sentByMe:boolean): Promise { didEmit = true } } catch(e){} + } else if(txt.startsWith(`${botInTribe.botPrefix} `)){ + builtinBotEmit(msg) + didEmit = true } }) diff --git a/dist/api/network/intercept.js b/dist/api/network/intercept.js index 8f562b7..ac45be8 100644 --- a/dist/api/network/intercept.js +++ b/dist/api/network/intercept.js @@ -44,10 +44,6 @@ function isBotMsg(msg, sentByMe) { return false; yield asyncForEach(botsInTribe, (botInTribe) => __awaiter(this, void 0, void 0, function* () { console.log('botInTribe.botPrefix', botInTribe.botPrefix); - if (txt.startsWith(`${botInTribe.botPrefix} `)) { - bots_1.builtinBotEmit(msg); - didEmit = true; - } if (botInTribe.msgTypes) { try { const msgTypes = JSON.parse(botInTribe.msgTypes); @@ -58,6 +54,10 @@ function isBotMsg(msg, sentByMe) { } catch (e) { } } + else if (txt.startsWith(`${botInTribe.botPrefix} `)) { + bots_1.builtinBotEmit(msg); + didEmit = true; + } })); return didEmit; }); diff --git a/dist/api/network/intercept.js.map b/dist/api/network/intercept.js.map index ce1c2fd..aacd44f 100644 --- a/dist/api/network/intercept.js.map +++ b/dist/api/network/intercept.js.map @@ -1 +1 @@ -{"version":3,"file":"intercept.js","sourceRoot":"","sources":["../../../api/network/intercept.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sCAAkC;AAClC,kCAAsC;AAEtC,MAAM,eAAe,GAAG;IACtB,MAAM,CAAC,cAAc;CACtB,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