Browse Source

logs

dependabot/npm_and_yarn/ini-1.3.7
Evan Feenstra 4 years ago
parent
commit
a51164f36b
  1. 1
      dist/src/builtin/loop.js
  2. 2
      dist/src/builtin/loop.js.map
  3. 8
      dist/src/network/intercept.js
  4. 2
      dist/src/network/intercept.js.map
  5. 1
      src/builtin/loop.ts
  6. 8
      src/network/intercept.ts

1
dist/src/builtin/loop.js

@ -127,6 +127,7 @@ function init() {
`--fast`, `--fast`,
`--addr=${addy}` `--addr=${addy}`
]; ];
console.log("=> SPAWN", cmd, args);
let childProcess = child_process_1.spawn(cmd, args); let childProcess = child_process_1.spawn(cmd, args);
childProcess.stdout.on('data', function (data) { childProcess.stdout.on('data', function (data) {
const stdout = data.toString(); const stdout = data.toString();

2
dist/src/builtin/loop.js.map

File diff suppressed because one or more lines are too long

8
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 // return bool whether to skip forwarding to tribe
function isBotMsg(msg, sentByMe) { function isBotMsg(msg, sentByMe) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
console.log('=> is bot msg');
const txt = msg.message && msg.message.content; const txt = msg.message && msg.message.content;
const msgType = msg.type; const msgType = msg.type;
if (msgType === constants_1.default.message_types.bot_res) { if (msgType === constants_1.default.message_types.bot_res) {
return false; // bot res msg type not for processing return false; // bot res msg type not for processing
} }
console.log('=> is bot msg 2');
const uuid = msg.chat && msg.chat.uuid; const uuid = msg.chat && msg.chat.uuid;
if (!uuid) if (!uuid)
return false; return false;
console.log('=> is bot msg 3');
const chat = yield models_1.models.Chat.findOne({ const chat = yield models_1.models.Chat.findOne({
where: { uuid } where: { uuid }
}); });
if (!chat) if (!chat)
return false; return false;
let didEmit = false; let didEmit = false;
console.log('=> is bot msg 4');
if (txt && txt.startsWith('/bot ')) { if (txt && txt.startsWith('/bot ')) {
builtin_1.builtinBotEmit(msg); builtin_1.builtinBotEmit(msg);
didEmit = true; didEmit = true;
} }
if (didEmit) if (didEmit)
return didEmit; return didEmit;
console.log('=> is bot msg 5');
const botsInTribe = yield models_1.models.ChatBot.findAll({ const botsInTribe = yield models_1.models.ChatBot.findAll({
where: { where: {
chatId: chat.id chatId: chat.id
@ -49,6 +54,7 @@ function isBotMsg(msg, sentByMe) {
// console.log('=> botsInTribe', botsInTribe) // console.log('=> botsInTribe', botsInTribe)
if (!(botsInTribe && botsInTribe.length)) if (!(botsInTribe && botsInTribe.length))
return false; return false;
console.log('=> is bot msg 6');
yield asyncForEach(botsInTribe, (botInTribe) => __awaiter(this, void 0, void 0, function* () { yield asyncForEach(botsInTribe, (botInTribe) => __awaiter(this, void 0, void 0, function* () {
if (botInTribe.msgTypes) { if (botInTribe.msgTypes) {
// console.log('=> botInTribe.msgTypes', botInTribe) // 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 isMsgAndHasText = msgType === constants_1.default.message_types.message && txt && txt.startsWith(`${botInTribe.botPrefix} `);
const isNotMsg = msgType !== constants_1.default.message_types.message; const isNotMsg = msgType !== constants_1.default.message_types.message;
if (isMsgAndHasText || isNotMsg) { if (isMsgAndHasText || isNotMsg) {
console.log('=> is bot msg emitMessageToBot', msg, botInTribe.dataValues);
didEmit = yield 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? else { // no message types defined, do all?
if (txt && txt.startsWith(`${botInTribe.botPrefix} `)) { if (txt && txt.startsWith(`${botInTribe.botPrefix} `)) {
console.log('=> is bot msg emitMessageToBot2', msg, botInTribe.dataValues);
// console.log('=> botInTribe.msgTypes else', botInTribe.dataValues) // console.log('=> botInTribe.msgTypes else', botInTribe.dataValues)
didEmit = yield emitMessageToBot(msg, botInTribe.dataValues); didEmit = yield emitMessageToBot(msg, botInTribe.dataValues);
} }

2
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,WAAW,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YAC/C,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI,CAAC,EAAE;aAChB;SACF,CAAC,CAAA;QACF,6CAA6C;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AAM,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"}

1
src/builtin/loop.ts

@ -123,6 +123,7 @@ export function init() {
`--fast`, `--fast`,
`--addr=${addy}` `--addr=${addy}`
] ]
console.log("=> SPAWN",cmd,args)
let childProcess = spawn(cmd, args) let childProcess = spawn(cmd, args)
childProcess.stdout.on('data', function (data) { childProcess.stdout.on('data', function (data) {
const stdout = data.toString() const stdout = data.toString()

8
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 // return bool whether to skip forwarding to tribe
export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise<boolean> { export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise<boolean> {
console.log('=> is bot msg')
const txt = msg.message && msg.message.content const txt = msg.message && msg.message.content
const msgType = msg.type const msgType = msg.type
if (msgType === constants.message_types.bot_res) { if (msgType === constants.message_types.bot_res) {
return false // bot res msg type not for processing return false // bot res msg type not for processing
} }
console.log('=> is bot msg 2')
const uuid = msg.chat && msg.chat.uuid const uuid = msg.chat && msg.chat.uuid
if(!uuid) return false if(!uuid) return false
console.log('=> is bot msg 3')
const chat = await models.Chat.findOne({ const chat = await models.Chat.findOne({
where: {uuid} where: {uuid}
}) })
@ -28,12 +31,14 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise<boolean> {
let didEmit = false let didEmit = false
console.log('=> is bot msg 4')
if (txt && txt.startsWith('/bot ')) { if (txt && txt.startsWith('/bot ')) {
builtinBotEmit(msg) builtinBotEmit(msg)
didEmit = true didEmit = true
} }
if (didEmit) return didEmit if (didEmit) return didEmit
console.log('=> is bot msg 5')
const botsInTribe = await models.ChatBot.findAll({ const botsInTribe = await models.ChatBot.findAll({
where: { where: {
chatId: chat.id chatId: chat.id
@ -43,6 +48,7 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise<boolean> {
if (!(botsInTribe && botsInTribe.length)) return false if (!(botsInTribe && botsInTribe.length)) return false
console.log('=> is bot msg 6')
await asyncForEach(botsInTribe, async botInTribe => { await asyncForEach(botsInTribe, async botInTribe => {
if (botInTribe.msgTypes) { if (botInTribe.msgTypes) {
// console.log('=> botInTribe.msgTypes', botInTribe) // console.log('=> botInTribe.msgTypes', botInTribe)
@ -52,12 +58,14 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise<boolean> {
const isMsgAndHasText = msgType === constants.message_types.message && txt && txt.startsWith(`${botInTribe.botPrefix} `) const isMsgAndHasText = msgType === constants.message_types.message && txt && txt.startsWith(`${botInTribe.botPrefix} `)
const isNotMsg = msgType !== constants.message_types.message const isNotMsg = msgType !== constants.message_types.message
if (isMsgAndHasText || isNotMsg) { if (isMsgAndHasText || isNotMsg) {
console.log('=> is bot msg emitMessageToBot',msg,botInTribe.dataValues)
didEmit = await emitMessageToBot(msg, botInTribe.dataValues) didEmit = await emitMessageToBot(msg, botInTribe.dataValues)
} }
} }
} catch (e) { } } catch (e) { }
} else { // no message types defined, do all? } else { // no message types defined, do all?
if (txt && txt.startsWith(`${botInTribe.botPrefix} `)) { if (txt && txt.startsWith(`${botInTribe.botPrefix} `)) {
console.log('=> is bot msg emitMessageToBot2',msg,botInTribe.dataValues)
// console.log('=> botInTribe.msgTypes else', botInTribe.dataValues) // console.log('=> botInTribe.msgTypes else', botInTribe.dataValues)
didEmit = await emitMessageToBot(msg, botInTribe.dataValues) didEmit = await emitMessageToBot(msg, botInTribe.dataValues)
} }

Loading…
Cancel
Save