From bd59a916bc590db2ecdde9d7f275be90ab155f3b Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 14:47:18 -0800 Subject: [PATCH 01/10] exec loopbot in child process --- dist/src/builtin/loop.js | 173 +++++++++++++++++------------ dist/src/builtin/loop.js.map | 2 +- src/builtin/loop.ts | 204 +++++++++++++++++++++-------------- 3 files changed, 231 insertions(+), 148 deletions(-) diff --git a/dist/src/builtin/loop.js b/dist/src/builtin/loop.js index 2c38eb7..3b61ed6 100644 --- a/dist/src/builtin/loop.js +++ b/dist/src/builtin/loop.js @@ -11,14 +11,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); const Sphinx = require("sphinx-bot"); const api_1 = require("../controllers/api"); -const node_fetch_1 = require("node-fetch"); +// import fetch from 'node-fetch' const path = require("path"); const models_1 = require("../models"); const constants_1 = require("../constants"); +const child_process_1 = require("child_process"); +const env = process.env.NODE_ENV || 'development'; +const config = require(path.join(__dirname, '../../config/app.json'))[env]; var validate = require('bitcoin-address-validation'); const msg_types = Sphinx.MSG_TYPE; let initted = false; -const baseurl = 'https://localhost:8080'; +// const baseurl = 'https://localhost:8080' function init() { if (initted) return; @@ -56,12 +59,53 @@ function init() { message.channel.send({ embed }); return; } + // try { + // const j = await doRequest(baseurl + '/v1/loop/out/quote/' + amt) + // console.log("=> LOOP QUOTE RES", j) + // if (!(j && j.swap_fee_sat && j.prepay_amt_sat)) { + // return + // } + // let chan + // const bot = await getBot(message.channel.id) + // if (bot && bot.meta) chan = bot.meta + // if (!chan) { + // const embed = new Sphinx.MessageEmbed() + // .setAuthor('LoopBot') + // .setDescription('No channel set') + // message.channel.send({ embed }) + // return + // } + // const j2 = await doRequest(baseurl + '/v1/loop/out', { + // method: 'POST', + // body: JSON.stringify({ + // amt: amt, + // dest: addy, + // outgoing_chan_set: [chan], + // max_swap_fee: j.swap_fee_sat, + // max_prepay_amt: j.prepay_amt_sat + // }), + // }) + // console.log("=> LOOP RESPONSE", j2) + // if (j2 && j2.error) { + // const embed = new Sphinx.MessageEmbed() + // .setAuthor('LoopBot') + // .setDescription('Error: ' + j2.error) + // message.channel.send({ embed }) + // return + // } + // // if (!(j2 && j2.server_message)) { + // // return + // // } + // const embed = new Sphinx.MessageEmbed() + // .setAuthor('LoopBot') + // .setTitle('Payment was sent!') + // // .setDescription('Success!') + // message.channel.send({ embed }) + // return + // } catch (e) { + // console.log('LoopBot error', e) + // } try { - const j = yield doRequest(baseurl + '/v1/loop/out/quote/' + amt); - console.log("=> LOOP QUOTE RES", j); - if (!(j && j.swap_fee_sat && j.prepay_amt_sat)) { - return; - } let chan; const bot = yield getBot(message.channel.id); if (bot && bot.meta) @@ -73,33 +117,27 @@ function init() { message.channel.send({ embed }); return; } - const j2 = yield doRequest(baseurl + '/v1/loop/out', { - method: 'POST', - body: JSON.stringify({ - amt: amt, - dest: addy, - outgoing_chan_set: [chan], - max_swap_fee: j.swap_fee_sat, - max_prepay_amt: j.prepay_amt_sat - }), + const cmd = `loop --tlscertpath=${config.tls_location} --rpcserver=localhost:10009 out --channel=${chan} --amt=${amt} --fast --addr=${addy}`; + console.log("=> LOOPBOT cmd:", cmd); + let childProcess = child_process_1.spawn(cmd); + childProcess.stdout.on('data', function (data) { + const stdout = data.toString(); + console.log("LOOPBOT stdout:", stdout); + if (stdout) { + console.log('=> LOOPBOT stdout', stdout); + if (stdout.startsWith('CONTINUE SWAP?')) { + childProcess.stdin.write('y\n'); + } + if (stdout.startsWith('Swap initiated')) { + const embed = new Sphinx.MessageEmbed() + .setAuthor('LoopBot') + .setTitle('Payment was sent!'); + // .setDescription('Success!') + message.channel.send({ embed }); + return; + } + } }); - console.log("=> LOOP RESPONSE", j2); - if (j2 && j2.error) { - const embed = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setDescription('Error: ' + j2.error); - message.channel.send({ embed }); - return; - } - // if (!(j2 && j2.server_message)) { - // return - // } - const embed = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setTitle('Payment was sent!'); - // .setDescription('Success!') - message.channel.send({ embed }); - return; } catch (e) { console.log('LoopBot error', e); @@ -146,16 +184,20 @@ function init() { exports.init = init; function getBot(tribeUUID) { return __awaiter(this, void 0, void 0, function* () { - const chat = yield models_1.models.Chat.findOne({ where: { + const chat = yield models_1.models.Chat.findOne({ + where: { uuid: tribeUUID - } }); + } + }); if (!chat) return; - const chatBot = yield models_1.models.ChatBot.findOne({ where: { + const chatBot = yield models_1.models.ChatBot.findOne({ + where: { chatId: chat.id, botPrefix: '/loopout', botType: constants_1.default.bot_types.builtin - } }); + } + }); return chatBot; }); } @@ -167,34 +209,33 @@ function validateAmount(amtString) { const ok = amt > 0; return ok; } -const fs = require('fs'); -const https = require("https"); +// const fs = require('fs') +// const https = require("https"); // const homedir = require('os').homedir(); -const agent = new https.Agent({ - rejectUnauthorized: false -}); -const env = process.env.NODE_ENV || 'development'; -const config = require(path.join(__dirname, '../../config/app.json'))[env]; -function doRequest(theurl, params) { - return __awaiter(this, void 0, void 0, function* () { - const ps = params || {}; - try { - const macLocation = config.loop_macaroon_location; - if (!macLocation) { - throw new Error('no macaroon'); - } - var macaroonString = fs.readFileSync(macLocation); - var mac = Buffer.from(macaroonString, 'utf8').toString('hex'); - const theParams = Object.assign({ agent, headers: { - 'Grpc-Metadata-macaroon': mac - } }, ps); - const r = yield node_fetch_1.default(theurl, theParams); - const j = yield r.json(); - return j; - } - catch (e) { - throw e; - } - }); -} +// const agent = new https.Agent({ +// rejectUnauthorized: false +// }) +// async function doRequest(theurl: string, params?: Object) { +// const ps = params || {} +// try { +// const macLocation = config.loop_macaroon_location +// if (!macLocation) { +// throw new Error('no macaroon') +// } +// var macaroonString = fs.readFileSync(macLocation); +// var mac = Buffer.from(macaroonString, 'utf8').toString('hex'); +// const theParams = { +// agent, +// headers: { +// 'Grpc-Metadata-macaroon': mac +// }, +// ...ps +// } +// const r = await fetch(theurl, theParams) +// const j = await r.json() +// return j +// } catch (e) { +// throw e +// } +// } //# sourceMappingURL=loop.js.map \ No newline at end of file diff --git a/dist/src/builtin/loop.js.map b/dist/src/builtin/loop.js.map index e7327c2..6190000 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,2CAA8B;AAC9B,6BAA4B;AAC5B,sCAAkC;AAClC,4CAAoC;AACpC,IAAI,QAAQ,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AACrD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,IAAI,OAAO,GAAG,KAAK,CAAA;AAEnB,MAAM,OAAO,GAAG,wBAAwB,CAAA;AAExC,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,CAAC,GAAG,CAAC,CAAA;QACtC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;YAAE,OAAM;QAC1B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,UAAU;YAAE,OAAM;QAEjC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAEjD,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,EAAE,OAAO;YAC7B,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;YACnB,IAAI,CAAC,QAAQ,CA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AAI,CAAC,EAAE;gBACf,SAAS,EAAE,UAAU;gBACrB,OAAO,EAAE,mBAAS,CAAC,SAAS,CAAC,OAAO;aACrC;SACF,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAED,MAAM,MAAM,GAAG;;OAER,CAAA;AAEP,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC/B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;IAClB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,2BAA2B;AAC3B,kCAAkC;AAClC,2CAA2C;AAC3C,kCAAkC;AAClC,8BAA8B;AAC9B,KAAK;AAGL,8DAA8D;AAC9D,4BAA4B;AAC5B,UAAU;AACV,wDAAwD;AACxD,0BAA0B;AAC1B,uCAAuC;AACvC,QAAQ;AACR,yDAAyD;AACzD,qEAAqE;AACrE,0BAA0B;AAC1B,eAAe;AACf,mBAAmB;AACnB,wCAAwC;AACxC,WAAW;AACX,cAAc;AACd,QAAQ;AACR,+CAA+C;AAC/C,+BAA+B;AAC/B,eAAe;AACf,kBAAkB;AAClB,cAAc;AACd,MAAM;AACN,IAAI"} \ No newline at end of file diff --git a/src/builtin/loop.ts b/src/builtin/loop.ts index 4571100..9ed208b 100644 --- a/src/builtin/loop.ts +++ b/src/builtin/loop.ts @@ -1,15 +1,20 @@ import * as Sphinx from 'sphinx-bot' import { finalAction } from '../controllers/api' -import fetch from 'node-fetch' +// import fetch from 'node-fetch' import * as path from 'path' import { models } from '../models' import constants from '../constants' +import { spawn } from 'child_process' + +const env = process.env.NODE_ENV || 'development'; +const config = require(path.join(__dirname, '../../config/app.json'))[env] + var validate = require('bitcoin-address-validation'); const msg_types = Sphinx.MSG_TYPE let initted = false -const baseurl = 'https://localhost:8080' +// const baseurl = 'https://localhost:8080' export function init() { if (initted) return @@ -42,20 +47,62 @@ export function init() { message.channel.send({ embed }) return } - if (messageAmount < parseInt(amt)){ + if (messageAmount < parseInt(amt)) { const embed = new Sphinx.MessageEmbed() .setAuthor('LoopBot') .setDescription('Incorrect amount') message.channel.send({ embed }) return } + // try { + // const j = await doRequest(baseurl + '/v1/loop/out/quote/' + amt) + // console.log("=> LOOP QUOTE RES", j) + // if (!(j && j.swap_fee_sat && j.prepay_amt_sat)) { + // return + // } + + // let chan + // const bot = await getBot(message.channel.id) + // if (bot && bot.meta) chan = bot.meta + // if (!chan) { + // const embed = new Sphinx.MessageEmbed() + // .setAuthor('LoopBot') + // .setDescription('No channel set') + // message.channel.send({ embed }) + // return + // } + + // const j2 = await doRequest(baseurl + '/v1/loop/out', { + // method: 'POST', + // body: JSON.stringify({ + // amt: amt, + // dest: addy, + // outgoing_chan_set: [chan], + // max_swap_fee: j.swap_fee_sat, + // max_prepay_amt: j.prepay_amt_sat + // }), + // }) + // console.log("=> LOOP RESPONSE", j2) + // if (j2 && j2.error) { + // const embed = new Sphinx.MessageEmbed() + // .setAuthor('LoopBot') + // .setDescription('Error: ' + j2.error) + // message.channel.send({ embed }) + // return + // } + // // if (!(j2 && j2.server_message)) { + // // return + // // } + // const embed = new Sphinx.MessageEmbed() + // .setAuthor('LoopBot') + // .setTitle('Payment was sent!') + // // .setDescription('Success!') + // message.channel.send({ embed }) + // return + // } catch (e) { + // console.log('LoopBot error', e) + // } try { - const j = await doRequest(baseurl + '/v1/loop/out/quote/' + amt) - console.log("=> LOOP QUOTE RES", j) - if (!(j && j.swap_fee_sat && j.prepay_amt_sat)) { - return - } - let chan const bot = await getBot(message.channel.id) if (bot && bot.meta) chan = bot.meta @@ -66,34 +113,27 @@ export function init() { message.channel.send({ embed }) return } - - const j2 = await doRequest(baseurl + '/v1/loop/out', { - method: 'POST', - body: JSON.stringify({ - amt: amt, - dest: addy, - outgoing_chan_set: [chan], - max_swap_fee: j.swap_fee_sat, - max_prepay_amt: j.prepay_amt_sat - }), + const cmd = `loop --tlscertpath=${config.tls_location} --rpcserver=localhost:10009 out --channel=${chan} --amt=${amt} --fast --addr=${addy}` + console.log("=> LOOPBOT cmd:",cmd) + let childProcess = spawn(cmd) + childProcess.stdout.on('data', function (data) { + const stdout = data.toString() + console.log("LOOPBOT stdout:",stdout) + if(stdout){ + console.log('=> LOOPBOT stdout',stdout) + if(stdout.startsWith('CONTINUE SWAP?')) { + childProcess.stdin.write('y\n') + } + if(stdout.startsWith('Swap initiated')) { + const embed = new Sphinx.MessageEmbed() + .setAuthor('LoopBot') + .setTitle('Payment was sent!') + // .setDescription('Success!') + message.channel.send({ embed }) + return + } + } }) - console.log("=> LOOP RESPONSE", j2) - if (j2 && j2.error) { - const embed = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setDescription('Error: ' + j2.error) - message.channel.send({ embed }) - return - } - // if (!(j2 && j2.server_message)) { - // return - // } - const embed = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setTitle('Payment was sent!') - // .setDescription('Success!') - message.channel.send({ embed }) - return } catch (e) { console.log('LoopBot error', e) } @@ -103,15 +143,15 @@ export function init() { const isAdmin = message.member.roles.find(role => role.name === 'Admin') - if(isAdmin && cmd.startsWith('setchan=')) { + if (isAdmin && cmd.startsWith('setchan=')) { const bot = await getBot(message.channel.id) const arr = cmd.split('=') - if(bot && arr.length>1) { + if (bot && arr.length > 1) { const chan = arr[1] - await bot.update({meta: chan}) + await bot.update({ meta: chan }) const embed = new Sphinx.MessageEmbed() .setAuthor('LoopBot') - .setDescription('Channel updated to '+chan) + .setDescription('Channel updated to ' + chan) .setThumbnail(botSVG) message.channel.send({ embed }) return @@ -140,16 +180,20 @@ export function init() { }) } -async function getBot(tribeUUID:string){ - const chat = await models.Chat.findOne({ where:{ - uuid: tribeUUID - }}) +async function getBot(tribeUUID: string) { + const chat = await models.Chat.findOne({ + where: { + uuid: tribeUUID + } + }) if (!chat) return - const chatBot = await models.ChatBot.findOne({where: { - chatId: chat.id, - botPrefix: '/loopout', - botType: constants.bot_types.builtin - }}) + const chatBot = await models.ChatBot.findOne({ + where: { + chatId: chat.id, + botPrefix: '/loopout', + botType: constants.bot_types.builtin + } + }) return chatBot } @@ -163,36 +207,34 @@ function validateAmount(amtString: string) { return ok } -const fs = require('fs') -const https = require("https"); +// const fs = require('fs') +// const https = require("https"); // const homedir = require('os').homedir(); -const agent = new https.Agent({ - rejectUnauthorized: false -}) - -const env = process.env.NODE_ENV || 'development'; -const config = require(path.join(__dirname, '../../config/app.json'))[env] - -async function doRequest(theurl: string, params?: Object) { - const ps = params || {} - try { - const macLocation=config.loop_macaroon_location - if(!macLocation) { - throw new Error('no macaroon') - } - var macaroonString = fs.readFileSync(macLocation); - var mac = Buffer.from(macaroonString, 'utf8').toString('hex'); - const theParams = { - agent, - headers: { - 'Grpc-Metadata-macaroon': mac - }, - ...ps - } - const r = await fetch(theurl, theParams) - const j = await r.json() - return j - } catch (e) { - throw e - } -} \ No newline at end of file +// const agent = new https.Agent({ +// rejectUnauthorized: false +// }) + + +// async function doRequest(theurl: string, params?: Object) { +// const ps = params || {} +// try { +// const macLocation = config.loop_macaroon_location +// if (!macLocation) { +// throw new Error('no macaroon') +// } +// var macaroonString = fs.readFileSync(macLocation); +// var mac = Buffer.from(macaroonString, 'utf8').toString('hex'); +// const theParams = { +// agent, +// headers: { +// 'Grpc-Metadata-macaroon': mac +// }, +// ...ps +// } +// const r = await fetch(theurl, theParams) +// const j = await r.json() +// return j +// } catch (e) { +// throw e +// } +// } \ No newline at end of file From 03803697fe15f65b48f03c0db71f53973cc9ad58 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 15:10:53 -0800 Subject: [PATCH 02/10] fix cmdline args --- dist/src/builtin/loop.js | 17 ++++++++++++++--- dist/src/builtin/loop.js.map | 2 +- src/builtin/loop.ts | 17 ++++++++++++++--- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/dist/src/builtin/loop.js b/dist/src/builtin/loop.js index 3b61ed6..9cd9049 100644 --- a/dist/src/builtin/loop.js +++ b/dist/src/builtin/loop.js @@ -117,9 +117,17 @@ function init() { message.channel.send({ embed }); return; } - const cmd = `loop --tlscertpath=${config.tls_location} --rpcserver=localhost:10009 out --channel=${chan} --amt=${amt} --fast --addr=${addy}`; - console.log("=> LOOPBOT cmd:", cmd); - let childProcess = child_process_1.spawn(cmd); + const cmd = `loop`; + const args = [ + 'out', + `--tlscertpath=${config.tls_location}`, + `--rpcserver=localhost:10009`, + `--channel=${chan}`, + `--amt=${amt}`, + `--fast`, + `--addr=${addy}` + ]; + let childProcess = child_process_1.spawn(cmd, args); childProcess.stdout.on('data', function (data) { const stdout = data.toString(); console.log("LOOPBOT stdout:", stdout); @@ -138,6 +146,9 @@ function init() { } } }); + childProcess.on('error', (error) => { + console.log(error.toString()); + }); } catch (e) { console.log('LoopBot error', e); diff --git a/dist/src/builtin/loop.js.map b/dist/src/builtin/loop.js.map index 6190000..aa1d199 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,MAA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builtin/loop.ts index 9ed208b..bc1006d 100644 --- a/src/builtin/loop.ts +++ b/src/builtin/loop.ts @@ -113,9 +113,17 @@ export function init() { message.channel.send({ embed }) return } - const cmd = `loop --tlscertpath=${config.tls_location} --rpcserver=localhost:10009 out --channel=${chan} --amt=${amt} --fast --addr=${addy}` - console.log("=> LOOPBOT cmd:",cmd) - let childProcess = spawn(cmd) + const cmd = `loop` + const args = [ + 'out', + `--tlscertpath=${config.tls_location}`, + `--rpcserver=localhost:10009`, + `--channel=${chan}`, + `--amt=${amt}`, + `--fast`, + `--addr=${addy}` + ] + let childProcess = spawn(cmd, args) childProcess.stdout.on('data', function (data) { const stdout = data.toString() console.log("LOOPBOT stdout:",stdout) @@ -134,6 +142,9 @@ export function init() { } } }) + childProcess.on('error', (error) => { + console.log(error.toString()); + }); } catch (e) { console.log('LoopBot error', e) } From 6a658af78fa2de7af57c28ad4f55658cf8adee1a Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 15:24:17 -0800 Subject: [PATCH 03/10] arg order --- dist/src/builtin/loop.js | 3 ++- dist/src/builtin/loop.js.map | 2 +- src/builtin/loop.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/src/builtin/loop.js b/dist/src/builtin/loop.js index 9cd9049..fca16b7 100644 --- a/dist/src/builtin/loop.js +++ b/dist/src/builtin/loop.js @@ -119,9 +119,9 @@ function init() { } const cmd = `loop`; const args = [ - 'out', `--tlscertpath=${config.tls_location}`, `--rpcserver=localhost:10009`, + 'out', `--channel=${chan}`, `--amt=${amt}`, `--fast`, @@ -153,6 +153,7 @@ function init() { catch (e) { console.log('LoopBot error', e); } + return; // return here } const cmd = arr[1]; const isAdmin = message.member.roles.find(role => role.name === 'Admin'); diff --git a/dist/src/builtin/loop.js.map b/dist/src/builtin/loop.js.map index aa1d199..140b04c 100644 --- a/dist/src/builtin/loop.js.map +++ b/dist/src/builtin/loop.js.map @@ -1 +1 @@ -{"version":3,"file":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GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;aAChB;SACF,CAAC,CAAA;QACF,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,SAAS,EAAE,UAAU;gBACrB,OAAO,EAAE,mBAAS,CAAC,SAAS,CAAC,OAAO;aACrC;SACF,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAED,MAAM,MAAM,GAAG;;OAER,CAAA;AAEP,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC/B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;IAClB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,2BAA2B;AAC3B,kCAAkC;AAClC,2CAA2C;AAC3C,kCAAkC;AAClC,8BAA8B;AAC9B,KAAK;AAGL,8DAA8D;AAC9D,4BAA4B;AAC5B,UAAU;AACV,wDAAwD;AACxD,0BAA0B;AAC1B,uCAAuC;AACvC,QAAQ;AACR,yDAAyD;AACzD,qEAAqE;AACrE,0BAA0B;AAC1B,eAAe;AACf,mBAAmB;AACnB,wCAAwC;AACxC,WAAW;AACX,cAAc;AACd,QAAQ;AACR,+CAA+C;AAC/C,+BAA+B;AAC/B,eAAe;AACf,kBAAkB;AAClB,cAAc;AACd,MAAM;AACN,IAAI"} \ No newline at end of file +{"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,C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,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,SAAS,EAAE,UAAU;gBACrB,OAAO,EAAE,mBAAS,CAAC,SAAS,CAAC,OAAO;aACrC;SACF,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAED,MAAM,MAAM,GAAG;;OAER,CAAA;AAEP,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC/B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;IAClB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,2BAA2B;AAC3B,kCAAkC;AAClC,2CAA2C;AAC3C,kCAAkC;AAClC,8BAA8B;AAC9B,KAAK;AAGL,8DAA8D;AAC9D,4BAA4B;AAC5B,UAAU;AACV,wDAAwD;AACxD,0BAA0B;AAC1B,uCAAuC;AACvC,QAAQ;AACR,yDAAyD;AACzD,qEAAqE;AACrE,0BAA0B;AAC1B,eAAe;AACf,mBAAmB;AACnB,wCAAwC;AACxC,WAAW;AACX,cAAc;AACd,QAAQ;AACR,+CAA+C;AAC/C,+BAA+B;AAC/B,eAAe;AACf,kBAAkB;AAClB,cAAc;AACd,MAAM;AACN,IAAI"} \ No newline at end of file diff --git a/src/builtin/loop.ts b/src/builtin/loop.ts index bc1006d..2fa7a5c 100644 --- a/src/builtin/loop.ts +++ b/src/builtin/loop.ts @@ -115,9 +115,9 @@ export function init() { } const cmd = `loop` const args = [ - 'out', `--tlscertpath=${config.tls_location}`, `--rpcserver=localhost:10009`, + 'out', `--channel=${chan}`, `--amt=${amt}`, `--fast`, @@ -148,6 +148,7 @@ export function init() { } catch (e) { console.log('LoopBot error', e) } + return // return here } const cmd = arr[1] From a51164f36b530eda4dcaa183f97d7eb01e1f8a04 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 15:37:46 -0800 Subject: [PATCH 04/10] logs --- dist/src/builtin/loop.js | 1 + dist/src/builtin/loop.js.map | 2 +- dist/src/network/intercept.js | 8 ++++++++ dist/src/network/intercept.js.map | 2 +- src/builtin/loop.ts | 1 + src/network/intercept.ts | 8 ++++++++ 6 files changed, 20 insertions(+), 2 deletions(-) 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,CAA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AAU;AACV,wDAAwD;AACxD,0BAA0B;AAC1B,uCAAuC;AACvC,QAAQ;AACR,yDAAyD;AACzD,qEAAqE;AACrE,0BAA0B;AAC1B,eAAe;AACf,mBAAmB;AACnB,wCAAwC;AACxC,WAAW;AACX,cAAc;AACd,QAAQ;AACR,+CAA+C;AAC/C,+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,C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oE;oBACpE,OAAO,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;iBAC7D;aACF;QACH,CAAC,CAAA,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAtDD,4BAsDC;AAED,SAAe,gBAAgB,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;AACv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AC7D;aACF;QACH,CAAC,CAAA,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AA9DD,4BA8DC;AAED,SAAe,gBAAgB,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 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) } From 4a69ceb11efa835150ab7a6806605fc71b701c6c Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 15:48:51 -0800 Subject: [PATCH 05/10] more handling --- dist/src/builtin/loop.js | 83 +++++++++++++++-------------- dist/src/builtin/loop.js.map | 2 +- dist/src/network/intercept.js | 8 --- dist/src/network/intercept.js.map | 2 +- src/builtin/loop.ts | 86 +++++++++++++++++-------------- src/network/intercept.ts | 8 --- 6 files changed, 94 insertions(+), 95 deletions(-) diff --git a/dist/src/builtin/loop.js b/dist/src/builtin/loop.js index f682c37..eed5091 100644 --- a/dist/src/builtin/loop.js +++ b/dist/src/builtin/loop.js @@ -134,7 +134,7 @@ function init() { console.log("LOOPBOT stdout:", stdout); if (stdout) { console.log('=> LOOPBOT stdout', stdout); - if (stdout.startsWith('CONTINUE SWAP?')) { + if (stdout.includes('CONTINUE SWAP?')) { childProcess.stdin.write('y\n'); } if (stdout.startsWith('Swap initiated')) { @@ -147,51 +147,58 @@ function init() { } } }); + childProcess.stderr.on('data', function (data) { + console.log("STDERR:", data.toString()); + }); childProcess.on('error', (error) => { - console.log(error.toString()); + console.log("error", error.toString()); + }); + childProcess.on('close', (code) => { + console.log("CHILD PROCESS closed", code); }); } catch (e) { console.log('LoopBot error', e); } - return; // return here } - const cmd = arr[1]; - const isAdmin = message.member.roles.find(role => role.name === 'Admin'); - if (isAdmin && cmd.startsWith('setchan=')) { - const bot = yield getBot(message.channel.id); - const arr = cmd.split('='); - if (bot && arr.length > 1) { - const chan = arr[1]; - yield bot.update({ meta: chan }); - const embed = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setDescription('Channel updated to ' + chan) - .setThumbnail(botSVG); - message.channel.send({ embed }); - return; + else { + const cmd = arr[1]; + const isAdmin = message.member.roles.find(role => role.name === 'Admin'); + if (isAdmin && cmd.startsWith('setchan=')) { + const bot = yield getBot(message.channel.id); + const arr = cmd.split('='); + if (bot && arr.length > 1) { + const chan = arr[1]; + yield bot.update({ meta: chan }); + const embed = new Sphinx.MessageEmbed() + .setAuthor('LoopBot') + .setDescription('Channel updated to ' + chan) + .setThumbnail(botSVG); + message.channel.send({ embed }); + return; + } } - } - switch (cmd) { - case 'help': - const embed = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setTitle('LoopBot Commands:') - .addFields([ - { name: 'Send to your on-chain address', value: '/loopout {ADDRESS} {AMOUNT}' }, - { name: 'Set Channel', value: '/loopout setchan=***' }, - { name: 'Help', value: '/loopout help' }, - ]) - .setThumbnail(botSVG); - message.channel.send({ embed }); - return; - default: - const embed2 = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setDescription('Command not recognized'); - message.channel.send({ embed: embed2 }); - return; - } + switch (cmd) { + case 'help': + const embed = new Sphinx.MessageEmbed() + .setAuthor('LoopBot') + .setTitle('LoopBot Commands:') + .addFields([ + { name: 'Send to your on-chain address', value: '/loopout {ADDRESS} {AMOUNT}' }, + { name: 'Set Channel', value: '/loopout setchan=***' }, + { name: 'Help', value: '/loopout help' }, + ]) + .setThumbnail(botSVG); + message.channel.send({ embed }); + return; + default: + const embed2 = new Sphinx.MessageEmbed() + .setAuthor('LoopBot') + .setDescription('Command not recognized'); + message.channel.send({ embed: embed2 }); + return; + } + } // end else })); } exports.init = init; diff --git a/dist/src/builtin/loop.js.map b/dist/src/builtin/loop.js.map index 4c0c64b..039f444 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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;gBACf,SAAS,EAAE,UAAU;gBACrB,OAAO,EAAE,mBAAS,CAAC,SAAS,CAAC,OAAO;aACrC;SACF,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAED,MAAM,MAAM,GAAG;;OAER,CAAA;AAEP,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC/B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;IAClB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,2BAA2B;AAC3B,kCAAkC;AAClC,2CAA2C;AAC3C,kCAAkC;AAClC,8BAA8B;AAC9B,KAAK;AAGL,8DAA8D;AAC9D,4BAA4B;AAC5B,UAAU;AACV,wDAAwD;AACxD,0BAA0B;AAC1B,uCAAuC;AACvC,QAAQ;AACR,yDAAyD;AACzD,qEAAqE;AACrE,0BAA0B;AAC1B,eAAe;AACf,mBAAmB;AACnB,wCAAwC;AACxC,WAAW;AACX,cAAc;AACd,QAAQ;AACR,+CAA+C;AAC/C,+BAA+B;AAC/B,eAAe;AACf,kBAAkB;AAClB,cAAc;AACd,MAAM;AACN,IAAI"} \ No newline at end of file +{"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;A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AAC,IAAI,CAAC,OAAO,CAAC;YACrC,KAAK,EAAE;gBACL,IAAI,EAAE,SAAS;aAChB;SACF,CAAC,CAAA;QACF,IAAI,CAAC,IAAI;YAAE,OAAM;QACjB,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YAC3C,KAAK,EAAE;gBACL,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,SAAS,EAAE,UAAU;gBACrB,OAAO,EAAE,mBAAS,CAAC,SAAS,CAAC,OAAO;aACrC;SACF,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAED,MAAM,MAAM,GAAG;;OAER,CAAA;AAEP,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC/B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;IAClB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,2BAA2B;AAC3B,kCAAkC;AAClC,2CAA2C;AAC3C,kCAAkC;AAClC,8BAA8B;AAC9B,KAAK;AAGL,8DAA8D;AAC9D,4BAA4B;AAC5B,UAAU;AACV,wDAAwD;AACxD,0BAA0B;AAC1B,uCAAuC;AACvC,QAAQ;AACR,yDAAyD;AACzD,qEAAqE;AACrE,0BAA0B;AAC1B,eAAe;AACf,mBAAmB;AACnB,wCAAwC;AACxC,WAAW;AACX,cAAc;AACd,QAAQ;AACR,+CAA+C;AAC/C,+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 93bce1a..5068ff5 100644 --- a/dist/src/network/intercept.js +++ b/dist/src/network/intercept.js @@ -21,31 +21,26 @@ 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 @@ -54,7 +49,6 @@ 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) @@ -64,7 +58,6 @@ 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); } } @@ -73,7 +66,6 @@ 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 e4a83ba..106f57e 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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BAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;iBAC7D;aACF;QACH,CAAC,CAAA,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AA9DD,4BA8DC;AAED,SAAe,gBAAgB,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;AAE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,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 2855741..aa78115 100644 --- a/src/builtin/loop.ts +++ b/src/builtin/loop.ts @@ -130,7 +130,7 @@ export function init() { console.log("LOOPBOT stdout:",stdout) if(stdout){ console.log('=> LOOPBOT stdout',stdout) - if(stdout.startsWith('CONTINUE SWAP?')) { + if(stdout.includes('CONTINUE SWAP?')) { childProcess.stdin.write('y\n') } if(stdout.startsWith('Swap initiated')) { @@ -143,53 +143,61 @@ export function init() { } } }) + childProcess.stderr.on('data', function (data) { + console.log("STDERR:",data.toString()) + }); childProcess.on('error', (error) => { - console.log(error.toString()); + console.log("error",error.toString()); + }); + childProcess.on('close', (code) => { + console.log("CHILD PROCESS closed",code) }); } catch (e) { console.log('LoopBot error', e) } - return // return here - } + } else { - const cmd = arr[1] + const cmd = arr[1] - const isAdmin = message.member.roles.find(role => role.name === 'Admin') + const isAdmin = message.member.roles.find(role => role.name === 'Admin') - if (isAdmin && cmd.startsWith('setchan=')) { - const bot = await getBot(message.channel.id) - const arr = cmd.split('=') - if (bot && arr.length > 1) { - const chan = arr[1] - await bot.update({ meta: chan }) - const embed = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setDescription('Channel updated to ' + chan) - .setThumbnail(botSVG) - message.channel.send({ embed }) - return + if (isAdmin && cmd.startsWith('setchan=')) { + const bot = await getBot(message.channel.id) + const arr = cmd.split('=') + if (bot && arr.length > 1) { + const chan = arr[1] + await bot.update({ meta: chan }) + const embed = new Sphinx.MessageEmbed() + .setAuthor('LoopBot') + .setDescription('Channel updated to ' + chan) + .setThumbnail(botSVG) + message.channel.send({ embed }) + return + } } - } - switch (cmd) { - case 'help': - const embed = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setTitle('LoopBot Commands:') - .addFields([ - { name: 'Send to your on-chain address', value: '/loopout {ADDRESS} {AMOUNT}' }, - { name: 'Set Channel', value: '/loopout setchan=***' }, - { name: 'Help', value: '/loopout help' }, - ]) - .setThumbnail(botSVG) - message.channel.send({ embed }) - return - default: - const embed2 = new Sphinx.MessageEmbed() - .setAuthor('LoopBot') - .setDescription('Command not recognized') - message.channel.send({ embed: embed2 }) - return - } + switch (cmd) { + case 'help': + const embed = new Sphinx.MessageEmbed() + .setAuthor('LoopBot') + .setTitle('LoopBot Commands:') + .addFields([ + { name: 'Send to your on-chain address', value: '/loopout {ADDRESS} {AMOUNT}' }, + { name: 'Set Channel', value: '/loopout setchan=***' }, + { name: 'Help', value: '/loopout help' }, + ]) + .setThumbnail(botSVG) + message.channel.send({ embed }) + return + default: + const embed2 = new Sphinx.MessageEmbed() + .setAuthor('LoopBot') + .setDescription('Command not recognized') + message.channel.send({ embed: embed2 }) + return + } + + } // end else + }) } diff --git a/src/network/intercept.ts b/src/network/intercept.ts index ad6aa5c..0b1f121 100644 --- a/src/network/intercept.ts +++ b/src/network/intercept.ts @@ -12,18 +12,15 @@ 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} }) @@ -31,14 +28,12 @@ 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 @@ -48,7 +43,6 @@ 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) @@ -58,14 +52,12 @@ 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) } From c8be784ce0295ee714edc0fa7ee0b0f18c94349c Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 15:53:12 -0800 Subject: [PATCH 06/10] macaroonpath --- dist/src/builtin/loop.js | 1 + dist/src/builtin/loop.js.map | 2 +- src/builtin/loop.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/src/builtin/loop.js b/dist/src/builtin/loop.js index eed5091..bc9abb5 100644 --- a/dist/src/builtin/loop.js +++ b/dist/src/builtin/loop.js @@ -120,6 +120,7 @@ function init() { const cmd = `loop`; const args = [ `--tlscertpath=${config.tls_location}`, + `--macaroonpath=${config.loop_macaroon_location}`, `--rpcserver=localhost:10009`, 'out', `--channel=${chan}`, diff --git a/dist/src/builtin/loop.js.map b/dist/src/builtin/loop.js.map index 039f444..87c6d23 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,CAAC,GAAG,CAAC,CAAA;QACtC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;YAAE,OAAM;QAC1B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,UAAU;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MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;IAClB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,2BAA2B;AAC3B,kCAAkC;AAClC,2CAA2C;AAC3C,kCAAkC;AAClC,8BAA8B;AAC9B,KAAK;AAGL,8DAA8D;AAC9D,4BAA4B;AAC5B,UAAU;AACV,wDAAwD;AACxD,0BAA0B;AAC1B,uCAAuC;AACvC,QAAQ;AACR,yDAAyD;AACzD,qEAAqE;AACrE,0BAA0B;AAC1B,eAAe;AACf,mBAAmB;AACnB,wCAAwC;AACxC,WAAW;AACX,cAAc;AACd,QAAQ;AACR,+CAA+C;AAC/C,+BAA+B;AAC/B,eAAe;AACf,kBAAkB;AAClB,cAAc;AACd,MAAM;AACN,IAAI"} \ No newline at end of file +{"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,C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EAAE,IAAI,CAAC,EAAE;gBACf,SAAS,EAAE,UAAU;gBACrB,OAAO,EAAE,mBAAS,CAAC,SAAS,CAAC,OAAO;aACrC;SACF,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAED,MAAM,MAAM,GAAG;;OAER,CAAA;AAEP,SAAS,cAAc,CAAC,SAAiB;IACvC,MAAM,GAAG,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;IAC/B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAA;IAClB,OAAO,EAAE,CAAA;AACX,CAAC;AAED,2BAA2B;AAC3B,kCAAkC;AAClC,2CAA2C;AAC3C,kCAAkC;AAClC,8BAA8B;AAC9B,KAAK;AAGL,8DAA8D;AAC9D,4BAA4B;AAC5B,UAAU;AACV,wDAAwD;AACxD,0BAA0B;AAC1B,uCAAuC;AACvC,QAAQ;AACR,yDAAyD;AACzD,qEAAqE;AACrE,0BAA0B;AAC1B,eAAe;AACf,mBAAmB;AACnB,wCAAwC;AACxC,WAAW;AACX,cAAc;AACd,QAAQ;AACR,+CAA+C;AAC/C,+BAA+B;AAC/B,eAAe;AACf,kBAAkB;AAClB,cAAc;AACd,MAAM;AACN,IAAI"} \ No newline at end of file diff --git a/src/builtin/loop.ts b/src/builtin/loop.ts index aa78115..8bf5c3b 100644 --- a/src/builtin/loop.ts +++ b/src/builtin/loop.ts @@ -116,6 +116,7 @@ export function init() { const cmd = `loop` const args = [ `--tlscertpath=${config.tls_location}`, + `--macaroonpath=${config.loop_macaroon_location}`, `--rpcserver=localhost:10009`, 'out', `--channel=${chan}`, From 93dd357e0130d8388b4993c150f9e2bd653e20d3 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 16:10:51 -0800 Subject: [PATCH 07/10] log --- dist/src/builtin/index.js | 1 + dist/src/builtin/index.js.map | 2 +- dist/src/network/intercept.js | 1 + dist/src/network/intercept.js.map | 2 +- src/builtin/index.ts | 1 + src/network/intercept.ts | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/src/builtin/index.js b/dist/src/builtin/index.js index 3affc20..e6d6933 100644 --- a/dist/src/builtin/index.js +++ b/dist/src/builtin/index.js @@ -37,6 +37,7 @@ function init() { exports.init = init; function builtinBotEmit(msg) { setTimeout(() => { + console.log("BUILT IN BOT EMIT", bots_1.buildBotPayload(msg)); SphinxBot._emit('message', bots_1.buildBotPayload(msg)); }, 1200); } diff --git a/dist/src/builtin/index.js.map b/dist/src/builtin/index.js.map index 7b763ce..bc4ef9b 100644 --- a/dist/src/builtin/index.js.map +++ b/dist/src/builtin/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAAmD;AACnD,wCAAuC;AACvC,sCAAqC;AACrC,wCAAuC;AACvC,kCAAiC;AAEjC,sCAAkC;AAClC,8CAAmD;AAuBvB,0BAvBpB,sBAAe,CAuBoB;AAtB3C,4CAAoC;AAEpC,SAAe,IAAI;;QACf,SAAS,CAAC,IAAI,EAAE,CAAA;QAEhB,MAAM,WAAW,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC;gBACpD,OAAO,EAAE,mBAAS,CAAC,SAAS,CAAC,OAAO;aACvC,EAAC,CAAC,CAAA;QACH,IAAG,CAAC,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC;YAAE,OAAM;QAE/C,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA,EAAE;YACnB,IAAG,CAAC,CAAC,SAAS,KAAG,UAAU;gBAAE,UAAU,CAAC,IAAI,EAAE,CAAA;YAC9C,IAAG,CAAC,CAAC,SAAS,KAAG,UAAU;gBAAE,OAAO,CAAC,IAAI,EAAE,CAAA;QAC/C,CAAC,CAAC,CAAA;IACN,CAAC;CAAA;AAQO,oBAAI;AANZ,SAAS,cAAc,CAAC,GAAO;IAC3B,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AAc"} \ No newline at end of file diff --git a/dist/src/network/intercept.js b/dist/src/network/intercept.js index 5068ff5..dda01e7 100644 --- a/dist/src/network/intercept.js +++ b/dist/src/network/intercept.js @@ -36,6 +36,7 @@ function isBotMsg(msg, sentByMe) { return false; let didEmit = false; if (txt && txt.startsWith('/bot ')) { + console.log("BOT: /bot command detected"); builtin_1.builtinBotEmit(msg); didEmit = true; } diff --git a/dist/src/network/intercept.js.map b/dist/src/network/intercept.js.map index 106f57e..2f09445 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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C,UAAU,CAAC,CAAA;iBAC7D;aACF;QACH,CAAC,CAAA,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAtDD,4BAsDC;AAED,SAAe,gBAAgB,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,CAA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ACF,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/index.ts b/src/builtin/index.ts index c2fdcbd..563130a 100644 --- a/src/builtin/index.ts +++ b/src/builtin/index.ts @@ -24,6 +24,7 @@ async function init(){ function builtinBotEmit(msg:Msg){ setTimeout(()=>{ + console.log("BUILT IN BOT EMIT",buildBotPayload(msg)) SphinxBot._emit('message', buildBotPayload(msg)) },1200) } diff --git a/src/network/intercept.ts b/src/network/intercept.ts index 0b1f121..1419b85 100644 --- a/src/network/intercept.ts +++ b/src/network/intercept.ts @@ -29,6 +29,7 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise { let didEmit = false if (txt && txt.startsWith('/bot ')) { + console.log("BOT: /bot command detected") builtinBotEmit(msg) didEmit = true } From 749f5fa8722e5b1d8b3bec323c4e7993813e66f1 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 16:16:42 -0800 Subject: [PATCH 08/10] logs' --- dist/src/builtin/index.js | 2 +- dist/src/builtin/index.js.map | 2 +- dist/src/builtin/mother.js | 2 ++ dist/src/builtin/mother.js.map | 2 +- dist/src/network/intercept.js | 2 +- dist/src/network/intercept.js.map | 2 +- src/builtin/index.ts | 2 +- src/builtin/mother.ts | 3 +++ src/network/intercept.ts | 2 +- 9 files changed, 12 insertions(+), 7 deletions(-) diff --git a/dist/src/builtin/index.js b/dist/src/builtin/index.js index e6d6933..d6921d8 100644 --- a/dist/src/builtin/index.js +++ b/dist/src/builtin/index.js @@ -37,7 +37,7 @@ function init() { exports.init = init; function builtinBotEmit(msg) { setTimeout(() => { - console.log("BUILT IN BOT EMIT", bots_1.buildBotPayload(msg)); + console.log("===== BUILT IN BOT EMIT", bots_1.buildBotPayload(msg)); SphinxBot._emit('message', bots_1.buildBotPayload(msg)); }, 1200); } diff --git a/dist/src/builtin/index.js.map b/dist/src/builtin/index.js.map index bc4ef9b..f6b9515 100644 --- a/dist/src/builtin/index.js.map +++ b/dist/src/builtin/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAAmD;AACnD,wCAAuC;AACvC,sCAAqC;AACrC,wCAAuC;AACvC,kCAAiC;AAEjC,sCAAkC;AAClC,8CAAmD;AAwBvB,0BAxBpB,sBAAe,CAwBoB;AAvB3C,4CAAoC;AAEpC,SAAe,IAAI;;QACf,SAAS,CAAC,IAAI,EAAE,CAAA;QAEhB,MAAM,WAAW,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC;gBACpD,OAAO,EAAE,mBAAS,CAAC,SAAS,CAAC,OAAO;aACvC,EAAC,CAAC,CAAA;QACH,IAAG,CAAC,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC;YAAE,OAAM;QAE/C,WAAW,CAAC,OAAO,CAAC,CAAC,CAAA,EAAE;YACnB,IAAG,CAAC,CAAC,SAAS,KAAG,UAAU;gBAAE,UAAU,CAAC,IAAI,EAAE,CAAA;YAC9C,IAAG,CAAC,CAAC,SAAS,KAAG,UAAU;gBAAE,OAAO,CAAC,IAAI,EAAE,CAAA;QAC/C,CAAC,CAAC,CA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CAAC,CAAC,CAAA;QAC3D,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,sBAAe,CAAC,GAAG,CAAC,CAAC,CAAA;IACpD,CAAC,EAAC,IAAI,CAAC,CAAA;AACX,CAAC;AAEY,wCAAc"} \ No newline at end of file diff --git a/dist/src/builtin/mother.js b/dist/src/builtin/mother.js index d3ead7d..ae596d3 100644 --- a/dist/src/builtin/mother.js +++ b/dist/src/builtin/mother.js @@ -36,9 +36,11 @@ const builtInBotNames = { loopout: 'LoopBot', }; function init() { + console.log("===== MOTHERBOT INIT"); const client = new Sphinx.Client(); client.login('_', api_1.finalAction); client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () { + console.log("===== MOTHER BOT GOT A MESSAGE"); const arr = (message.content && message.content.split(' ')) || []; if (arr.length < 2) return; diff --git a/dist/src/builtin/mother.js.map b/dist/src/builtin/mother.js.map index 12d3e18..520b91f 100644 --- a/dist/src/builtin/mother.js.map +++ b/dist/src/builtin/mother.js.map @@ -1 +1 @@ -{"version":3,"file":"mother.js","sourceRoot":"","sources":["../../../src/builtin/mother.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAAmD;AACnD,qCAAoC;AACpC,4CAAgD;AAChD,8CAA4D;AAC5D,6BAA4B;AAC5B,wCAAuC;AACvC,kCAAiC;AACjC,sCAAkC;AAClC,2CAA8B;AAC9B,4CAAoC;AAEpC,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AACjD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,SAAS;CACrB,CAAA;AAED,MAAM,kBAAkB,GAAG;IACzB,SAAS,EAAE;QACT,mBAAS,CAAC,aAAa,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CAAC,CAAA,CAAC,CAAA;AACJ,CAAC;AAtHD,oBAsHC;AAED,MAAM,MAAM,GAAG;;OAER,CAAA;AAEP,SAAe,UAAU,CAAC,CAAS;;QACjC,IAAI;YACF,MAAM,CAAC,GAAG,MAAM,oBAAK,CAAC,WAAW,MAAM,CAAC,WAAW,gBAAgB,CAAC,EAAE,CAAC,CAAA;YACvE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;YACxB,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;SACjC;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,EAAE,CAAA;SACV;IACH,CAAC;CAAA;AACD,SAAe,YAAY,CAAC,IAAY;;QACtC,IAAI;YACF,MAAM,CAAC,GAAG,MAAM,oBAAK,CAAC,WAAW,MAAM,CAAC,WAAW,QAAQ,IAAI,EAAE,CAAC,CAAA;YAClE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;YACxB,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,EAAE;gBACjC,OAAO,CAAC,CAAA;aACT;YACD,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"mother.js","sourceRoot":"","sources":["../../../src/builtin/mother.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAAmD;AACnD,qCAAoC;AACpC,4CAAgD;AAChD,8CAA4D;AAC5D,6BAA4B;AAC5B,wCAAuC;AACvC,kCAAiC;AACjC,sCAAkC;AAClC,2CAA8B;AAC9B,4CAAoC;AAEpC,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;A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/dist/src/network/intercept.js b/dist/src/network/intercept.js index dda01e7..13fe86f 100644 --- a/dist/src/network/intercept.js +++ b/dist/src/network/intercept.js @@ -36,7 +36,7 @@ function isBotMsg(msg, sentByMe) { return false; let didEmit = false; if (txt && txt.startsWith('/bot ')) { - console.log("BOT: /bot command detected"); + console.log("===== BOT: /bot command detected"); builtin_1.builtinBotEmit(msg); didEmit = true; } diff --git a/dist/src/network/intercept.js.map b/dist/src/network/intercept.js.map index 2f09445..7fc1cb7 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,CA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AAO,GAAG,MAAM,gBAAgB,CAAC,GAAG,EAAE,UAAU,CAAC,UAAU,CAAC,CAAA;iBAC7D;aACF;QACH,CAAC,CAAA,CAAC,CAAA;QAEF,OAAO,OAAO,CAAA;IAChB,CAAC;CAAA;AAvDD,4BAuDC;AAED,SAAe,gBAAgB,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;A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I,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/index.ts b/src/builtin/index.ts index 563130a..15e89d7 100644 --- a/src/builtin/index.ts +++ b/src/builtin/index.ts @@ -24,7 +24,7 @@ async function init(){ function builtinBotEmit(msg:Msg){ setTimeout(()=>{ - console.log("BUILT IN BOT EMIT",buildBotPayload(msg)) + console.log("===== BUILT IN BOT EMIT",buildBotPayload(msg)) SphinxBot._emit('message', buildBotPayload(msg)) },1200) } diff --git a/src/builtin/mother.ts b/src/builtin/mother.ts index 619c186..1ca61f3 100644 --- a/src/builtin/mother.ts +++ b/src/builtin/mother.ts @@ -32,10 +32,13 @@ const builtInBotNames = { export function init() { + console.log("===== MOTHERBOT INIT") + const client = new Sphinx.Client() client.login('_', finalAction) client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => { + console.log("===== MOTHER BOT GOT A MESSAGE") const arr = (message.content && message.content.split(' ')) || [] if (arr.length < 2) return if (arr[0] !== '/bot') return diff --git a/src/network/intercept.ts b/src/network/intercept.ts index 1419b85..53ce042 100644 --- a/src/network/intercept.ts +++ b/src/network/intercept.ts @@ -29,7 +29,7 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise { let didEmit = false if (txt && txt.startsWith('/bot ')) { - console.log("BOT: /bot command detected") + console.log("===== BOT: /bot command detected") builtinBotEmit(msg) didEmit = true } From 6078e7db7134f9af99d1163b7e2c215af53f6daf Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 27 Nov 2020 16:20:12 -0800 Subject: [PATCH 09/10] cleaup --- dist/src/builtin/index.js | 1 - dist/src/builtin/index.js.map | 2 +- dist/src/builtin/mother.js | 2 -- dist/src/builtin/mother.js.map | 2 +- dist/src/network/intercept.js | 1 - dist/src/network/intercept.js.map | 2 +- src/builtin/index.ts | 1 - src/builtin/mother.ts | 4 +--- src/network/intercept.ts | 1 - 9 files changed, 4 insertions(+), 12 deletions(-) diff --git a/dist/src/builtin/index.js b/dist/src/builtin/index.js index d6921d8..3affc20 100644 --- a/dist/src/builtin/index.js +++ b/dist/src/builtin/index.js @@ -37,7 +37,6 @@ function init() { exports.init = init; function builtinBotEmit(msg) { setTimeout(() => { - console.log("===== BUILT IN BOT EMIT", bots_1.buildBotPayload(msg)); SphinxBot._emit('message', bots_1.buildBotPayload(msg)); }, 1200); } diff --git a/dist/src/builtin/index.js.map b/dist/src/builtin/index.js.map index f6b9515..7b763ce 100644 --- a/dist/src/builtin/index.js.map +++ b/dist/src/builtin/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/builtin/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAAmD;AACnD,wCAAuC;AACvC,sCAAqC;AACrC,wCAAuC;AACvC,kCAAiC;AAEjC,sCAAkC;AAClC,8CAAmD;AAwBvB,0BAxBpB,sBAAe,CAwBoB;AAvB3C,4CAAoC;AAEpC,SAAe,IAAI;;QACf,SAAS,CAAC,IAAI,EAAE,CAAA;QAEhB,MAAM,WAAW,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC;gBACpD,OA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AAO,CAAC,CAAC,CAAA,EAAE;YACnB,IAAG,CAAC,CAAC,SAAS,KAAG,UAAU;gBAAE,UAAU,CAAC,IAAI,EAAE,CAAA;YAC9C,IAAG,CAAC,CAAC,SAAS,KAAG,UAAU;gBAAE,OAAO,CAAC,IAAI,EAAE,CAAA;QAC/C,CAAC,CAAC,CAAA;IACN,CAAC;CAAA;AAQO,oBAAI;AANZ,SAAS,cAAc,CAAC,GAAO;IAC3B,UAAU,CAAC,GAAE,EAAE;QACX,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,sBAAe,CAAC,GAAG,CAAC,CAAC,CAAA;IACpD,CAAC,EAAC,IAAI,CAAC,CAAA;AACX,CAAC;AAEY,wCAAc"} \ No newline at end of file diff --git a/dist/src/builtin/mother.js b/dist/src/builtin/mother.js index ae596d3..d3ead7d 100644 --- a/dist/src/builtin/mother.js +++ b/dist/src/builtin/mother.js @@ -36,11 +36,9 @@ const builtInBotNames = { loopout: 'LoopBot', }; function init() { - console.log("===== MOTHERBOT INIT"); const client = new Sphinx.Client(); client.login('_', api_1.finalAction); client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () { - console.log("===== MOTHER BOT GOT A MESSAGE"); const arr = (message.content && message.content.split(' ')) || []; if (arr.length < 2) return; diff --git a/dist/src/builtin/mother.js.map b/dist/src/builtin/mother.js.map index 520b91f..bc274b1 100644 --- a/dist/src/builtin/mother.js.map +++ b/dist/src/builtin/mother.js.map @@ -1 +1 @@ -{"version":3,"file":"mother.js","sourceRoot":"","sources":["../../../src/builtin/mother.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAAmD;AACnD,qCAAoC;AACpC,4CAAgD;AAChD,8CAA4D;AAC5D,6BAA4B;AAC5B,wCAAuC;AACvC,kCAAiC;AACjC,sCAAkC;AAClC,2CAA8B;AAC9B,4CAAoC;AAEpC,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,MAAM,GAAG,GAAG,OAAO,CAA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SACZ;IACH,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"mother.js","sourceRoot":"","sources":["../../../src/builtin/mother.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAAmD;AACnD,qCAAoC;AACpC,4CAAgD;AAChD,8CAA4D;AAC5D,6BAA4B;AAC5B,wCAAuC;AACvC,kCAAiC;AACjC,sCAAkC;AAClC,2CAA8B;AAC9B,4CAAoC;AAEpC,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AACjD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,SAAS;CACrB,CAAA;AAED,MAAM,kBAAkB,GAAG;IACzB,SAAS,EAAE;QACT,mBAAS,CAAC,aAAa,CAAC,OAAO;QAC/B,mBAAS,CAAC,aAAa,CAAC,UAAU;KACnC;CACF,CAAA;AAED,MAAM,eAAe,GAAG;IACtB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,SAAS;CACnB,CAAA;AAED,SAAgB,IAAI;IAElB,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;QAE7D,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAA;QACjE,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;YAAE,OAAM;QAC1B,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,MAA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CAAA;YAClE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;YACxB,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,YAAY,EAAE;gBACjC,OAAO,CAAC,CAAA;aACT;YACD,OAAO,IAAI,CAAA;SACZ;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/network/intercept.js b/dist/src/network/intercept.js index 13fe86f..5068ff5 100644 --- a/dist/src/network/intercept.js +++ b/dist/src/network/intercept.js @@ -36,7 +36,6 @@ function isBotMsg(msg, sentByMe) { return false; let didEmit = false; if (txt && txt.startsWith('/bot ')) { - console.log("===== BOT: /bot command detected"); builtin_1.builtinBotEmit(msg); didEmit = true; } diff --git a/dist/src/network/intercept.js.map b/dist/src/network/intercept.js.map index 7fc1cb7..106f57e 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,CA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AAM,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,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;SAC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AAC,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/index.ts b/src/builtin/index.ts index 15e89d7..c2fdcbd 100644 --- a/src/builtin/index.ts +++ b/src/builtin/index.ts @@ -24,7 +24,6 @@ async function init(){ function builtinBotEmit(msg:Msg){ setTimeout(()=>{ - console.log("===== BUILT IN BOT EMIT",buildBotPayload(msg)) SphinxBot._emit('message', buildBotPayload(msg)) },1200) } diff --git a/src/builtin/mother.ts b/src/builtin/mother.ts index 1ca61f3..2f2a6d2 100644 --- a/src/builtin/mother.ts +++ b/src/builtin/mother.ts @@ -32,13 +32,11 @@ const builtInBotNames = { export function init() { - console.log("===== MOTHERBOT INIT") - const client = new Sphinx.Client() client.login('_', finalAction) client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => { - console.log("===== MOTHER BOT GOT A MESSAGE") + const arr = (message.content && message.content.split(' ')) || [] if (arr.length < 2) return if (arr[0] !== '/bot') return diff --git a/src/network/intercept.ts b/src/network/intercept.ts index 53ce042..0b1f121 100644 --- a/src/network/intercept.ts +++ b/src/network/intercept.ts @@ -29,7 +29,6 @@ export async function isBotMsg(msg: Msg, sentByMe: boolean): Promise { let didEmit = false if (txt && txt.startsWith('/bot ')) { - console.log("===== BOT: /bot command detected") builtinBotEmit(msg) didEmit = true } From 69351fc90415e126a60a2b7cf8a682573b2c3a38 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 30 Nov 2020 14:32:18 -0800 Subject: [PATCH 10/10] speed in chat meta --- dist/src/controllers/feed.js | 1 + dist/src/controllers/feed.js.map | 2 +- src/controllers/feed.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dist/src/controllers/feed.js b/dist/src/controllers/feed.js index c43246c..7e48605 100644 --- a/dist/src/controllers/feed.js +++ b/dist/src/controllers/feed.js @@ -32,6 +32,7 @@ exports.streamFeed = (req, res) => __awaiter(void 0, void 0, void 0, function* ( itemID: meta.itemID, ts: meta.ts || 0, sats_per_minute: amount || 0, + speed: meta.speed || '1' }; const chat = yield models_1.models.Chat.findOne({ where: { id: chat_id } }); if (!chat) { diff --git a/dist/src/controllers/feed.js.map b/dist/src/controllers/feed.js.map index b4f87dc..9a3a692 100644 --- a/dist/src/controllers/feed.js.map +++ b/dist/src/controllers/feed.js.map @@ -1 +1 @@ -{"version":3,"file":"feed.js","sourceRoot":"","sources":["../../../src/controllers/feed.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sCAAkC;AAClC,sCAAqC;AACrC,sCAA+C;AAC/C,4CAAoC;AAevB,QAAA,UAAU,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC3C,MAAM,EACJ,YAAY,EACZ,MAAM,EACN,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,GAMG,GAAG,CAAC,IAA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CAAC,aAAa,CAAC,OAAO;oBACrC,MAAM,EAAE,CAAC;oBACT,MAAM;oBACN,UAAU,EAAE,MAAM,GAAG,IAAI;oBACzB,WAAW,EAAE,EAAE;oBACf,IAAI;oBACJ,cAAc,EAAE,IAAI,IAAI,EAAE;oBAC1B,MAAM,EAAE,mBAAS,CAAC,QAAQ,CAAC,SAAS;oBACpC,SAAS,EAAE,IAAI;oBACf,SAAS,EAAE,IAAI;iBAChB,CAAC,CAAA;gBACF,SAAS,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,CAAA;YACxC,CAAC;YACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACjB,SAAS,CAAC,KAAK,CAAC,CAAA;YAClB,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;CAAA;AAlCD,4CAkCC;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":"feed.js","sourceRoot":"","sources":["../../../src/controllers/feed.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sCAAkC;AAClC,sCAAqC;AACrC,sCAA+C;AAC/C,4CAAoC;AAgBvB,QAAA,UAAU,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC3C,MAAM,EACJ,YAAY,EACZ,MAAM,EACN,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,GAMG,GAAG,CAAC,IAAI,CAAA;IAEZ,IAAI,CAAC,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE;QAC1C,OAAO,aAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;KACvC;IAED,IAAI,WAAW,EAAE;QACf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EAAE;oBACf,IAAI;oBACJ,cAAc,EAAE,IAAI,IAAI,EAAE;oBAC1B,MAAM,EAAE,mBAAS,CAAC,QAAQ,CAAC,SAAS;oBACpC,SAAS,EAAE,IAAI;oBACf,SAAS,EAAE,IAAI;iBAChB,CAAC,CAAA;gBACF,SAAS,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,CAAA;YACxC,CAAC;YACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACjB,SAAS,CAAC,KAAK,CAAC,CAAA;YAClB,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;CAAA;AAlCD,4CAkCC;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/controllers/feed.ts b/src/controllers/feed.ts index cde7a14..d9d36cc 100644 --- a/src/controllers/feed.ts +++ b/src/controllers/feed.ts @@ -8,6 +8,7 @@ export interface ChatMeta { itemID: number, ts: number, sats_per_minute: number, + speed?: string, } type DestinationType = 'wallet' | 'node' @@ -49,6 +50,7 @@ export const streamFeed = async (req, res) => { itemID: meta.itemID, ts: meta.ts || 0, sats_per_minute: amount || 0, + speed: meta.speed || '1' } const chat = await models.Chat.findOne({ where: { id: chat_id } }) if (!chat) {