mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-30 15:30:09 +00:00
feat(_interactions): Support partial guild objects (#1142)
* feat: support partial guild objects * docs: use `@unstable`
This commit is contained in:
@@ -9,7 +9,7 @@ import type {
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild.ts';
|
||||
import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
@@ -118,7 +118,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
*/
|
||||
data?: Data;
|
||||
/**
|
||||
* The guild it was sent from
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild?: APIPartialInteractionGuild;
|
||||
/**
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
|
||||
@@ -283,6 +283,19 @@ export interface APIGuild extends APIPartialGuild {
|
||||
safety_alerts_channel_id: Snowflake | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
|
||||
*/
|
||||
export interface APIPartialInteractionGuild extends Pick<APIGuild, 'features' | 'id'> {
|
||||
/**
|
||||
* The preferred locale of a Community guild; used in guild discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @unstable https://github.com/discord/discord-api-docs/issues/6938
|
||||
* @default "en-US"
|
||||
*/
|
||||
locale: Locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild.ts';
|
||||
import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
@@ -118,7 +118,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
*/
|
||||
data?: Data;
|
||||
/**
|
||||
* The guild it was sent from
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild?: APIPartialInteractionGuild;
|
||||
/**
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
|
||||
@@ -283,6 +283,19 @@ export interface APIGuild extends APIPartialGuild {
|
||||
safety_alerts_channel_id: Snowflake | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
|
||||
*/
|
||||
export interface APIPartialInteractionGuild extends Pick<APIGuild, 'features' | 'id'> {
|
||||
/**
|
||||
* The preferred locale of a Community guild; used in guild discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @unstable https://github.com/discord/discord-api-docs/issues/6938
|
||||
* @default "en-US"
|
||||
*/
|
||||
locale: Locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel';
|
||||
import type { APIGuildMember } from '../guild';
|
||||
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild';
|
||||
import type { APIEntitlement } from '../monetization';
|
||||
import type { APIUser } from '../user';
|
||||
import type { InteractionType } from './responses';
|
||||
@@ -118,7 +118,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
*/
|
||||
data?: Data;
|
||||
/**
|
||||
* The guild it was sent from
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild?: APIPartialInteractionGuild;
|
||||
/**
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
|
||||
@@ -283,6 +283,19 @@ export interface APIGuild extends APIPartialGuild {
|
||||
safety_alerts_channel_id: Snowflake | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
|
||||
*/
|
||||
export interface APIPartialInteractionGuild extends Pick<APIGuild, 'features' | 'id'> {
|
||||
/**
|
||||
* The preferred locale of a Community guild; used in guild discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @unstable https://github.com/discord/discord-api-docs/issues/6938
|
||||
* @default "en-US"
|
||||
*/
|
||||
locale: Locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,7 @@ import type {
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel';
|
||||
import type { APIGuildMember } from '../guild';
|
||||
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild';
|
||||
import type { APIEntitlement } from '../monetization';
|
||||
import type { APIUser } from '../user';
|
||||
import type { InteractionType } from './responses';
|
||||
@@ -118,7 +118,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
*/
|
||||
data?: Data;
|
||||
/**
|
||||
* The guild it was sent from
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild?: APIPartialInteractionGuild;
|
||||
/**
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
|
||||
@@ -283,6 +283,19 @@ export interface APIGuild extends APIPartialGuild {
|
||||
safety_alerts_channel_id: Snowflake | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
|
||||
*/
|
||||
export interface APIPartialInteractionGuild extends Pick<APIGuild, 'features' | 'id'> {
|
||||
/**
|
||||
* The preferred locale of a Community guild; used in guild discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @unstable https://github.com/discord/discord-api-docs/issues/6938
|
||||
* @default "en-US"
|
||||
*/
|
||||
locale: Locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user