Skip to content

Commit

Permalink
feat(api): guild.get get name
Browse files Browse the repository at this point in the history
  • Loading branch information
ilharp committed Mar 10, 2024
1 parent 2800c7c commit 1311e1b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/engine-chronocat-api/src/api/guild/get.ts
Original file line number Diff line number Diff line change
@@ -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<Guild> => {
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
}

0 comments on commit 1311e1b

Please sign in to comment.