diff --git a/packages/engine-chronocat-api/src/api/guild/get.ts b/packages/engine-chronocat-api/src/api/guild/get.ts index 6757a5f..098a264 100644 --- a/packages/engine-chronocat-api/src/api/guild/get.ts +++ b/packages/engine-chronocat-api/src/api/guild/get.ts @@ -1,11 +1,20 @@ import type { ChronocatContext, Guild, GuildGetPayload } from '@chronocat/shell' +import { groupMap } from '../../globalVars' export const buildGuildGet = (_ctx: ChronocatContext) => async ({ guild_id }: GuildGetPayload): Promise => { - return { + const result: Guild = { id: guild_id, name: undefined as unknown as string, avatar: `https://p.qlogo.cn/gh/${guild_id}/${guild_id}/640`, } + + const group = groupMap[guild_id] + + if (group) { + result.name = group.groupName + } + + return result }