Browse Source

parse commands

push-params
Evan Feenstra 4 years ago
parent
commit
1dca6ab3c5
  1. 17
      api/bots/index.ts
  2. 38
      api/bots/mother.ts
  3. 12
      api/controllers/actions.ts
  4. 18
      dist/api/bots/index.js
  5. 2
      dist/api/bots/index.js.map
  6. 32
      dist/api/bots/mother.js
  7. 2
      dist/api/bots/mother.js.map
  8. 12
      dist/api/controllers/actions.js
  9. 2
      dist/api/controllers/actions.js.map
  10. 6
      package-lock.json
  11. 2
      package.json

17
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}

38
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 })
}
})
}

12
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)

18
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

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

@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/bots/index.ts"],"names":[],"mappings":";;AAAA,qCAAoC;AACpC,sCAAqC;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"}
{"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"}

32
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;

2
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,CAA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G,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;QAClB,QAAQ,GAAG,EAAE;YACX,KAAK,SAAS;gBACZ,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;oBAAE,OAAM;gBAC1B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;gBAC9B,iCAAiC;gBACjC,OAAO,IAAI,CAAA;YACb;gBACE,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE;qBACpC,SAAS,CAAC,WAAW,CAAC;qBACtB,QAAQ,CAAC,eAAe,CAAC;qBACzB,SAAS,CAAC;oBACT,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,wBAAwB,EAAE;oBAC9D,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE;iBACrC,CAAC,CAAA;gBACJ,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;SAClC;IACH,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC;AA3BD,oBA2BC"}

12
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);

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

@ -1 +1 @@
{"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,M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O,EAAE,OAAO,EAAE,KAAK,CAAC;aAC7D,CAAC,CAAA;YACF,MAAM,OAAO,CAAC,WAAW,CAAC;gBACtB,IAAI,EAAE,OAAO;gBACb,MAAM,kCAAO,KAAK,CAAC,UAAU,KAAE,KAAK,EAAE,EAAE,EAAC,YAAY,GAAE;gBACvD,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE;gBACjE,IAAI,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO;gBACrC,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"}

6
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"
},

2
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",

Loading…
Cancel
Save