Browse Source

bot name as sender alias in final mqtt forward

push-params
Evan Feenstra 4 years ago
parent
commit
96b8520072
  1. 4
      api/controllers/bots.ts
  2. 4
      dist/api/controllers/bots.js
  3. 2
      dist/api/controllers/bots.js.map

4
api/controllers/bots.ts

@ -223,9 +223,9 @@ export async function receiveBotRes(payload) {
const amount = dat.message.amount||0
const msg_uuid = dat.message.uuid||''
const content = dat.message.content
const botName = dat.bot_name
const action = dat.action
const bot_name = dat.bot_name
const sender_alias = dat.sender.alias
if(!chat_uuid) return console.log('=> receiveBotRes Error no chat_uuid')
const chat = await models.Chat.findOne({where:{uuid:chat_uuid}})
@ -263,7 +263,7 @@ export async function receiveBotRes(payload) {
status: constants.statuses.confirmed,
createdAt: date,
updatedAt: date,
senderAlias: botName || 'Bot',
senderAlias: sender_alias || 'Bot',
}
const message = await models.Message.create(msg)
socket.sendJson({

4
dist/api/controllers/bots.js

@ -231,9 +231,9 @@ function receiveBotRes(payload) {
const amount = dat.message.amount || 0;
const msg_uuid = dat.message.uuid || '';
const content = dat.message.content;
const botName = dat.bot_name;
const action = dat.action;
const bot_name = dat.bot_name;
const sender_alias = dat.sender.alias;
if (!chat_uuid)
return console.log('=> receiveBotRes Error no chat_uuid');
const chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } });
@ -271,7 +271,7 @@ function receiveBotRes(payload) {
status: constants.statuses.confirmed,
createdAt: date,
updatedAt: date,
senderAlias: botName || 'Bot',
senderAlias: sender_alias || 'Bot',
};
const message = yield models_1.models.Message.create(msg);
socket.sendJson({

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

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save