From ffd4020e2a571515d2cb49628c80da0d71073ca2 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Wed, 9 Sep 2020 12:43:54 -0700 Subject: [PATCH] fix msg type in broadcast --- api/bots/btc.ts | 1 - api/controllers/actions.ts | 2 +- dist/api/bots/btc.js | 1 - dist/api/bots/btc.js.map | 2 +- dist/api/controllers/actions.js | 2 +- 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/api/bots/btc.ts b/api/bots/btc.ts index 61e964e..ba2ec52 100644 --- a/api/bots/btc.ts +++ b/api/bots/btc.ts @@ -21,7 +21,6 @@ export function init() { client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => { const arr = message.content.split(' ') - console.log("BTC MSG ARR",arr) if (arr.length < 2) return if (arr[0]!=='/btc') return const cmd = arr[1] diff --git a/api/controllers/actions.ts b/api/controllers/actions.ts index 4a87521..e150a32 100644 --- a/api/controllers/actions.ts +++ b/api/controllers/actions.ts @@ -120,7 +120,7 @@ export async function finalAction(a:Action){ chat: theChat, sender: { ...owner.dataValues, alias, id:botContactId }, message: { content: textMap, id: message.id, uuid: message.uuid }, - type: constants.message_types.message, + type: constants.message_types.bot_res, success: () => ({ success: true }), failure: (e) => { throw e diff --git a/dist/api/bots/btc.js b/dist/api/bots/btc.js index bc1a262..4ca083d 100644 --- a/dist/api/bots/btc.js +++ b/dist/api/bots/btc.js @@ -27,7 +27,6 @@ function init() { client.login('_', actions_1.finalAction); client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () { const arr = message.content.split(' '); - console.log("BTC MSG ARR", arr); if (arr.length < 2) return; if (arr[0] !== '/btc') diff --git a/dist/api/bots/btc.js.map b/dist/api/bots/btc.js.map index 5a41f8c..81126df 100644 --- a/dist/api/bots/btc.js.map +++ b/dist/api/bots/btc.js.map @@ -1 +1 @@ -{"version":3,"file":"btc.js","sourceRoot":"","sources":["../../../api/bots/btc.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAAoC;AACpC,oD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AC,CAAA,CAAC,CAAA;AACJ,CAAC;AApDD,oBAoDC;AAED,MAAM,MAAM,GAAG;;OAER,CAAA"} \ No newline at end of file diff --git a/dist/api/controllers/actions.js b/dist/api/controllers/actions.js index 01fe397..52e6437 100644 --- a/dist/api/controllers/actions.js +++ b/dist/api/controllers/actions.js @@ -124,7 +124,7 @@ function finalAction(a) { chat: theChat, sender: Object.assign(Object.assign({}, owner.dataValues), { alias, id: botContactId }), message: { content: textMap, id: message.id, uuid: message.uuid }, - type: constants.message_types.message, + type: constants.message_types.bot_res, success: () => ({ success: true }), failure: (e) => { throw e;