聊天:军团消息中添加用户信息

This commit is contained in:
liangtongchuan
2021-03-17 18:27:34 +08:00
parent 94ca8614b4
commit 8498e091ab

View File

@@ -8,6 +8,7 @@ import { isArray, isString } from 'underscore';
import { pinus } from 'pinus';
import { resResult } from '../pubUtils/util';
import { BossInstanceType } from '../db/BossInstance';
import { getSimpleRoleInfo } from './roleService';
async function pushNormalHeroInfoBySource(roleId: string, roleName: string, serverId: number | string, source: number, heroInfo: Partial<HeroType>) {
const hero = pick(heroInfo, ['hName', 'hid', 'seqId', 'quality', 'star', 'starStage', 'colorStar', 'colorStarStage']);
@@ -38,7 +39,8 @@ export async function pushComBtlTeamMsg(teamCode: string, roleId: string, roleNa
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.TEAM, teamCode, type, source, content, targetRoleId, targetMsgCode);
if (!msgData) return null;
const channel = pinus.app.get('channelService').getChannel(teamCode);
channel.pushMessage(ON_GROUP_MSG_ROUTE, resResult(STATUS.SUCCESS, msgData));
const roleInfo = await getSimpleRoleInfo(msgData.roleId);
channel.pushMessage(ON_GROUP_MSG_ROUTE, resResult(STATUS.SUCCESS, { ...msgData, roleInfo }));
return msgData;
}