feat(discovery): resolve message links into discoverable guilds (#3159)

This commit is contained in:
Hampus
2026-10-03 13:12:30 +02:00
committed by GitHub
parent 4e6b837ccc
commit 81d69c41f5
13 changed files with 504 additions and 10 deletions
@@ -50,6 +50,10 @@ export const GuildIdUserIdParam = GuildIdParam.extend(UserIdParam.shape);
export type GuildIdUserIdParam = z.infer<typeof GuildIdUserIdParam>;
export const GuildIdChannelIdParam = GuildIdParam.extend(ChannelIdParam.shape);
export type GuildIdChannelIdParam = z.infer<typeof GuildIdChannelIdParam>;
export const GuildIdRoleIdParam = GuildIdParam.extend({
role_id: SnowflakeType.describe('The ID of the role'),
});
@@ -100,6 +100,25 @@ export const DiscoveryGuildListResponse = z.object({
export type DiscoveryGuildListResponse = z.infer<typeof DiscoveryGuildListResponse>;
export const DiscoveryChannelPreviewResponse = z.object({
guild: z
.object({
id: SnowflakeStringType.describe('Guild ID'),
name: z.string().describe('Guild name'),
icon: z.string().nullable().describe('Guild icon hash'),
})
.describe('The discoverable guild the channel belongs to'),
channel: z
.object({
id: SnowflakeStringType.describe('Channel ID'),
name: z.string().nullable().describe('Channel name'),
type: z.number().describe('Channel type'),
})
.describe('A channel that new members can view'),
});
export type DiscoveryChannelPreviewResponse = z.infer<typeof DiscoveryChannelPreviewResponse>;
export const DiscoveryApplicationResponse = z.object({
guild_id: SnowflakeStringType.describe('Guild ID'),
guild_nsfw_level: NSFWLevelSchema.nullable().optional().describe('NSFW level of the guild'),