diff --git a/api/bots/index.ts b/api/bots/index.ts index 7460a7d..e7926ab 100644 --- a/api/bots/index.ts +++ b/api/bots/index.ts @@ -11,8 +11,10 @@ function builtinBotEmit(msg:Msg){ SphinxBot._emit('message', { channel:{ id: msg.chat.uuid, + send:function(){}, }, - content: msg.message.content + content: msg.message.content, + type: msg.type, }) } diff --git a/api/models/index.ts b/api/models/index.ts index 18e74ae..bb8f386 100644 --- a/api/models/index.ts +++ b/api/models/index.ts @@ -17,7 +17,7 @@ const config = require(path.join(__dirname,'../../config/config.json'))[env] const sequelize = new Sequelize({ ...config, - logging: process.env.SQL_LOG==='true' ? console.log : false, + logging: console.log,//process.env.SQL_LOG==='true' ? console.log : false, models: [Chat,Contact,Invite,Message,Subscription,MediaKey,ChatMember,Timer,Bot,ChatBot,BotMember] }) const models = sequelize.models diff --git a/dist/api/bots/index.js b/dist/api/bots/index.js index dc7c235..1b28d91 100644 --- a/dist/api/bots/index.js +++ b/dist/api/bots/index.js @@ -11,8 +11,10 @@ function builtinBotEmit(msg) { SphinxBot._emit('message', { channel: { id: msg.chat.uuid, + send: function () { }, }, - content: msg.message.content + content: msg.message.content, + type: msg.type, }); } exports.builtinBotEmit = builtinBotEmit; diff --git a/dist/api/bots/index.js.map b/dist/api/bots/index.js.map index 8176f5f..a194380 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,mDAAmD;AACnD,wCAAuC;AACvC,sCAAqC;AAGrC,SAAS,IAAI;IACT,SAAS,CAAC,IAAI,EAAE,CAAA;AACpB,CAAC;AAWO,oBAAI;AATZ,SAAS,cAAc,CAAC,GAAO;IAC3B,SAAS,CAAC,KAAK,CAAC,SAAS,EAAqB;QAC1C,OAAO,EAAC;YACJ,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI;SACpB;QACD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO;KAC/B,CAAC,CAAA;AACN,CAAC;AAEY,wCAAc"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/bots/index.ts"],"names":[],"mappings":";;AAAA,mDAAmD;AACnD,wCAAuC;AACvC,sCAAqC;AAGrC,SAAS,IAAI;IACT,SAAS,CAAC,IAAI,EAAE,CAAA;AACpB,CAAC;AAaO,oBAAI;AAXZ,SAAS,cAAc,CAAC,GAAO;IAC3B,SAAS,CAAC,KAAK,CAAC,SAAS,EAAqB;QAC1C,OAAO,EAAC;YACJ,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI;YACjB,IAAI,EAAC,cAAW,CAAC;SACpB;QACD,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO;QAC5B,IAAI,EAAE,GAAG,CAAC,IAAI;KACjB,CAAC,CAAA;AACN,CAAC;AAEY,wCAAc"} \ No newline at end of file diff --git a/dist/api/models/index.js b/dist/api/models/index.js index e879627..094a33e 100644 --- a/dist/api/models/index.js +++ b/dist/api/models/index.js @@ -15,7 +15,7 @@ const chatBot_1 = require("./ts/chatBot"); const botMember_1 = require("./ts/botMember"); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/config.json'))[env]; -const sequelize = new sequelize_typescript_1.Sequelize(Object.assign(Object.assign({}, config), { logging: process.env.SQL_LOG === 'true' ? console.log : false, models: [chat_1.default, contact_1.default, invite_1.default, message_1.default, subscription_1.default, mediaKey_1.default, chatMember_1.default, timer_1.default, bot_1.default, chatBot_1.default, botMember_1.default] })); +const sequelize = new sequelize_typescript_1.Sequelize(Object.assign(Object.assign({}, config), { logging: console.log, models: [chat_1.default, contact_1.default, invite_1.default, message_1.default, subscription_1.default, mediaKey_1.default, chatMember_1.default, timer_1.default, bot_1.default, chatBot_1.default, botMember_1.default] })); exports.sequelize = sequelize; const models = sequelize.models; exports.models = models; diff --git a/dist/api/models/index.js.map b/dist/api/models/index.js.map index 8a33fef..2342fe1 100644 --- a/dist/api/models/index.js.map +++ b/dist/api/models/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/models/index.ts"],"names":[],"mappings":";;AAAA,+DAA+C;AAC/C,6BAA4B;AAC5B,oCAA4B;AAC5B,0CAAkC;AAClC,wCAAgC;AAChC,0CAAkC;AAClC,oDAA4C;AAC5C,4CAAoC;AACpC,gDAAwC;AACxC,sCAA8B;AAC9B,kCAA0B;AAC1B,0CAAkC;AAClC,8CAAsC;AAEtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,IAAI,gCAAS,iCAC1B,MAAM,KACT,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAC3D,MAAM,EAAE,CAAC,cAAI,EAAC,iBAAO,EAAC,gBAAM,EAAC,iBAAO,EAAC,sBAAY,EAAC,kBAAQ,EAAC,oBAAU,EAAC,eAAK,EAAC,aAAG,EAAC,iBAAO,EAAC,mBAAS,CAAC,IAClG,CAAA;AAIA,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/models/index.ts"],"names":[],"mappings":";;AAAA,+DAA+C;AAC/C,6BAA4B;AAC5B,oCAA4B;AAC5B,0CAAkC;AAClC,wCAAgC;AAChC,0CAAkC;AAClC,oDAA4C;AAC5C,4CAAoC;AACpC,gDAAwC;AACxC,sCAA8B;AAC9B,kCAA0B;AAC1B,0CAAkC;AAClC,8CAAsC;AAEtC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,IAAI,gCAAS,iCAC1B,MAAM,KACT,OAAO,EAAE,OAAO,CAAC,GAAG,EACpB,MAAM,EAAE,CAAC,cAAI,EAAC,iBAAO,EAAC,gBAAM,EAAC,iBAAO,EAAC,sBAAY,EAAC,kBAAQ,EAAC,oBAAU,EAAC,eAAK,EAAC,aAAG,EAAC,iBAAO,EAAC,mBAAS,CAAC,IAClG,CAAA;AAIA,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4e11518..c876819 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11203,9 +11203,9 @@ } }, "sphinx-bot": { - "version": "0.1.14", - "resolved": "https://registry.npmjs.org/sphinx-bot/-/sphinx-bot-0.1.14.tgz", - "integrity": "sha512-1eagFj8G/MozCOUQC6FIuGjzjLl5dJRRx6Qgjx2A7ax5tmp2m6SWszynIGIlZ1U14J2pMrmg4haHLIm3PQkWiA==", + "version": "0.1.19", + "resolved": "https://registry.npmjs.org/sphinx-bot/-/sphinx-bot-0.1.19.tgz", + "integrity": "sha512-tQiuAgoRbe1dTkVEcVo51xDJcugEKgezxME6WVFPPqr0ZxwdRpKo1CTr9Kxpm6oB+GSh4g4ilVLacqo13rVI2g==", "requires": { "eventemitter3": "^4.0.7", "isomorphic-dompurify": "^0.6.0" diff --git a/package.json b/package.json index bc8cee9..679f14c 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.14", + "sphinx-bot": "^0.1.19", "tail": "^2.0.3", "ts-node": "^8.5.4", "tsc": "^1.20150623.0",