diff --git a/dist/src/builtin/loop.js b/dist/src/builtin/loop.js index fca16b7..f682c37 100644 --- a/dist/src/builtin/loop.js +++ b/dist/src/builtin/loop.js @@ -127,6 +127,7 @@ function init() { `--fast`, `--addr=${addy}` ]; + console.log("=> SPAWN", cmd, args); let childProcess = child_process_1.spawn(cmd, args); childProcess.stdout.on('data', function (data) { const stdout = data.toString(); diff --git a/dist/src/builtin/loop.js.map b/dist/src/builtin/loop.js.map index 140b04c..4c0c64b 100644 --- a/dist/src/builtin/loop.js.map +++ b/dist/src/builtin/loop.js.map @@ -1 +1 @@ -{"version":3,"file":"loop.js","sourceRoot":"","sources":["../../../src/builtin/loop.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAAoC;AACpC,4CAAgD;AAChD,iCAAiC;AACjC,6BAA4B;AAC5B,sCAAkC;AAClC,4CAAoC;AACpC,iDAAqC;AAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,IAAI,QAAQ,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AACrD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,IAAI,OAAO,GAAG,KAAK,CAAA;AAEnB,2CAA2C;AAE3C,SAAgB,IAAI;IAClB,IAAI,OAAO;QAAE,OAAM;IACnB,OAAO,GAAG,IAAI,CAAA;IAEd,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAA;IAClC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,iBAAW,CAAC,CAAA;IAE9B,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,CAAO,OAAuB,EAAE,EAAE;QAC7D,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,C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BAA+B;AAC/B,eAAe;AACf,kBAAkB;AAClB,cAAc;AACd,MAAM;AACN,IAAI"} \ No newline at end of file diff --git a/dist/src/network/intercept.js b/dist/src/network/intercept.js index 5068ff5..93bce1a 100644 --- a/dist/src/network/intercept.js +++ b/dist/src/network/intercept.js @@ -21,26 +21,31 @@ restrictions (be able to toggle, or dont show chat) // return bool whether to skip forwarding to tribe function isBotMsg(msg, sentByMe) { return __awaiter(this, void 0, void 0, function* () { + console.log('=> is bot msg'); const txt = msg.message && msg.message.content; const msgType = msg.type; if (msgType === constants_1.default.message_types.bot_res) { return false; // bot res msg type not for processing } + console.log('=> is bot msg 2'); const uuid = msg.chat && msg.chat.uuid; if (!uuid) return false; + console.log('=> is bot msg 3'); const chat = yield models_1.models.Chat.findOne({ where: { uuid } }); if (!chat) return false; let didEmit = false; + console.log('=> is bot msg 4'); if (txt && txt.startsWith('/bot ')) { builtin_1.builtinBotEmit(msg); didEmit = true; } if (didEmit) return didEmit; + console.log('=> is bot msg 5'); const botsInTribe = yield models_1.models.ChatBot.findAll({ where: { chatId: chat.id @@ -49,6 +54,7 @@ function isBotMsg(msg, sentByMe) { // console.log('=> botsInTribe', botsInTribe) if (!(botsInTribe && botsInTribe.length)) return false; + console.log('=> is bot msg 6'); yield asyncForEach(botsInTribe, (botInTribe) => __awaiter(this, void 0, void 0, function* () { if (botInTribe.msgTypes) { // console.log('=> botInTribe.msgTypes', botInTribe) @@ -58,6 +64,7 @@ function isBotMsg(msg, sentByMe) { const isMsgAndHasText = msgType === constants_1.default.message_types.message && txt && txt.startsWith(`${botInTribe.botPrefix} `); const isNotMsg = msgType !== constants_1.default.message_types.message; if (isMsgAndHasText || isNotMsg) { + console.log('=> is bot msg emitMessageToBot', msg, botInTribe.dataValues); didEmit = yield emitMessageToBot(msg, botInTribe.dataValues); } } @@ -66,6 +73,7 @@ function isBotMsg(msg, sentByMe) { } else { // no message types defined, do all? if (txt && txt.startsWith(`${botInTribe.botPrefix} `)) { + console.log('=> is bot msg emitMessageToBot2', msg, botInTribe.dataValues); // console.log('=> botInTribe.msgTypes else', botInTribe.dataValues) didEmit = yield emitMessageToBot(msg, botInTribe.dataValues); } diff --git a/dist/src/network/intercept.js.map b/dist/src/network/intercept.js.map index 106f57e..e4a83ba 100644 --- a/dist/src/network/intercept.js.map +++ b/dist/src/network/intercept.js.map @@ -1 +1 @@ -{"version":3,"file":"intercept.js","sourceRoot":"","sources":["../../../src/network/intercept.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sCAAkC;AAClC,wCAA2C;AAC3C,8CAAoE;AACpE,wCAAuC;AACvC,4CAAoC;AAEpC;;;EAGE;AAEF,kDAAkD;AAClD,SAAsB,QAAQ,CAAC,GAAQ,EAAE,QAAiB;;QACxD,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAA;QAE9C,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAA;QACxB,IAAI,OAAO,KAAK,mBAAS,CAAC,aAAa,CAAC,OAAO,EAAE;YAC/C,OAAO,KAAK,CAAA,CAAC,sCAAsC;SACpD;QACD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA;QACtC,IAAG,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QAEtB,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE,EAAC,IAAI,EAAC;SACd,CAAC,CAAA;QACF,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QAEvB,IAAI,OAAO,GAAG,KAAK,CAAA;QAEnB,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YAClC,wBAAc,CAAC,GAAG,CAAC,CAAA;YACnB,OAAO,GAAG,IAAI,CAAA;SACf;QACD,IAAI,OAAO;YAAE,OAAO,OAAO,CAAA;QAE3B,MAAM,WA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gB,CAAC,GAAG,EAAE,UAAU;;QAC7C,gEAAgE;QAChE,QAAQ,UAAU,CAAC,OAAO,EAAE;YAC1B,KAAK,mBAAS,CAAC,SAAS,CAAC,OAAO;gBAC9B,wBAAc,CAAC,GAAG,CAAC,CAAA;gBACnB,OAAO,IAAI,CAAA;YACb,KAAK,mBAAS,CAAC,SAAS,CAAC,KAAK;gBAC5B,MAAM,GAAG,GAAG,MAAM,eAAM,CAAC,GAAG,CAAC,OAAO,CAAC;oBACnC,KAAK,EAAE;wBACL,IAAI,EAAE,UAAU,CAAC,OAAO;qBACzB;iBACF,CAAC,CAAA;gBACF,OAAO,sBAAe,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC9D,KAAK,mBAAS,CAAC,SAAS,CAAC,MAAM;gBAC7B,OAAO,oBAAa,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;YACvC;gBACE,OAAO,KAAK,CAAA;SACf;IACH,CAAC;CAAA;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QACzC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACjD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC5C;IACH,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"intercept.js","sourceRoot":"","sources":["../../../src/network/intercept.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sCAAkC;AAClC,wCAA2C;AAC3C,8CAAoE;AACpE,wCAAuC;AACvC,4CAAoC;AAEpC;;;EAGE;AAEF,kDAAkD;AAClD,SAAsB,QAAQ,CAAC,GAAQ,EAAE,QAAiB;;QACxD,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QAC5B,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OA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,KAAK,mBAAS,CAAC,SAAS,CAAC,OAAO;gBAC9B,wBAAc,CAAC,GAAG,CAAC,CAAA;gBACnB,OAAO,IAAI,CAAA;YACb,KAAK,mBAAS,CAAC,SAAS,CAAC,KAAK;gBAC5B,MAAM,GAAG,GAAG,MAAM,eAAM,CAAC,GAAG,CAAC,OAAO,CAAC;oBACnC,KAAK,EAAE;wBACL,IAAI,EAAE,UAAU,CAAC,OAAO;qBACzB;iBACF,CAAC,CAAA;gBACF,OAAO,sBAAe,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAC9D,KAAK,mBAAS,CAAC,SAAS,CAAC,MAAM;gBAC7B,OAAO,oBAAa,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;YACvC;gBACE,OAAO,KAAK,CAAA;SACf;IACH,CAAC;CAAA;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QACzC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YACjD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC5C;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/src/builtin/loop.ts b/src/builtin/loop.ts index 2fa7a5c..2855741 100644 --- a/src/builtin/loop.ts +++ b/src/builtin/loop.ts @@ -123,6 +123,7 @@ export function init() { `--fast`, `--addr=${addy}` ] + console.log("=> SPAWN",cmd,args) let childProcess = spawn(cmd, args) childProcess.stdout.on('data', function (data) { const stdout = data.toString() diff --git a/src/network/intercept.ts b/src/network/intercept.ts index 0b1f121..ad6aa5c 100644 --- a/src/network/intercept.ts +++ b/src/network/intercept.ts @@ -12,15 +12,18 @@ restrictions (be able to toggle, or dont show chat) // return bool whether to skip forwarding to tribe export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise { + console.log('=> is bot msg') const txt = msg.message && msg.message.content const msgType = msg.type if (msgType === constants.message_types.bot_res) { return false // bot res msg type not for processing } + console.log('=> is bot msg 2') const uuid = msg.chat && msg.chat.uuid if(!uuid) return false + console.log('=> is bot msg 3') const chat = await models.Chat.findOne({ where: {uuid} }) @@ -28,12 +31,14 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise { let didEmit = false + console.log('=> is bot msg 4') if (txt && txt.startsWith('/bot ')) { builtinBotEmit(msg) didEmit = true } if (didEmit) return didEmit + console.log('=> is bot msg 5') const botsInTribe = await models.ChatBot.findAll({ where: { chatId: chat.id @@ -43,6 +48,7 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise { if (!(botsInTribe && botsInTribe.length)) return false + console.log('=> is bot msg 6') await asyncForEach(botsInTribe, async botInTribe => { if (botInTribe.msgTypes) { // console.log('=> botInTribe.msgTypes', botInTribe) @@ -52,12 +58,14 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise { const isMsgAndHasText = msgType === constants.message_types.message && txt && txt.startsWith(`${botInTribe.botPrefix} `) const isNotMsg = msgType !== constants.message_types.message if (isMsgAndHasText || isNotMsg) { + console.log('=> is bot msg emitMessageToBot',msg,botInTribe.dataValues) didEmit = await emitMessageToBot(msg, botInTribe.dataValues) } } } catch (e) { } } else { // no message types defined, do all? if (txt && txt.startsWith(`${botInTribe.botPrefix} `)) { + console.log('=> is bot msg emitMessageToBot2',msg,botInTribe.dataValues) // console.log('=> botInTribe.msgTypes else', botInTribe.dataValues) didEmit = await emitMessageToBot(msg, botInTribe.dataValues) }