Browse Source

log

push-params
Evan Feenstra 4 years ago
parent
commit
60ad575bbb
  1. 2
      api/network/intercept.ts
  2. 1
      dist/api/bots/index.js
  3. 2
      dist/api/bots/index.js.map
  4. 2
      dist/api/controllers/bots.js
  5. 2
      dist/api/controllers/bots.js.map
  6. 2
      dist/api/network/intercept.js
  7. 2
      dist/api/network/intercept.js.map

2
api/network/intercept.ts

@ -8,12 +8,14 @@ import { models } from '../models'
// return bool whether to skip forwarding to tribe
export async function isBotMsg(msg:Msg, sentByMe:boolean): Promise<boolean> {
console.log("==> is bot msg???")
const txt = msg.message.content
const chat = await models.Chat.findOne({where:{
uuid: msg.chat.uuid
}})
if(!chat) return false
console.log("==> is bot msg txt",txt)
if(txt.startsWith('/bot ')) {
const ok = processBotMessage(msg, chat, null)
return ok?true:false

1
dist/api/bots/index.js

@ -12,6 +12,7 @@ function emit(txt, chatUUID) {
if (arr.length < 2)
return false;
// const cmd = arr[1]
console.log('===> EMIT BOT MSG', { content: txt, chatUUID });
Sphinx.EE.emit('message', { content: txt, chatUUID });
// switch(cmd) {
// case 'install':

2
dist/api/bots/index.js.map

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/bots/index.ts"],"names":[],"mappings":";;AAAA,qCAAoC;AACpC,sCAAqC;AAqBnB,8BAAS;AAnB3B,SAAS,IAAI;IACT,SAAS,CAAC,IAAI,EAAE,CAAA;AACpB,CAAC;AAiBO,oBAAI;AAfZ,SAAS,IAAI,CAAC,GAAG,EAAE,QAAQ;IACvB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC1B,IAAG,GAAG,CAAC,MAAM,GAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAC7B,qBAAqB;IACrB,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAC,EAAC,OAAO,EAAC,GAAG,EAAC,QAAQ,EAAC,CAAC,CAAA;IAChD,gBAAgB;IAChB,oBAAoB;IACpB,oCAAoC;IACpC,wCAAwC;IACxC,kBAAkB;IAClB,aAAa;IACb,6CAA6C;IAC7C,KAAK;AACT,CAAC;AAEY,oBAAI"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/bots/index.ts"],"names":[],"mappings":";;AAAA,qCAAoC;AACpC,sCAAqC;AAsBnB,8BAAS;AApB3B,SAAS,IAAI;IACT,SAAS,CAAC,IAAI,EAAE,CAAA;AACpB,CAAC;AAkBO,oBAAI;AAhBZ,SAAS,IAAI,CAAC,GAAG,EAAE,QAAQ;IACvB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC1B,IAAG,GAAG,CAAC,MAAM,GAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAC7B,qBAAqB;IACrB,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAC,EAAC,OAAO,EAAC,GAAG,EAAC,QAAQ,EAAC,CAAC,CAAA;IACvD,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAC,EAAC,OAAO,EAAC,GAAG,EAAC,QAAQ,EAAC,CAAC,CAAA;IAChD,gBAAgB;IAChB,oBAAoB;IACpB,oCAAoC;IACpC,wCAAwC;IACxC,kBAAkB;IAClB,aAAa;IACb,6CAA6C;IAC7C,KAAK;AACT,CAAC;AAEY,oBAAI"}

2
dist/api/controllers/bots.js

@ -68,7 +68,9 @@ exports.deleteBot = (req, res) => __awaiter(void 0, void 0, void 0, function* ()
// return bool whether this is legit to process
function processBotMessage(msg, chat, botInTribe) {
return __awaiter(this, void 0, void 0, function* () {
console.log('===> PROCESS BOT MSG');
const txt = msg.message.content;
console.log('===> txt', txt);
if (txt.startsWith('/bot ')) {
bots_1.emit(txt, chat.uuid);
}

2
dist/api/controllers/bots.js.map

@ -1 +1 @@
{"version":3,"file":"bots.js","sourceRoot":"","sources":["../../../api/controllers/bots.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAE5B,0CAAyC;AACzC,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ether 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.content;
const chat = yield models_1.models.Chat.findOne({ where: {
uuid: msg.chat.uuid
} });
if (!chat)
return false;
console.log("==> is bot msg txt", txt);
if (txt.startsWith('/bot ')) {
const ok = bots_1.processBotMessage(msg, chat, null);
return ok ? true : false;

2
dist/api/network/intercept.js.map

@ -1 +1 @@
{"version":3,"file":"intercept.js","sourceRoot":"","sources":["../../../api/network/intercept.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,8CAAqD;AAErD,sCAAkC;AAElC,4BAA4B;AAC5B,uBAAuB;AACvB,IAAI;AAEJ,kDAAkD;AAClD,SAAsB,QAAQ,CAAC,GAAO,EAAE,QAAgB;;QACtD,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAA;QAC/B,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC;gBAC5C,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI;aACpB,EAAC,CAAC,CAAA;QACH,IAAG,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QAEtB,IAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YAC1B,MAAM,EAAE,GAAG,wBAAiB,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;YAC7C,OAAO,EAAE,CAAA,CAAC,CAAA,IAAI,CAAA,CAAC,CAAA,KAAK,CAAA;SACrB;QAED,MAAM,WAAW,GAAG,MAAM,eAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC;gBACzD,GAAG,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;aAC1B,EAAC,CAAC,CAAA;QACH,IAAG,CAAC,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC;YAAE,OAAO,KAAK,CAAA;QAErD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