🐞 fix(gvg): gvg频道发送

This commit is contained in:
luying
2023-02-21 17:31:50 +08:00
parent 3eb6a1045f
commit e5b22dc936

View File

@@ -8,6 +8,7 @@ import { checkTask } from '../../../services/task/taskService';
import { RoleModel } from '../../../db/Role';
import { getFriendRelationType } from '../../../services/friendService';
import { GVGLeagueModel } from '../../../db/GVGLeague';
import { getGroupIdOfServer } from '../../../services/gvg/gvgService';
export default function (app: Application) {
@@ -37,6 +38,10 @@ export class ChatHandler {
let channelId = '';
if (channel === CHANNEL_PREFIX.WORLD) channelId = `${serverId}`;
if (channel === CHANNEL_PREFIX.GUILD) channelId = guildCode;
if (channel === CHANNEL_PREFIX.GVG) {
let groupId = await getGroupIdOfServer(serverId);
channelId = `${groupId}`;
}
if (channel == CHANNEL_PREFIX.LEAGUE) {
let myLeague = await GVGLeagueModel.findLeagueByGuild(guildCode);
if(!myLeague) return resResult(STATUS.GVG_NOT_JOIN_LEAGUE);