From 1dca6ab3c5544f2b2f08a79ef6dc38359248227c Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 3 Sep 2020 22:10:13 -0700 Subject: [PATCH] parse commands --- api/bots/index.ts | 17 +++---------- api/bots/mother.ts | 38 +++++++++++++++++++---------- api/controllers/actions.ts | 12 ++++----- dist/api/bots/index.js | 18 +++----------- dist/api/bots/index.js.map | 2 +- dist/api/bots/mother.js | 32 +++++++++++++++++------- dist/api/bots/mother.js.map | 2 +- dist/api/controllers/actions.js | 12 ++++----- dist/api/controllers/actions.js.map | 2 +- package-lock.json | 6 ++--- package.json | 2 +- 11 files changed, 73 insertions(+), 70 deletions(-) diff --git a/api/bots/index.ts b/api/bots/index.ts index b336f87..04d1268 100644 --- a/api/bots/index.ts +++ b/api/bots/index.ts @@ -1,3 +1,4 @@ +// import * as Sphinx from '../../../sphinx-bot' import * as Sphinx from 'sphinx-bot' import * as MotherBot from './mother' @@ -5,20 +6,8 @@ function init(){ MotherBot.init() } -function emit(text, chatUUID){ - const arr = text.split(' ') - if(arr.length<2) return false - // const cmd = arr[1] - console.log('===> EMIT BOT MSG',{text,chatUUID}) - Sphinx.EE.emit('message',{text,chatUUID}) - // switch(cmd) { - // case 'install': - // if(arr.length<3) return false - // // installBot(arr[2], botInTribe) - // return true - // default: - // Sphinx.EE.emit('message',cmd,chatUUID) - // } +function emit(content, chatUUID){ + Sphinx._emit('message',{content,chatUUID}) } export {init,emit,MotherBot} diff --git a/api/bots/mother.ts b/api/bots/mother.ts index 679ad45..c9a6a9f 100644 --- a/api/bots/mother.ts +++ b/api/bots/mother.ts @@ -1,23 +1,35 @@ +// import * as Sphinx from '../../../sphinx-bot' import * as Sphinx from 'sphinx-bot' -import {finalAction} from '../controllers/actions' +import { finalAction } from '../controllers/actions' const msg_types = Sphinx.MSG_TYPE export function init() { - + const client = new Sphinx.Client() client.login('_', finalAction) - client.on(msg_types.MESSAGE, async (message:Sphinx.Message) => { - console.log("INCOMING MSG",message) + client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => { + console.log("INCOMING MSG", message.content) + const arr = message.content.split(' ') + if (arr.length < 2) return + const cmd = arr[1] + switch (cmd) { - const embed = new Sphinx.MessageEmbed() - .setAuthor('MotherBot') - .setTitle('Bot Commands:') - .addFields([ - {name:'Install a new bot',value:'/bot install {BOTNAME}'}, - {name:'Help',value:'/bot help'} - ]) - - message.channel.send({ embed }) + case 'install': + if (arr.length < 3) return + console.log("INSTALL", arr[2]) + // installBot(arr[2], botInTribe) + return true + + default: + const embed = new Sphinx.MessageEmbed() + .setAuthor('MotherBot') + .setTitle('Bot Commands:') + .addFields([ + { name: 'Install a new bot', value: '/bot install {BOTNAME}' }, + { name: 'Help', value: '/bot help' } + ]) + message.channel.send({ embed }) + } }) } diff --git a/api/controllers/actions.ts b/api/controllers/actions.ts index bb70d27..4a87521 100644 --- a/api/controllers/actions.ts +++ b/api/controllers/actions.ts @@ -20,7 +20,7 @@ export interface Action { botName?: string amount?: number pubkey?: string - text?: string + content?: string } export async function processAction(req, res) { @@ -48,7 +48,7 @@ export async function processAction(req, res) { } const a:Action = { - action, pubkey, text, amount, + action, pubkey, content:text, amount, botName:bot.name, chatUUID: chat.uuid } @@ -61,7 +61,7 @@ export async function processAction(req, res) { } export async function finalAction(a:Action){ - const {action,pubkey,amount,text,botName,chatUUID} = a + const {action,pubkey,amount,content,botName,chatUUID} = a if (action === 'keysend') { console.log('=> BOT KEYSEND') @@ -84,14 +84,14 @@ export async function finalAction(a:Action){ } else if (action === 'broadcast') { console.log('=> BOT BROADCAST') - if (!chatUUID || !text) throw 'no chatID or text' + if (!chatUUID || !content) throw 'no chatID or content' const owner = await models.Contact.findOne({ where: { isOwner: true } }) const theChat = await models.Chat.findOne({ where: { uuid: chatUUID } }) if (!theChat || !owner) throw 'no chat' if (!theChat.type === constants.chat_types.tribe) throw 'not a tribe' - const encryptedForMeText = rsa.encrypt(owner.contactKey, text) - const encryptedText = rsa.encrypt(theChat.groupKey, text) + const encryptedForMeText = rsa.encrypt(owner.contactKey, content) + const encryptedText = rsa.encrypt(theChat.groupKey, content) const textMap = { 'chat': encryptedText } var date = new Date(); date.setMilliseconds(0) diff --git a/dist/api/bots/index.js b/dist/api/bots/index.js index 2037dbe..727f558 100644 --- a/dist/api/bots/index.js +++ b/dist/api/bots/index.js @@ -1,5 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +// import * as Sphinx from '../../../sphinx-bot' const Sphinx = require("sphinx-bot"); const MotherBot = require("./mother"); exports.MotherBot = MotherBot; @@ -7,21 +8,8 @@ function init() { MotherBot.init(); } exports.init = init; -function emit(text, chatUUID) { - const arr = text.split(' '); - if (arr.length < 2) - return false; - // const cmd = arr[1] - console.log('===> EMIT BOT MSG', { text, chatUUID }); - Sphinx.EE.emit('message', { text, chatUUID }); - // switch(cmd) { - // case 'install': - // if(arr.length<3) return false - // // installBot(arr[2], botInTribe) - // return true - // default: - // Sphinx.EE.emit('message',cmd,chatUUID) - // } +function emit(content, chatUUID) { + Sphinx._emit('message', { content, chatUUID }); } exports.emit = emit; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/api/bots/index.js.map b/dist/api/bots/index.js.map index c00b270..0d3f2ed 100644 --- a/dist/api/bots/index.js.map +++ b/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;AAsBnB,8BAAS;AApB3B,SAAS,IAAI;IACT,SAAS,CAAC,IAAI,EAAE,CAAA;AACpB,CAAC;AAkBO,oBAAI;AAhBZ,SAAS,IAAI,CAAC,IAAI,EAAE,QAAQ;IACxB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC3B,IAAG,GAAG,CAAC,MAAM,GAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAC7B,qBAAqB;IACrB,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,CAAA;IAChD,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,EAAC,EAAC,IAAI,EAAC,QAAQ,EAAC,CAAC,CAAA;IACzC,gBAAgB;IAChB,oBAAoB;IACpB,oCAAoC;IACpC,wCAAwC;IACxC,kBAAkB;IAClB,aAAa;IACb,6CAA6C;IAC7C,KAAK;AACT,CAAC;AAEY,oBAAI"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/bots/index.ts"],"names":[],"mappings":";;AAAA,gDAAgD;AAChD,qCAAoC;AACpC,sCAAqC;AAUnB,8BAAS;AAR3B,SAAS,IAAI;IACT,SAAS,CAAC,IAAI,EAAE,CAAA;AACpB,CAAC;AAMO,oBAAI;AAJZ,SAAS,IAAI,CAAC,OAAO,EAAE,QAAQ;IAC3B,MAAM,CAAC,KAAK,CAAC,SAAS,EAAC,EAAC,OAAO,EAAC,QAAQ,EAAC,CAAC,CAAA;AAC9C,CAAC;AAEY,oBAAI"} \ No newline at end of file diff --git a/dist/api/bots/mother.js b/dist/api/bots/mother.js index 2b50f37..fa7ae31 100644 --- a/dist/api/bots/mother.js +++ b/dist/api/bots/mother.js @@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; Object.defineProperty(exports, "__esModule", { value: true }); +// import * as Sphinx from '../../../sphinx-bot' const Sphinx = require("sphinx-bot"); const actions_1 = require("../controllers/actions"); const msg_types = Sphinx.MSG_TYPE; @@ -16,15 +17,28 @@ function init() { const client = new Sphinx.Client(); client.login('_', actions_1.finalAction); client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () { - console.log("INCOMING MSG", message); - const embed = new Sphinx.MessageEmbed() - .setAuthor('MotherBot') - .setTitle('Bot Commands:') - .addFields([ - { name: 'Install a new bot', value: '/bot install {BOTNAME}' }, - { name: 'Help', value: '/bot help' } - ]); - message.channel.send({ embed }); + console.log("INCOMING MSG", message.content); + const arr = message.content.split(' '); + if (arr.length < 2) + return; + const cmd = arr[1]; + switch (cmd) { + case 'install': + if (arr.length < 3) + return; + console.log("INSTALL", arr[2]); + // installBot(arr[2], botInTribe) + return true; + default: + const embed = new Sphinx.MessageEmbed() + .setAuthor('MotherBot') + .setTitle('Bot Commands:') + .addFields([ + { name: 'Install a new bot', value: '/bot install {BOTNAME}' }, + { name: 'Help', value: '/bot help' } + ]); + message.channel.send({ embed }); + } })); } exports.init = init; diff --git a/dist/api/bots/mother.js.map b/dist/api/bots/mother.js.map index 6592e13..c4f5729 100644 --- a/dist/api/bots/mother.js.map +++ b/dist/api/bots/mother.js.map @@ -1 +1 @@ -{"version":3,"file":"mother.js","sourceRoot":"","sources":["../../../api/bots/mother.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAAoC;AACpC,oDAAkD;AAClD,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,SAAgB,IAAI;IAElB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAA;IAClC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,qBAAW,CAAC,CAAA;IAE9B,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,CAAO,OAAsB,EAAE,EAAE;QAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,EAAC,OAAO,CAAC,CAAA;QAEnC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE;aACpC,SAAS,CAAC,WAAW,CAAC;aACtB,QAAQ,CAAC,eAAe,CAAC;aACzB,SAAS,CAAC;YACT,EAAC,IAAI,EAAC,mBAAmB,EAAC,KAAK,EAAC,wBAAwB,EAAC;YACzD,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,WAAW,EAAC;SAChC,CAAC,CAAA;QAEJ,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;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AA;gBACJ,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;SAClC;IACH,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC;AA3BD,oBA2BC"} \ No newline at end of file diff --git a/dist/api/controllers/actions.js b/dist/api/controllers/actions.js index 32fe606..01fe397 100644 --- a/dist/api/controllers/actions.js +++ b/dist/api/controllers/actions.js @@ -48,7 +48,7 @@ function processAction(req, res) { return res_1.failure(res, 'no action'); } const a = { - action, pubkey, text, amount, + action, pubkey, content: text, amount, botName: bot.name, chatUUID: chat.uuid }; try { @@ -63,7 +63,7 @@ function processAction(req, res) { exports.processAction = processAction; function finalAction(a) { return __awaiter(this, void 0, void 0, function* () { - const { action, pubkey, amount, text, botName, chatUUID } = a; + const { action, pubkey, amount, content, botName, chatUUID } = a; if (action === 'keysend') { console.log('=> BOT KEYSEND'); if (!(pubkey && pubkey.length === 66 && amount)) { @@ -86,16 +86,16 @@ function finalAction(a) { } else if (action === 'broadcast') { console.log('=> BOT BROADCAST'); - if (!chatUUID || !text) - throw 'no chatID or text'; + if (!chatUUID || !content) + throw 'no chatID or content'; const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); const theChat = yield models_1.models.Chat.findOne({ where: { uuid: chatUUID } }); if (!theChat || !owner) throw 'no chat'; if (!theChat.type === constants.chat_types.tribe) throw 'not a tribe'; - const encryptedForMeText = rsa.encrypt(owner.contactKey, text); - const encryptedText = rsa.encrypt(theChat.groupKey, text); + const encryptedForMeText = rsa.encrypt(owner.contactKey, content); + const encryptedText = rsa.encrypt(theChat.groupKey, content); const textMap = { 'chat': encryptedText }; var date = new Date(); date.setMilliseconds(0); diff --git a/dist/api/controllers/actions.js.map b/dist/api/controllers/actions.js.map index 4af1748..6748e2f 100644 --- a/dist/api/controllers/actions.js.map +++ b/dist/api/controllers/actions.js.map @@ -1 +1 @@ -{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../api/controllers/actions.ts"],"names":[],"m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C,CAAA;SAEL;aAAM;YACH,MAAM,WAAW,CAAA;SACpB;IACL,CAAC;CAAA;AAtED,kCAsEC"} \ No newline at end of file +{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../api/controllers/actions.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAAqC;AACrC,sCAAkC;AAClC,oCAAmC;AACnC,qCAAoC;AACpC,2CAA0C;AAC1C,0CAAyC;AACzC,sCAA+C;AAE/C;;;EAGE;AAEF,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAW9E,SAAsB,aAAa,CAAC,GAAG,EAAE,GAAG;;QACxC,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,CAAA;QACnB,IAAI,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACpE,IAAI,EAAE,uDAAuD;gBACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;gBACzD,IAAI,QAAQ;oBAAE,IAAI,GAAG,QAAQ,CAAA;aAChC;YAAC,OAAO,CAAC,EAAE;gBACR,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;gBACd,OAAO,aAAO,CAAC,GAAG,EAAE,mCAAmC,CAAC,CAAA;aAC3D;SACJ;QACD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;QACjE,MAAM,GAAG,GAAG,MAAM,eAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;QAC/D,IAA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ACrC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gBAClC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oBACX,MAAM,CAAC,CAAA;gBACX,CAAC;aACJ,CAAC,CAAA;SAEL;aAAM;YACH,MAAM,WAAW,CAAA;SACpB;IACL,CAAC;CAAA;AAtED,kCAsEC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 37297a8..7cd677c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10876,9 +10876,9 @@ } }, "sphinx-bot": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/sphinx-bot/-/sphinx-bot-0.1.7.tgz", - "integrity": "sha512-sxo9/03t2u9+PXMArBXbDlFiD3slm5VElTVWaDaiQ0AMFPgVpZhXvmJcaWQ93kjld3uKVTaC3u9a7k4Iuisg0Q==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/sphinx-bot/-/sphinx-bot-0.1.8.tgz", + "integrity": "sha512-R840gjIrYJQqK5AdIesLhj+S1q1/yKgLAsrS6EBsa/CtFplEynlv2Jq8g5N68yLXmD0VQ2Q+NX3aSF7zGQF3MA==", "requires": { "eventemitter3": "^4.0.7" }, diff --git a/package.json b/package.json index efd80fd..7d3eeeb 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "short-uuid": "^3.1.1", "sjcl": "^1.0.8", "socket.io": "^2.3.0", - "sphinx-bot": "^0.1.7", + "sphinx-bot": "^0.1.8", "tail": "^2.0.3", "ts-node": "^8.5.4", "tsc": "^1.20150623.0",