mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 02:40:08 +00:00
refactor: omit most omits (#1249)
This commit is contained in:
212
deno/gateway/v10.ts
generated
212
deno/gateway/v10.ts
generated
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../globals.ts';
|
||||
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway.ts';
|
||||
import type {
|
||||
APIApplication,
|
||||
APIApplicationCommandPermission,
|
||||
@@ -16,7 +15,6 @@ import type {
|
||||
APIGuildMember,
|
||||
APIGuildScheduledEvent,
|
||||
APIInteraction,
|
||||
APIMessage,
|
||||
APIRole,
|
||||
APIStageInstance,
|
||||
APISticker,
|
||||
@@ -25,8 +23,8 @@ import type {
|
||||
APIUnavailableGuild,
|
||||
APIUser,
|
||||
GatewayActivity,
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayPresenceUpdate,
|
||||
GatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
@@ -39,6 +37,16 @@ import type {
|
||||
APISoundboardSound,
|
||||
GuildChannelType,
|
||||
ThreadChannelType,
|
||||
APIBaseGuild,
|
||||
APIBaseGuildMember,
|
||||
APIBaseVoiceState,
|
||||
APIBaseVoiceGuildMember,
|
||||
APIGuildMemberJoined,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberUser,
|
||||
GatewayGuildMembersChunkPresence,
|
||||
APIBaseMessage,
|
||||
} from '../payloads/v10/mod.ts';
|
||||
import type { ReactionType } from '../rest/v10/mod.ts';
|
||||
import type { _Nullable } from '../utils/internals.ts';
|
||||
@@ -789,9 +797,7 @@ export type GatewayEntitlementModifyDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
|
||||
*/
|
||||
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
|
||||
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
|
||||
};
|
||||
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
|
||||
@@ -873,7 +879,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
voice_states: Omit<APIVoiceState, 'guild_id'>[];
|
||||
voice_states: APIBaseVoiceState[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
@@ -953,7 +959,7 @@ export type GatewayGuildDeleteDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
|
||||
*/
|
||||
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
|
||||
export interface GatewayGuildDeleteDispatchData extends APIBaseGuild {
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*
|
||||
@@ -1127,15 +1133,18 @@ export type GatewayGuildMemberUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> &
|
||||
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
|
||||
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
|
||||
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
};
|
||||
export interface GatewayGuildMemberUpdateDispatchData
|
||||
extends _Nullable<APIGuildMemberJoined>,
|
||||
APIBaseGuildMember,
|
||||
Partial<APIBaseVoiceGuildMember>,
|
||||
Partial<APIFlaggedGuildMember>,
|
||||
Required<APIGuildMemberAvatar>,
|
||||
Required<APIGuildMemberUser> {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
|
||||
@@ -1145,11 +1154,6 @@ export type GatewayGuildMembersChunkDispatch = _DataPayload<
|
||||
GatewayGuildMembersChunkDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export type GatewayGuildMembersChunkPresence = Omit<RawGatewayPresenceUpdate, 'guild_id'>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
|
||||
*/
|
||||
@@ -1597,7 +1601,7 @@ export type GatewayMessageCreateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
|
||||
*/
|
||||
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
|
||||
@@ -1610,7 +1614,24 @@ export type GatewayMessageUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
|
||||
|
||||
export interface APIGuildMemberNoUser
|
||||
extends APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIBaseVoiceGuildMember {}
|
||||
|
||||
export interface APIUserWithMember extends APIUser {
|
||||
/**
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMemberNoUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
|
||||
@@ -1628,17 +1649,13 @@ export interface GatewayMessageEventExtraFields {
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: Omit<APIGuildMember, 'user'>;
|
||||
member?: APIGuildMemberNoUser;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
mentions: APIUserWithMember[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1696,25 +1713,74 @@ export interface GatewayMessageDeleteBulkDispatchData {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData {
|
||||
/**
|
||||
* The member who reacted if this happened in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
export type GatewayMessageReactionAddDispatch = _DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionAdd,
|
||||
GatewayMessageReactionAddDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
|
||||
export interface GatewayMessageReactionRemoveDispatchData {
|
||||
/**
|
||||
* The id of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The emoji used to react
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
|
||||
*/
|
||||
emoji: APIEmoji;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = _DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
GatewayMessageReactionRemoveDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
|
||||
@@ -1758,7 +1824,7 @@ export type GatewayPresenceUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
|
||||
export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
|
||||
@@ -1810,7 +1876,7 @@ export type GatewayThreadListSyncDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
|
||||
*/
|
||||
export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync;
|
||||
export type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
|
||||
@@ -2415,7 +2481,7 @@ export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' |
|
||||
// #endregion Sendable Payloads
|
||||
|
||||
// #region Shared
|
||||
export interface _BasePayload {
|
||||
export interface _BaseBasePayload {
|
||||
/**
|
||||
* Opcode for the payload
|
||||
*/
|
||||
@@ -2424,6 +2490,9 @@ export interface _BasePayload {
|
||||
* Event data
|
||||
*/
|
||||
d?: unknown;
|
||||
}
|
||||
|
||||
export interface _BasePayload {
|
||||
/**
|
||||
* Sequence number, used for resuming sessions and heartbeats
|
||||
*/
|
||||
@@ -2434,10 +2503,10 @@ export interface _BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
export type _NonDispatchPayload = Omit<_BasePayload, 's' | 't'> & {
|
||||
export interface _NonDispatchPayload extends _BaseBasePayload {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends _BasePayload {
|
||||
op: GatewayOpcodes.Dispatch;
|
||||
@@ -2445,57 +2514,10 @@ export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown>
|
||||
d: D;
|
||||
}
|
||||
|
||||
// This is not used internally anymore, just remains to be non-breaking
|
||||
export type GatewayMessageReactionData<E extends GatewayDispatchEvents, O extends string = never> = _DataPayload<
|
||||
E,
|
||||
Omit<
|
||||
{
|
||||
/**
|
||||
* The id of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The member who reacted if this happened in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The emoji used to react
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
|
||||
*/
|
||||
emoji: APIEmoji;
|
||||
/**
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
Omit<GatewayMessageReactionAddDispatchData, O>
|
||||
>;
|
||||
|
||||
export interface GatewayMessageReactionRemoveData {
|
||||
|
||||
212
deno/gateway/v9.ts
generated
212
deno/gateway/v9.ts
generated
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../globals.ts';
|
||||
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway.ts';
|
||||
import type {
|
||||
APIApplication,
|
||||
APIApplicationCommandPermission,
|
||||
@@ -16,7 +15,6 @@ import type {
|
||||
APIGuildMember,
|
||||
APIGuildScheduledEvent,
|
||||
APIInteraction,
|
||||
APIMessage,
|
||||
APIRole,
|
||||
APIStageInstance,
|
||||
APISticker,
|
||||
@@ -25,8 +23,8 @@ import type {
|
||||
APIUnavailableGuild,
|
||||
APIUser,
|
||||
GatewayActivity,
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayPresenceUpdate,
|
||||
GatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
@@ -39,6 +37,16 @@ import type {
|
||||
GuildChannelType,
|
||||
ThreadChannelType,
|
||||
APIEntitlement,
|
||||
APIBaseGuild,
|
||||
APIBaseGuildMember,
|
||||
APIBaseVoiceState,
|
||||
APIBaseVoiceGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberUser,
|
||||
APIGuildMemberAvatar,
|
||||
GatewayGuildMembersChunkPresence,
|
||||
APIBaseMessage,
|
||||
APIGuildMemberJoined,
|
||||
} from '../payloads/v9/mod.ts';
|
||||
import type { ReactionType } from '../rest/v9/mod.ts';
|
||||
import type { _Nullable } from '../utils/internals.ts';
|
||||
@@ -788,9 +796,7 @@ export type GatewayEntitlementModifyDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
|
||||
*/
|
||||
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
|
||||
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
|
||||
};
|
||||
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
|
||||
@@ -872,7 +878,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
voice_states: Omit<APIVoiceState, 'guild_id'>[];
|
||||
voice_states: APIBaseVoiceState[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
@@ -952,7 +958,7 @@ export type GatewayGuildDeleteDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
|
||||
*/
|
||||
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
|
||||
export interface GatewayGuildDeleteDispatchData extends APIBaseGuild {
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*
|
||||
@@ -1126,15 +1132,18 @@ export type GatewayGuildMemberUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> &
|
||||
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
|
||||
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
|
||||
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
};
|
||||
export interface GatewayGuildMemberUpdateDispatchData
|
||||
extends _Nullable<APIGuildMemberJoined>,
|
||||
APIBaseGuildMember,
|
||||
Partial<APIBaseVoiceGuildMember>,
|
||||
Partial<APIFlaggedGuildMember>,
|
||||
Required<APIGuildMemberUser>,
|
||||
Required<APIGuildMemberAvatar> {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
|
||||
@@ -1144,11 +1153,6 @@ export type GatewayGuildMembersChunkDispatch = _DataPayload<
|
||||
GatewayGuildMembersChunkDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export type GatewayGuildMembersChunkPresence = Omit<RawGatewayPresenceUpdate, 'guild_id'>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
|
||||
*/
|
||||
@@ -1596,7 +1600,7 @@ export type GatewayMessageCreateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
|
||||
*/
|
||||
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
|
||||
@@ -1609,7 +1613,24 @@ export type GatewayMessageUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
|
||||
|
||||
export interface APIGuildMemberNoUser
|
||||
extends APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIBaseVoiceGuildMember {}
|
||||
|
||||
export interface APIUserWithMember extends APIUser {
|
||||
/**
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMemberNoUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
|
||||
@@ -1627,17 +1648,13 @@ export interface GatewayMessageEventExtraFields {
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: Omit<APIGuildMember, 'user'>;
|
||||
member?: APIGuildMemberNoUser;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
mentions: APIUserWithMember[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1695,25 +1712,74 @@ export interface GatewayMessageDeleteBulkDispatchData {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData {
|
||||
/**
|
||||
* The member who reacted if this happened in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
export type GatewayMessageReactionAddDispatch = _DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionAdd,
|
||||
GatewayMessageReactionAddDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
|
||||
export interface GatewayMessageReactionRemoveDispatchData {
|
||||
/**
|
||||
* The id of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The emoji used to react
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
|
||||
*/
|
||||
emoji: APIEmoji;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = _DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
GatewayMessageReactionRemoveDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
|
||||
@@ -1757,7 +1823,7 @@ export type GatewayPresenceUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
|
||||
export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
|
||||
@@ -1809,7 +1875,7 @@ export type GatewayThreadListSyncDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
|
||||
*/
|
||||
export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync;
|
||||
export type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
|
||||
@@ -2414,7 +2480,8 @@ export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' |
|
||||
// #endregion Sendable Payloads
|
||||
|
||||
// #region Shared
|
||||
export interface _BasePayload {
|
||||
|
||||
export interface _BaseBasePayload {
|
||||
/**
|
||||
* Opcode for the payload
|
||||
*/
|
||||
@@ -2423,6 +2490,8 @@ export interface _BasePayload {
|
||||
* Event data
|
||||
*/
|
||||
d?: unknown;
|
||||
}
|
||||
export interface _BasePayload extends _BaseBasePayload {
|
||||
/**
|
||||
* Sequence number, used for resuming sessions and heartbeats
|
||||
*/
|
||||
@@ -2433,10 +2502,10 @@ export interface _BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
export type _NonDispatchPayload = Omit<_BasePayload, 's' | 't'> & {
|
||||
export interface _NonDispatchPayload extends _BaseBasePayload {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends _BasePayload {
|
||||
op: GatewayOpcodes.Dispatch;
|
||||
@@ -2444,57 +2513,10 @@ export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown>
|
||||
d: D;
|
||||
}
|
||||
|
||||
// This is not used internally anymore, just remains to be non-breaking
|
||||
export type GatewayMessageReactionData<E extends GatewayDispatchEvents, O extends string = never> = _DataPayload<
|
||||
E,
|
||||
Omit<
|
||||
{
|
||||
/**
|
||||
* The id of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The member who reacted if this happened in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The emoji used to react
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
|
||||
*/
|
||||
emoji: APIEmoji;
|
||||
/**
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
Omit<GatewayMessageReactionAddDispatchData, O>
|
||||
>;
|
||||
|
||||
export interface GatewayMessageReactionRemoveData {
|
||||
|
||||
15
deno/payloads/v10/_interactions/base.ts
generated
15
deno/payloads/v10/_interactions/base.ts
generated
@@ -9,7 +9,14 @@ import type {
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel.ts';
|
||||
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild.ts';
|
||||
import type {
|
||||
APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIPartialInteractionGuild,
|
||||
} from '../guild.ts';
|
||||
import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
@@ -253,7 +260,11 @@ export type APIInteractionDataResolvedChannel =
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
|
||||
export interface APIInteractionDataResolvedGuildMember
|
||||
extends APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
|
||||
5
deno/payloads/v10/_interactions/modalSubmit.ts
generated
5
deno/payloads/v10/_interactions/modalSubmit.ts
generated
@@ -1,4 +1,4 @@
|
||||
import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel.ts';
|
||||
import type { APIBaseComponent } from '../channel.ts';
|
||||
import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
@@ -13,8 +13,7 @@ export interface ModalSubmitComponent {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface ModalSubmitActionRowComponent
|
||||
extends Omit<APIActionRowComponent<APIComponentInModalActionRow>, 'components'> {
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: ModalSubmitComponent[];
|
||||
}
|
||||
|
||||
|
||||
136
deno/payloads/v10/channel.ts
generated
136
deno/payloads/v10/channel.ts
generated
@@ -13,10 +13,7 @@ import type { APIPoll } from './poll.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
export interface APIBasePartialChannel {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
@@ -27,12 +24,20 @@ export interface APIPartialChannel {
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
|
||||
*/
|
||||
type: ChannelType;
|
||||
}
|
||||
|
||||
export interface APINameableChannel {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel extends APIBasePartialChannel, APINameableChannel {}
|
||||
|
||||
/**
|
||||
* A channel obtained from fetching an invite.
|
||||
*/
|
||||
@@ -58,7 +63,7 @@ export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartia
|
||||
* This interface is used to allow easy extension for other channel types. While
|
||||
* also allowing `APIPartialChannel` to be used without breaking.
|
||||
*/
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIBasePartialChannel {
|
||||
type: T;
|
||||
flags?: ChannelFlags;
|
||||
}
|
||||
@@ -76,16 +81,7 @@ export type TextChannelType =
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
@@ -105,7 +101,22 @@ export interface APISortableChannel {
|
||||
position: number;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T>, APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
}
|
||||
|
||||
export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -137,9 +148,10 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
extends APITextBasedChannel<T>,
|
||||
APIGuildChannel<T>,
|
||||
APISortableChannel {
|
||||
APISortableChannel,
|
||||
APIPinChannel<T> {
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
@@ -162,7 +174,8 @@ export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.Gui
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
APISortableChannel,
|
||||
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
|
||||
APITextBasedChannel<T>,
|
||||
APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice or stage channel
|
||||
*/
|
||||
@@ -189,7 +202,7 @@ export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
|
||||
|
||||
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
|
||||
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>, APIPinChannel<T> {
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
@@ -198,14 +211,14 @@ export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBas
|
||||
recipients?: APIUser[];
|
||||
}
|
||||
|
||||
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
|
||||
export interface APIDMChannel extends APIDMChannelBase<ChannelType.DM> {
|
||||
/**
|
||||
* The name of the channel (always null for DM channels)
|
||||
*/
|
||||
name: null;
|
||||
}
|
||||
|
||||
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
|
||||
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -235,8 +248,9 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannelType>
|
||||
extends Omit<APITextBasedChannel<Type>, 'name'>,
|
||||
APIGuildChannel<Type> {
|
||||
extends APITextBasedChannel<Type>,
|
||||
APIGuildChannel<Type>,
|
||||
APIPinChannel<Type> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
@@ -529,18 +543,27 @@ export enum VideoQualityMode {
|
||||
Full,
|
||||
}
|
||||
|
||||
export interface APIMessageMentions {
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIMessage {
|
||||
export interface APIBaseMessageNoChannel {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
|
||||
*
|
||||
@@ -577,16 +600,6 @@ export interface APIMessage {
|
||||
* Whether this message mentions everyone
|
||||
*/
|
||||
mention_everyone: boolean;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: APIUser[];
|
||||
/**
|
||||
* Roles specifically mentioned in this message
|
||||
*
|
||||
@@ -774,6 +787,21 @@ export interface APIMessage {
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIBaseMessage extends APIBaseMessageNoChannel {
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIMessage extends APIBaseMessage, APIMessageMentions {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}
|
||||
*/
|
||||
@@ -1701,28 +1729,31 @@ export interface APIActionRowComponent<T extends APIComponentInActionRow>
|
||||
components: T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
||||
/**
|
||||
* The label to be displayed on the button
|
||||
*/
|
||||
label?: string;
|
||||
export interface APIButtonBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
||||
/**
|
||||
* The style of the button
|
||||
*/
|
||||
style: Style;
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* The status of the button
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIButtonBase<Style> {
|
||||
/**
|
||||
* The label to be displayed on the button
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
}
|
||||
|
||||
export interface APIMessageComponentEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
@@ -1764,8 +1795,7 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
export interface APIButtonComponentWithSKUId extends APIButtonBase<ButtonStyle.Premium> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
|
||||
18
deno/payloads/v10/gateway.ts
generated
18
deno/payloads/v10/gateway.ts
generated
@@ -60,9 +60,9 @@ export interface APIGatewaySessionStartLimit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
export interface GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* The user presence is being updated for
|
||||
*
|
||||
@@ -72,10 +72,6 @@ export interface GatewayPresenceUpdate {
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: Partial<APIUser> & Pick<APIUser, 'id'>;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* Either "idle", "dnd", "online", or "offline"
|
||||
*/
|
||||
@@ -94,6 +90,16 @@ export interface GatewayPresenceUpdate {
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate extends GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
|
||||
*/
|
||||
|
||||
136
deno/payloads/v10/guild.ts
generated
136
deno/payloads/v10/guild.ts
generated
@@ -11,14 +11,17 @@ import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
|
||||
*/
|
||||
export interface APIUnavailableGuild {
|
||||
export interface APIBaseGuild {
|
||||
/**
|
||||
* Guild id
|
||||
*/
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
|
||||
*/
|
||||
export interface APIUnavailableGuild extends APIBaseGuild {
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
@@ -28,7 +31,7 @@ export interface APIUnavailableGuild {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-structure}
|
||||
*/
|
||||
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
|
||||
export interface APIPartialGuild extends APIBaseGuild {
|
||||
/**
|
||||
* Guild name (2-100 characters, excluding trailing and leading whitespace)
|
||||
*/
|
||||
@@ -71,6 +74,12 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code?: string | null;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,12 +264,6 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
/**
|
||||
* The nsfw level of the guild
|
||||
*
|
||||
@@ -641,57 +644,23 @@ export interface APIGuildWidgetSettings {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMember {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: APIUser;
|
||||
export interface APIBaseGuildMember {
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The member's guild banner hash
|
||||
*/
|
||||
banner?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/permissions#role-object}
|
||||
*/
|
||||
roles: Snowflake[];
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
/**
|
||||
* When the user started boosting the guild
|
||||
*
|
||||
* @see {@link https://support.discord.com/hc/articles/360028038352}
|
||||
*/
|
||||
premium_since?: string | null;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
/**
|
||||
* Guild member flags represented as a bit set
|
||||
*
|
||||
* @defaultValue `0`
|
||||
*/
|
||||
flags: GuildMemberFlags;
|
||||
/**
|
||||
* Whether the user has not yet passed the guild's Membership Screening requirements
|
||||
*
|
||||
@@ -710,6 +679,81 @@ export interface APIGuildMember {
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIFlaggedGuildMember {
|
||||
/**
|
||||
* Guild member flags represented as a bit set
|
||||
*
|
||||
* @defaultValue `0`
|
||||
*/
|
||||
flags: GuildMemberFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberJoined {
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberAvatar {
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The member's guild banner hash
|
||||
*/
|
||||
banner?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIBaseVoiceGuildMember {
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberUser {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMember
|
||||
extends APIBaseGuildMember,
|
||||
APIBaseVoiceGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIGuildMemberUser {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags}
|
||||
*/
|
||||
|
||||
49
deno/payloads/v10/poll.ts
generated
49
deno/payloads/v10/poll.ts
generated
@@ -4,22 +4,14 @@
|
||||
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
|
||||
*/
|
||||
export interface APIPoll {
|
||||
export interface APIBasePoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
}
|
||||
|
||||
export interface APIPollDefaults {
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*
|
||||
@@ -32,6 +24,20 @@ export interface APIPoll {
|
||||
* @defaultValue `PollLayoutType.Default`
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
|
||||
*/
|
||||
export interface APIPoll extends APIBasePoll, APIPollDefaults {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
@@ -64,20 +70,23 @@ export interface APIPollMedia {
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
export interface APIBasePollAnswer {
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
|
||||
*/
|
||||
export interface APIPollAnswer extends APIBasePollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure}
|
||||
*/
|
||||
|
||||
16
deno/payloads/v10/voice.ts
generated
16
deno/payloads/v10/voice.ts
generated
@@ -14,11 +14,7 @@ export type GatewayVoiceState = APIVoiceState;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
export interface APIBaseVoiceState {
|
||||
/**
|
||||
* The channel id this user is connected to
|
||||
*/
|
||||
@@ -71,6 +67,16 @@ export interface APIVoiceState {
|
||||
request_to_speak_timestamp: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
export interface APIVoiceState extends APIBaseVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-region-object}
|
||||
*/
|
||||
|
||||
15
deno/payloads/v9/_interactions/base.ts
generated
15
deno/payloads/v9/_interactions/base.ts
generated
@@ -9,7 +9,14 @@ import type {
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel.ts';
|
||||
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild.ts';
|
||||
import type {
|
||||
APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIPartialInteractionGuild,
|
||||
} from '../guild.ts';
|
||||
import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
@@ -256,7 +263,11 @@ export type APIInteractionDataResolvedChannel =
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
|
||||
export interface APIInteractionDataResolvedGuildMember
|
||||
extends APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
|
||||
5
deno/payloads/v9/_interactions/modalSubmit.ts
generated
5
deno/payloads/v9/_interactions/modalSubmit.ts
generated
@@ -1,4 +1,4 @@
|
||||
import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel.ts';
|
||||
import type { APIBaseComponent } from '../channel.ts';
|
||||
import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
@@ -13,8 +13,7 @@ export interface ModalSubmitComponent {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface ModalSubmitActionRowComponent
|
||||
extends Omit<APIActionRowComponent<APIComponentInModalActionRow>, 'components'> {
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: ModalSubmitComponent[];
|
||||
}
|
||||
|
||||
|
||||
136
deno/payloads/v9/channel.ts
generated
136
deno/payloads/v9/channel.ts
generated
@@ -13,10 +13,7 @@ import type { APIPoll } from './poll.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
export interface APIBasePartialChannel {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
@@ -27,12 +24,20 @@ export interface APIPartialChannel {
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
|
||||
*/
|
||||
type: ChannelType;
|
||||
}
|
||||
|
||||
export interface APINameableChannel {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel extends APIBasePartialChannel, APINameableChannel {}
|
||||
|
||||
/**
|
||||
* A channel obtained from fetching an invite.
|
||||
*/
|
||||
@@ -58,7 +63,7 @@ export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartia
|
||||
* This interface is used to allow easy extension for other channel types. While
|
||||
* also allowing `APIPartialChannel` to be used without breaking.
|
||||
*/
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIBasePartialChannel {
|
||||
type: T;
|
||||
flags?: ChannelFlags;
|
||||
}
|
||||
@@ -76,16 +81,7 @@ export type TextChannelType =
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
@@ -105,7 +101,22 @@ export interface APISortableChannel {
|
||||
position: number;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T>, APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
}
|
||||
|
||||
export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -137,9 +148,10 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
extends APITextBasedChannel<T>,
|
||||
APISortableChannel,
|
||||
APIGuildChannel<T> {
|
||||
APIGuildChannel<T>,
|
||||
APIPinChannel<T> {
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
@@ -162,7 +174,8 @@ export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.Gui
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
APISortableChannel,
|
||||
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
|
||||
APITextBasedChannel<T>,
|
||||
APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice or stage channel
|
||||
*/
|
||||
@@ -189,7 +202,7 @@ export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
|
||||
|
||||
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
|
||||
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>, APIPinChannel<T> {
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
@@ -198,14 +211,14 @@ export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBas
|
||||
recipients?: APIUser[];
|
||||
}
|
||||
|
||||
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
|
||||
export interface APIDMChannel extends APIDMChannelBase<ChannelType.DM> {
|
||||
/**
|
||||
* The name of the channel (always null for DM channels)
|
||||
*/
|
||||
name: null;
|
||||
}
|
||||
|
||||
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
|
||||
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -235,8 +248,9 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannelType>
|
||||
extends Omit<APITextBasedChannel<Type>, 'name'>,
|
||||
APIGuildChannel<Type> {
|
||||
extends APITextBasedChannel<Type>,
|
||||
APIGuildChannel<Type>,
|
||||
APIPinChannel<Type> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
@@ -529,18 +543,27 @@ export enum VideoQualityMode {
|
||||
Full,
|
||||
}
|
||||
|
||||
export interface APIMessageMentions {
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIMessage {
|
||||
export interface APIBaseMessageNoChannel {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
|
||||
*
|
||||
@@ -576,16 +599,6 @@ export interface APIMessage {
|
||||
* Whether this message mentions everyone
|
||||
*/
|
||||
mention_everyone: boolean;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: APIUser[];
|
||||
/**
|
||||
* Roles specifically mentioned in this message
|
||||
*
|
||||
@@ -769,6 +782,21 @@ export interface APIMessage {
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIBaseMessage extends APIBaseMessageNoChannel {
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIMessage extends APIBaseMessage, APIMessageMentions {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}
|
||||
*/
|
||||
@@ -1698,28 +1726,31 @@ export interface APIActionRowComponent<T extends APIComponentInActionRow>
|
||||
components: T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
||||
/**
|
||||
* The label to be displayed on the button
|
||||
*/
|
||||
label?: string;
|
||||
export interface APIButtonBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
||||
/**
|
||||
* The style of the button
|
||||
*/
|
||||
style: Style;
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* The status of the button
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIButtonBase<Style> {
|
||||
/**
|
||||
* The label to be displayed on the button
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
}
|
||||
|
||||
export interface APIMessageComponentEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
@@ -1761,8 +1792,7 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
export interface APIButtonComponentWithSKUId extends APIButtonBase<ButtonStyle.Premium> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
|
||||
18
deno/payloads/v9/gateway.ts
generated
18
deno/payloads/v9/gateway.ts
generated
@@ -60,9 +60,9 @@ export interface APIGatewaySessionStartLimit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
export interface GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* The user presence is being updated for
|
||||
*
|
||||
@@ -72,10 +72,6 @@ export interface GatewayPresenceUpdate {
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: Partial<APIUser> & Pick<APIUser, 'id'>;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* Either "idle", "dnd", "online", or "offline"
|
||||
*/
|
||||
@@ -94,6 +90,16 @@ export interface GatewayPresenceUpdate {
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate extends GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
|
||||
*/
|
||||
|
||||
136
deno/payloads/v9/guild.ts
generated
136
deno/payloads/v9/guild.ts
generated
@@ -11,14 +11,17 @@ import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
|
||||
*/
|
||||
export interface APIUnavailableGuild {
|
||||
export interface APIBaseGuild {
|
||||
/**
|
||||
* Guild id
|
||||
*/
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
|
||||
*/
|
||||
export interface APIUnavailableGuild extends APIBaseGuild {
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
@@ -28,7 +31,7 @@ export interface APIUnavailableGuild {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-structure}
|
||||
*/
|
||||
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
|
||||
export interface APIPartialGuild extends APIBaseGuild {
|
||||
/**
|
||||
* Guild name (2-100 characters, excluding trailing and leading whitespace)
|
||||
*/
|
||||
@@ -71,6 +74,12 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code?: string | null;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,12 +264,6 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
/**
|
||||
* The nsfw level of the guild
|
||||
*
|
||||
@@ -633,57 +636,23 @@ export interface APIGuildWidgetSettings {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMember {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: APIUser;
|
||||
export interface APIBaseGuildMember {
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The member's guild banner hash
|
||||
*/
|
||||
banner?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/permissions#role-object}
|
||||
*/
|
||||
roles: Snowflake[];
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
/**
|
||||
* When the user started boosting the guild
|
||||
*
|
||||
* @see {@link https://support.discord.com/hc/articles/360028038352}
|
||||
*/
|
||||
premium_since?: string | null;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
/**
|
||||
* Guild member flags represented as a bit set
|
||||
*
|
||||
* @defaultValue `0`
|
||||
*/
|
||||
flags: GuildMemberFlags;
|
||||
/**
|
||||
* Whether the user has not yet passed the guild's Membership Screening requirements
|
||||
*
|
||||
@@ -702,6 +671,81 @@ export interface APIGuildMember {
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIFlaggedGuildMember {
|
||||
/**
|
||||
* Guild member flags represented as a bit set
|
||||
*
|
||||
* @defaultValue `0`
|
||||
*/
|
||||
flags: GuildMemberFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberJoined {
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberAvatar {
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The member's guild banner hash
|
||||
*/
|
||||
banner?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIBaseVoiceGuildMember {
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberUser {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMember
|
||||
extends APIBaseGuildMember,
|
||||
APIBaseVoiceGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIGuildMemberUser {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags}
|
||||
*/
|
||||
|
||||
49
deno/payloads/v9/poll.ts
generated
49
deno/payloads/v9/poll.ts
generated
@@ -4,22 +4,14 @@
|
||||
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
|
||||
*/
|
||||
export interface APIPoll {
|
||||
export interface APIBasePoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
}
|
||||
|
||||
export interface APIPollDefaults {
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*
|
||||
@@ -32,6 +24,20 @@ export interface APIPoll {
|
||||
* @defaultValue `PollLayoutType.Default`
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
|
||||
*/
|
||||
export interface APIPoll extends APIBasePoll, APIPollDefaults {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
@@ -64,20 +70,23 @@ export interface APIPollMedia {
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
export interface APIBasePollAnswer {
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
|
||||
*/
|
||||
export interface APIPollAnswer extends APIBasePollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure}
|
||||
*/
|
||||
|
||||
19
deno/payloads/v9/voice.ts
generated
19
deno/payloads/v9/voice.ts
generated
@@ -11,14 +11,7 @@ import type { APIGuildMember } from './guild.ts';
|
||||
*/
|
||||
export type GatewayVoiceState = APIVoiceState;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
export interface APIBaseVoiceState {
|
||||
/**
|
||||
* The channel id this user is connected to
|
||||
*/
|
||||
@@ -71,6 +64,16 @@ export interface APIVoiceState {
|
||||
request_to_speak_timestamp: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
export interface APIVoiceState extends APIBaseVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-region-object}
|
||||
*/
|
||||
|
||||
54
deno/rest/v10/guild.ts
generated
54
deno/rest/v10/guild.ts
generated
@@ -952,38 +952,40 @@ export type RESTPutAPIGuildOnboardingJSONBody = _AddUndefinedToPossiblyUndefined
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIGuildOnboardingPrompt = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
export interface RESTAPIGuildOnboardingPrompt
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
>,
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
export interface RESTAPIGuildOnboardingPromptOption
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
>,
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
|
||||
23
deno/rest/v10/guildScheduledEvent.ts
generated
23
deno/rest/v10/guildScheduledEvent.ts
generated
@@ -94,17 +94,18 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = _Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
_StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
export interface RESTPatchAPIGuildScheduledEventJSONBody
|
||||
extends _Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
>,
|
||||
_StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
|
||||
43
deno/rest/v10/interactions.ts
generated
43
deno/rest/v10/interactions.ts
generated
@@ -47,26 +47,29 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
*/
|
||||
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
export type RESTPostAPIBaseApplicationCommandsJSONBody = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<
|
||||
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
export interface RESTPostAPIBaseApplicationCommandsJSONBody
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
>
|
||||
>,
|
||||
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<
|
||||
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
> {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
||||
|
||||
8
deno/rest/v10/poll.ts
generated
8
deno/rest/v10/poll.ts
generated
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v10.ts';
|
||||
import type { APIBasePoll, APIBasePollAnswer, APIMessage, APIPollDefaults, APIUser } from '../../v10.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
|
||||
@@ -20,13 +20,11 @@ export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure}
|
||||
*/
|
||||
export interface RESTAPIPoll
|
||||
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
|
||||
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
|
||||
export interface RESTAPIPoll extends APIBasePoll, Partial<APIPollDefaults> {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
answers: APIBasePollAnswer[];
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 32 days
|
||||
*
|
||||
|
||||
54
deno/rest/v9/guild.ts
generated
54
deno/rest/v9/guild.ts
generated
@@ -958,38 +958,40 @@ export type RESTPutAPIGuildOnboardingJSONBody = _AddUndefinedToPossiblyUndefined
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIGuildOnboardingPrompt = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
export interface RESTAPIGuildOnboardingPrompt
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
>,
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
export interface RESTAPIGuildOnboardingPromptOption
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
>,
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
|
||||
23
deno/rest/v9/guildScheduledEvent.ts
generated
23
deno/rest/v9/guildScheduledEvent.ts
generated
@@ -94,17 +94,18 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = _Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
_StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
export interface RESTPatchAPIGuildScheduledEventJSONBody
|
||||
extends _Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
>,
|
||||
_StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
|
||||
43
deno/rest/v9/interactions.ts
generated
43
deno/rest/v9/interactions.ts
generated
@@ -47,26 +47,29 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
*/
|
||||
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
export type RESTPostAPIBaseApplicationCommandsJSONBody = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<
|
||||
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
export interface RESTPostAPIBaseApplicationCommandsJSONBody
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
>
|
||||
>,
|
||||
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<
|
||||
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
> {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
||||
|
||||
8
deno/rest/v9/poll.ts
generated
8
deno/rest/v9/poll.ts
generated
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v9.ts';
|
||||
import type { APIBasePoll, APIBasePollAnswer, APIMessage, APIPollDefaults, APIUser } from '../../v9.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
|
||||
@@ -20,13 +20,11 @@ export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure}
|
||||
*/
|
||||
export interface RESTAPIPoll
|
||||
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
|
||||
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
|
||||
export interface RESTAPIPoll extends APIBasePoll, Partial<APIPollDefaults> {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
answers: APIBasePollAnswer[];
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 32 days
|
||||
*
|
||||
|
||||
12
deno/rpc/common.ts
generated
12
deno/rpc/common.ts
generated
@@ -26,12 +26,18 @@ export interface RPCAPIMessageParsedContentOriginalMatch {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
export interface RPCAPIMessageParsedContentText {
|
||||
export interface RPCAPIBaseMessageParsedContentText {
|
||||
type: 'text';
|
||||
originalMatch: RPCAPIMessageParsedContentOriginalMatch;
|
||||
content: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
export interface RPCAPIMessageParsedContentText extends RPCAPIBaseMessageParsedContentText {
|
||||
originalMatch: RPCAPIMessageParsedContentOriginalMatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
@@ -44,7 +50,7 @@ export interface RPCAPIMessageParsedContentMention {
|
||||
* Same as {@link RPCAPIMessageParsedContentMention.userId}
|
||||
*/
|
||||
parsedUserId: RPCAPIMessageParsedContentMention['userId'];
|
||||
content: Omit<RPCAPIMessageParsedContentText, 'originalMatch'>;
|
||||
content: RPCAPIBaseMessageParsedContentText;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
4
deno/rpc/v10.ts
generated
4
deno/rpc/v10.ts
generated
@@ -1,7 +1,9 @@
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
import type {
|
||||
APIBaseMessageNoChannel,
|
||||
APIInvite,
|
||||
APIMessage,
|
||||
APIMessageMentions,
|
||||
APIPartialChannel,
|
||||
APIPartialGuild,
|
||||
APIUser,
|
||||
@@ -50,7 +52,7 @@ export interface Relationship {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
export interface RPCAPIMessage extends Omit<APIMessage, 'channel_id'> {
|
||||
export interface RPCAPIMessage extends APIBaseMessageNoChannel, APIMessageMentions {
|
||||
/**
|
||||
* The nickname of the user who sent the message
|
||||
*/
|
||||
|
||||
4
deno/rpc/v9.ts
generated
4
deno/rpc/v9.ts
generated
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../globals.ts';
|
||||
import type { APIMessage, APIUser } from '../v9.ts';
|
||||
import type { APIBaseMessageNoChannel, APIMessageMentions, APIUser } from '../v9.ts';
|
||||
import type { RelationshipType, RPCAPIMessageParsedContentMention, RPCAPIMessageParsedContentText } from './common.ts';
|
||||
|
||||
export * from './common.ts';
|
||||
@@ -25,7 +25,7 @@ export interface Relationship {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
export interface RPCAPIMessage extends Omit<APIMessage, 'channel_id'> {
|
||||
export interface RPCAPIMessage extends APIBaseMessageNoChannel, APIMessageMentions {
|
||||
/**
|
||||
* The nickname of the user who sent the message
|
||||
*/
|
||||
|
||||
212
gateway/v10.ts
212
gateway/v10.ts
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../globals';
|
||||
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway';
|
||||
import type {
|
||||
APIApplication,
|
||||
APIApplicationCommandPermission,
|
||||
@@ -16,7 +15,6 @@ import type {
|
||||
APIGuildMember,
|
||||
APIGuildScheduledEvent,
|
||||
APIInteraction,
|
||||
APIMessage,
|
||||
APIRole,
|
||||
APIStageInstance,
|
||||
APISticker,
|
||||
@@ -25,8 +23,8 @@ import type {
|
||||
APIUnavailableGuild,
|
||||
APIUser,
|
||||
GatewayActivity,
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayPresenceUpdate,
|
||||
GatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
@@ -39,6 +37,16 @@ import type {
|
||||
APISoundboardSound,
|
||||
GuildChannelType,
|
||||
ThreadChannelType,
|
||||
APIBaseGuild,
|
||||
APIBaseGuildMember,
|
||||
APIBaseVoiceState,
|
||||
APIBaseVoiceGuildMember,
|
||||
APIGuildMemberJoined,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberUser,
|
||||
GatewayGuildMembersChunkPresence,
|
||||
APIBaseMessage,
|
||||
} from '../payloads/v10/index';
|
||||
import type { ReactionType } from '../rest/v10/index';
|
||||
import type { _Nullable } from '../utils/internals';
|
||||
@@ -789,9 +797,7 @@ export type GatewayEntitlementModifyDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
|
||||
*/
|
||||
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
|
||||
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
|
||||
};
|
||||
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
|
||||
@@ -873,7 +879,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
voice_states: Omit<APIVoiceState, 'guild_id'>[];
|
||||
voice_states: APIBaseVoiceState[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
@@ -953,7 +959,7 @@ export type GatewayGuildDeleteDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
|
||||
*/
|
||||
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
|
||||
export interface GatewayGuildDeleteDispatchData extends APIBaseGuild {
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*
|
||||
@@ -1127,15 +1133,18 @@ export type GatewayGuildMemberUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> &
|
||||
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
|
||||
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
|
||||
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
};
|
||||
export interface GatewayGuildMemberUpdateDispatchData
|
||||
extends _Nullable<APIGuildMemberJoined>,
|
||||
APIBaseGuildMember,
|
||||
Partial<APIBaseVoiceGuildMember>,
|
||||
Partial<APIFlaggedGuildMember>,
|
||||
Required<APIGuildMemberAvatar>,
|
||||
Required<APIGuildMemberUser> {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
|
||||
@@ -1145,11 +1154,6 @@ export type GatewayGuildMembersChunkDispatch = _DataPayload<
|
||||
GatewayGuildMembersChunkDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export type GatewayGuildMembersChunkPresence = Omit<RawGatewayPresenceUpdate, 'guild_id'>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
|
||||
*/
|
||||
@@ -1597,7 +1601,7 @@ export type GatewayMessageCreateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
|
||||
*/
|
||||
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
|
||||
@@ -1610,7 +1614,24 @@ export type GatewayMessageUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
|
||||
|
||||
export interface APIGuildMemberNoUser
|
||||
extends APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIBaseVoiceGuildMember {}
|
||||
|
||||
export interface APIUserWithMember extends APIUser {
|
||||
/**
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMemberNoUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
|
||||
@@ -1628,17 +1649,13 @@ export interface GatewayMessageEventExtraFields {
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: Omit<APIGuildMember, 'user'>;
|
||||
member?: APIGuildMemberNoUser;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
mentions: APIUserWithMember[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1696,25 +1713,74 @@ export interface GatewayMessageDeleteBulkDispatchData {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData {
|
||||
/**
|
||||
* The member who reacted if this happened in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
export type GatewayMessageReactionAddDispatch = _DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionAdd,
|
||||
GatewayMessageReactionAddDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
|
||||
export interface GatewayMessageReactionRemoveDispatchData {
|
||||
/**
|
||||
* The id of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The emoji used to react
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
|
||||
*/
|
||||
emoji: APIEmoji;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = _DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
GatewayMessageReactionRemoveDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
|
||||
@@ -1758,7 +1824,7 @@ export type GatewayPresenceUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
|
||||
export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
|
||||
@@ -1810,7 +1876,7 @@ export type GatewayThreadListSyncDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
|
||||
*/
|
||||
export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync;
|
||||
export type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
|
||||
@@ -2415,7 +2481,7 @@ export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' |
|
||||
// #endregion Sendable Payloads
|
||||
|
||||
// #region Shared
|
||||
export interface _BasePayload {
|
||||
export interface _BaseBasePayload {
|
||||
/**
|
||||
* Opcode for the payload
|
||||
*/
|
||||
@@ -2424,6 +2490,9 @@ export interface _BasePayload {
|
||||
* Event data
|
||||
*/
|
||||
d?: unknown;
|
||||
}
|
||||
|
||||
export interface _BasePayload {
|
||||
/**
|
||||
* Sequence number, used for resuming sessions and heartbeats
|
||||
*/
|
||||
@@ -2434,10 +2503,10 @@ export interface _BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
export type _NonDispatchPayload = Omit<_BasePayload, 's' | 't'> & {
|
||||
export interface _NonDispatchPayload extends _BaseBasePayload {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends _BasePayload {
|
||||
op: GatewayOpcodes.Dispatch;
|
||||
@@ -2445,57 +2514,10 @@ export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown>
|
||||
d: D;
|
||||
}
|
||||
|
||||
// This is not used internally anymore, just remains to be non-breaking
|
||||
export type GatewayMessageReactionData<E extends GatewayDispatchEvents, O extends string = never> = _DataPayload<
|
||||
E,
|
||||
Omit<
|
||||
{
|
||||
/**
|
||||
* The id of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The member who reacted if this happened in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The emoji used to react
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
|
||||
*/
|
||||
emoji: APIEmoji;
|
||||
/**
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
Omit<GatewayMessageReactionAddDispatchData, O>
|
||||
>;
|
||||
|
||||
export interface GatewayMessageReactionRemoveData {
|
||||
|
||||
212
gateway/v9.ts
212
gateway/v9.ts
@@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../globals';
|
||||
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway';
|
||||
import type {
|
||||
APIApplication,
|
||||
APIApplicationCommandPermission,
|
||||
@@ -16,7 +15,6 @@ import type {
|
||||
APIGuildMember,
|
||||
APIGuildScheduledEvent,
|
||||
APIInteraction,
|
||||
APIMessage,
|
||||
APIRole,
|
||||
APIStageInstance,
|
||||
APISticker,
|
||||
@@ -25,8 +23,8 @@ import type {
|
||||
APIUnavailableGuild,
|
||||
APIUser,
|
||||
GatewayActivity,
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayPresenceUpdate,
|
||||
GatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
@@ -39,6 +37,16 @@ import type {
|
||||
GuildChannelType,
|
||||
ThreadChannelType,
|
||||
APIEntitlement,
|
||||
APIBaseGuild,
|
||||
APIBaseGuildMember,
|
||||
APIBaseVoiceState,
|
||||
APIBaseVoiceGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberUser,
|
||||
APIGuildMemberAvatar,
|
||||
GatewayGuildMembersChunkPresence,
|
||||
APIBaseMessage,
|
||||
APIGuildMemberJoined,
|
||||
} from '../payloads/v9/index';
|
||||
import type { ReactionType } from '../rest/v9/index';
|
||||
import type { _Nullable } from '../utils/internals';
|
||||
@@ -788,9 +796,7 @@ export type GatewayEntitlementModifyDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
|
||||
*/
|
||||
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
|
||||
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
|
||||
};
|
||||
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
|
||||
@@ -872,7 +878,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
voice_states: Omit<APIVoiceState, 'guild_id'>[];
|
||||
voice_states: APIBaseVoiceState[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
@@ -952,7 +958,7 @@ export type GatewayGuildDeleteDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
|
||||
*/
|
||||
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
|
||||
export interface GatewayGuildDeleteDispatchData extends APIBaseGuild {
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*
|
||||
@@ -1126,15 +1132,18 @@ export type GatewayGuildMemberUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> &
|
||||
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
|
||||
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
|
||||
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
};
|
||||
export interface GatewayGuildMemberUpdateDispatchData
|
||||
extends _Nullable<APIGuildMemberJoined>,
|
||||
APIBaseGuildMember,
|
||||
Partial<APIBaseVoiceGuildMember>,
|
||||
Partial<APIFlaggedGuildMember>,
|
||||
Required<APIGuildMemberUser>,
|
||||
Required<APIGuildMemberAvatar> {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
|
||||
@@ -1144,11 +1153,6 @@ export type GatewayGuildMembersChunkDispatch = _DataPayload<
|
||||
GatewayGuildMembersChunkDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export type GatewayGuildMembersChunkPresence = Omit<RawGatewayPresenceUpdate, 'guild_id'>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
|
||||
*/
|
||||
@@ -1596,7 +1600,7 @@ export type GatewayMessageCreateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
|
||||
*/
|
||||
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
export interface GatewayMessageCreateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
|
||||
@@ -1609,7 +1613,24 @@ export type GatewayMessageUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
export interface GatewayMessageUpdateDispatchData extends GatewayMessageEventExtraFields, APIBaseMessage {}
|
||||
|
||||
export interface APIGuildMemberNoUser
|
||||
extends APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIBaseVoiceGuildMember {}
|
||||
|
||||
export interface APIUserWithMember extends APIUser {
|
||||
/**
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMemberNoUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
|
||||
@@ -1627,17 +1648,13 @@ export interface GatewayMessageEventExtraFields {
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: Omit<APIGuildMember, 'user'>;
|
||||
member?: APIGuildMemberNoUser;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
mentions: APIUserWithMember[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1695,25 +1712,74 @@ export interface GatewayMessageDeleteBulkDispatchData {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
export interface GatewayMessageReactionAddDispatchData extends GatewayMessageReactionRemoveDispatchData {
|
||||
/**
|
||||
* The member who reacted if this happened in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
export type GatewayMessageReactionAddDispatch = _DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionAdd,
|
||||
GatewayMessageReactionAddDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
|
||||
export interface GatewayMessageReactionRemoveDispatchData {
|
||||
/**
|
||||
* The id of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The emoji used to react
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
|
||||
*/
|
||||
emoji: APIEmoji;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = _DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
GatewayMessageReactionRemoveDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
|
||||
@@ -1757,7 +1823,7 @@ export type GatewayPresenceUpdateDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
|
||||
export type GatewayPresenceUpdateDispatchData = GatewayPresenceUpdate;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
|
||||
@@ -1809,7 +1875,7 @@ export type GatewayThreadListSyncDispatch = _DataPayload<
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
|
||||
*/
|
||||
export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync;
|
||||
export type GatewayThreadListSyncDispatchData = GatewayThreadListSync;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
|
||||
@@ -2414,7 +2480,8 @@ export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' |
|
||||
// #endregion Sendable Payloads
|
||||
|
||||
// #region Shared
|
||||
export interface _BasePayload {
|
||||
|
||||
export interface _BaseBasePayload {
|
||||
/**
|
||||
* Opcode for the payload
|
||||
*/
|
||||
@@ -2423,6 +2490,8 @@ export interface _BasePayload {
|
||||
* Event data
|
||||
*/
|
||||
d?: unknown;
|
||||
}
|
||||
export interface _BasePayload extends _BaseBasePayload {
|
||||
/**
|
||||
* Sequence number, used for resuming sessions and heartbeats
|
||||
*/
|
||||
@@ -2433,10 +2502,10 @@ export interface _BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
export type _NonDispatchPayload = Omit<_BasePayload, 's' | 't'> & {
|
||||
export interface _NonDispatchPayload extends _BaseBasePayload {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
}
|
||||
|
||||
export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends _BasePayload {
|
||||
op: GatewayOpcodes.Dispatch;
|
||||
@@ -2444,57 +2513,10 @@ export interface _DataPayload<Event extends GatewayDispatchEvents, D = unknown>
|
||||
d: D;
|
||||
}
|
||||
|
||||
// This is not used internally anymore, just remains to be non-breaking
|
||||
export type GatewayMessageReactionData<E extends GatewayDispatchEvents, O extends string = never> = _DataPayload<
|
||||
E,
|
||||
Omit<
|
||||
{
|
||||
/**
|
||||
* The id of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The id of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The member who reacted if this happened in a guild
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The emoji used to react
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
|
||||
*/
|
||||
emoji: APIEmoji;
|
||||
/**
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
Omit<GatewayMessageReactionAddDispatchData, O>
|
||||
>;
|
||||
|
||||
export interface GatewayMessageReactionRemoveData {
|
||||
|
||||
@@ -9,7 +9,14 @@ import type {
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel';
|
||||
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild';
|
||||
import type {
|
||||
APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIPartialInteractionGuild,
|
||||
} from '../guild';
|
||||
import type { APIEntitlement } from '../monetization';
|
||||
import type { APIUser } from '../user';
|
||||
import type { InteractionType } from './responses';
|
||||
@@ -253,7 +260,11 @@ export type APIInteractionDataResolvedChannel =
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
|
||||
export interface APIInteractionDataResolvedGuildMember
|
||||
extends APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel';
|
||||
import type { APIBaseComponent } from '../channel';
|
||||
import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
@@ -13,8 +13,7 @@ export interface ModalSubmitComponent {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface ModalSubmitActionRowComponent
|
||||
extends Omit<APIActionRowComponent<APIComponentInModalActionRow>, 'components'> {
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: ModalSubmitComponent[];
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,7 @@ import type { APIPoll } from './poll';
|
||||
import type { APISticker, APIStickerItem } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
export interface APIBasePartialChannel {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
@@ -27,12 +24,20 @@ export interface APIPartialChannel {
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
|
||||
*/
|
||||
type: ChannelType;
|
||||
}
|
||||
|
||||
export interface APINameableChannel {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel extends APIBasePartialChannel, APINameableChannel {}
|
||||
|
||||
/**
|
||||
* A channel obtained from fetching an invite.
|
||||
*/
|
||||
@@ -58,7 +63,7 @@ export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartia
|
||||
* This interface is used to allow easy extension for other channel types. While
|
||||
* also allowing `APIPartialChannel` to be used without breaking.
|
||||
*/
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIBasePartialChannel {
|
||||
type: T;
|
||||
flags?: ChannelFlags;
|
||||
}
|
||||
@@ -76,16 +81,7 @@ export type TextChannelType =
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
@@ -105,7 +101,22 @@ export interface APISortableChannel {
|
||||
position: number;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T>, APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
}
|
||||
|
||||
export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -137,9 +148,10 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
extends APITextBasedChannel<T>,
|
||||
APIGuildChannel<T>,
|
||||
APISortableChannel {
|
||||
APISortableChannel,
|
||||
APIPinChannel<T> {
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
@@ -162,7 +174,8 @@ export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.Gui
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
APISortableChannel,
|
||||
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
|
||||
APITextBasedChannel<T>,
|
||||
APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice or stage channel
|
||||
*/
|
||||
@@ -189,7 +202,7 @@ export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
|
||||
|
||||
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
|
||||
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>, APIPinChannel<T> {
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
@@ -198,14 +211,14 @@ export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBas
|
||||
recipients?: APIUser[];
|
||||
}
|
||||
|
||||
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
|
||||
export interface APIDMChannel extends APIDMChannelBase<ChannelType.DM> {
|
||||
/**
|
||||
* The name of the channel (always null for DM channels)
|
||||
*/
|
||||
name: null;
|
||||
}
|
||||
|
||||
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
|
||||
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -235,8 +248,9 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannelType>
|
||||
extends Omit<APITextBasedChannel<Type>, 'name'>,
|
||||
APIGuildChannel<Type> {
|
||||
extends APITextBasedChannel<Type>,
|
||||
APIGuildChannel<Type>,
|
||||
APIPinChannel<Type> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
@@ -529,18 +543,27 @@ export enum VideoQualityMode {
|
||||
Full,
|
||||
}
|
||||
|
||||
export interface APIMessageMentions {
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIMessage {
|
||||
export interface APIBaseMessageNoChannel {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
|
||||
*
|
||||
@@ -577,16 +600,6 @@ export interface APIMessage {
|
||||
* Whether this message mentions everyone
|
||||
*/
|
||||
mention_everyone: boolean;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: APIUser[];
|
||||
/**
|
||||
* Roles specifically mentioned in this message
|
||||
*
|
||||
@@ -774,6 +787,21 @@ export interface APIMessage {
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIBaseMessage extends APIBaseMessageNoChannel {
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIMessage extends APIBaseMessage, APIMessageMentions {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}
|
||||
*/
|
||||
@@ -1701,28 +1729,31 @@ export interface APIActionRowComponent<T extends APIComponentInActionRow>
|
||||
components: T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
||||
/**
|
||||
* The label to be displayed on the button
|
||||
*/
|
||||
label?: string;
|
||||
export interface APIButtonBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
||||
/**
|
||||
* The style of the button
|
||||
*/
|
||||
style: Style;
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* The status of the button
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIButtonBase<Style> {
|
||||
/**
|
||||
* The label to be displayed on the button
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
}
|
||||
|
||||
export interface APIMessageComponentEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
@@ -1764,8 +1795,7 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
export interface APIButtonComponentWithSKUId extends APIButtonBase<ButtonStyle.Premium> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
|
||||
@@ -60,9 +60,9 @@ export interface APIGatewaySessionStartLimit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
export interface GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* The user presence is being updated for
|
||||
*
|
||||
@@ -72,10 +72,6 @@ export interface GatewayPresenceUpdate {
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: Partial<APIUser> & Pick<APIUser, 'id'>;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* Either "idle", "dnd", "online", or "offline"
|
||||
*/
|
||||
@@ -94,6 +90,16 @@ export interface GatewayPresenceUpdate {
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate extends GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
|
||||
*/
|
||||
|
||||
@@ -11,14 +11,17 @@ import type { APIRole } from './permissions';
|
||||
import type { APISticker } from './sticker';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
|
||||
*/
|
||||
export interface APIUnavailableGuild {
|
||||
export interface APIBaseGuild {
|
||||
/**
|
||||
* Guild id
|
||||
*/
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
|
||||
*/
|
||||
export interface APIUnavailableGuild extends APIBaseGuild {
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
@@ -28,7 +31,7 @@ export interface APIUnavailableGuild {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-structure}
|
||||
*/
|
||||
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
|
||||
export interface APIPartialGuild extends APIBaseGuild {
|
||||
/**
|
||||
* Guild name (2-100 characters, excluding trailing and leading whitespace)
|
||||
*/
|
||||
@@ -71,6 +74,12 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code?: string | null;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,12 +264,6 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
/**
|
||||
* The nsfw level of the guild
|
||||
*
|
||||
@@ -641,57 +644,23 @@ export interface APIGuildWidgetSettings {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMember {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: APIUser;
|
||||
export interface APIBaseGuildMember {
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The member's guild banner hash
|
||||
*/
|
||||
banner?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/permissions#role-object}
|
||||
*/
|
||||
roles: Snowflake[];
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
/**
|
||||
* When the user started boosting the guild
|
||||
*
|
||||
* @see {@link https://support.discord.com/hc/articles/360028038352}
|
||||
*/
|
||||
premium_since?: string | null;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
/**
|
||||
* Guild member flags represented as a bit set
|
||||
*
|
||||
* @defaultValue `0`
|
||||
*/
|
||||
flags: GuildMemberFlags;
|
||||
/**
|
||||
* Whether the user has not yet passed the guild's Membership Screening requirements
|
||||
*
|
||||
@@ -710,6 +679,81 @@ export interface APIGuildMember {
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIFlaggedGuildMember {
|
||||
/**
|
||||
* Guild member flags represented as a bit set
|
||||
*
|
||||
* @defaultValue `0`
|
||||
*/
|
||||
flags: GuildMemberFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberJoined {
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberAvatar {
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The member's guild banner hash
|
||||
*/
|
||||
banner?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIBaseVoiceGuildMember {
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberUser {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMember
|
||||
extends APIBaseGuildMember,
|
||||
APIBaseVoiceGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIGuildMemberUser {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags}
|
||||
*/
|
||||
|
||||
@@ -4,22 +4,14 @@
|
||||
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
|
||||
*/
|
||||
export interface APIPoll {
|
||||
export interface APIBasePoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
}
|
||||
|
||||
export interface APIPollDefaults {
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*
|
||||
@@ -32,6 +24,20 @@ export interface APIPoll {
|
||||
* @defaultValue `PollLayoutType.Default`
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
|
||||
*/
|
||||
export interface APIPoll extends APIBasePoll, APIPollDefaults {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
@@ -64,20 +70,23 @@ export interface APIPollMedia {
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
export interface APIBasePollAnswer {
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
|
||||
*/
|
||||
export interface APIPollAnswer extends APIBasePollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure}
|
||||
*/
|
||||
|
||||
@@ -14,11 +14,7 @@ export type GatewayVoiceState = APIVoiceState;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
export interface APIBaseVoiceState {
|
||||
/**
|
||||
* The channel id this user is connected to
|
||||
*/
|
||||
@@ -71,6 +67,16 @@ export interface APIVoiceState {
|
||||
request_to_speak_timestamp: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
export interface APIVoiceState extends APIBaseVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-region-object}
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,14 @@ import type {
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel';
|
||||
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild';
|
||||
import type {
|
||||
APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIPartialInteractionGuild,
|
||||
} from '../guild';
|
||||
import type { APIEntitlement } from '../monetization';
|
||||
import type { APIUser } from '../user';
|
||||
import type { InteractionType } from './responses';
|
||||
@@ -256,7 +263,11 @@ export type APIInteractionDataResolvedChannel =
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
|
||||
export interface APIInteractionDataResolvedGuildMember
|
||||
extends APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIActionRowComponent, APIComponentInModalActionRow } from '../channel';
|
||||
import type { APIBaseComponent } from '../channel';
|
||||
import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
@@ -13,8 +13,7 @@ export interface ModalSubmitComponent {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface ModalSubmitActionRowComponent
|
||||
extends Omit<APIActionRowComponent<APIComponentInModalActionRow>, 'components'> {
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: ModalSubmitComponent[];
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,7 @@ import type { APIPoll } from './poll';
|
||||
import type { APISticker, APIStickerItem } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
export interface APIBasePartialChannel {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
@@ -27,12 +24,20 @@ export interface APIPartialChannel {
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
|
||||
*/
|
||||
type: ChannelType;
|
||||
}
|
||||
|
||||
export interface APINameableChannel {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel extends APIBasePartialChannel, APINameableChannel {}
|
||||
|
||||
/**
|
||||
* A channel obtained from fetching an invite.
|
||||
*/
|
||||
@@ -58,7 +63,7 @@ export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartia
|
||||
* This interface is used to allow easy extension for other channel types. While
|
||||
* also allowing `APIPartialChannel` to be used without breaking.
|
||||
*/
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIBasePartialChannel {
|
||||
type: T;
|
||||
flags?: ChannelFlags;
|
||||
}
|
||||
@@ -76,16 +81,7 @@ export type TextChannelType =
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
@@ -105,7 +101,22 @@ export interface APISortableChannel {
|
||||
position: number;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T>, APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
}
|
||||
|
||||
export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -137,9 +148,10 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
extends APITextBasedChannel<T>,
|
||||
APISortableChannel,
|
||||
APIGuildChannel<T> {
|
||||
APIGuildChannel<T>,
|
||||
APIPinChannel<T> {
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
@@ -162,7 +174,8 @@ export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.Gui
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
APISortableChannel,
|
||||
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
|
||||
APITextBasedChannel<T>,
|
||||
APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice or stage channel
|
||||
*/
|
||||
@@ -189,7 +202,7 @@ export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
|
||||
|
||||
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
|
||||
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>, APIPinChannel<T> {
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
@@ -198,14 +211,14 @@ export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBas
|
||||
recipients?: APIUser[];
|
||||
}
|
||||
|
||||
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
|
||||
export interface APIDMChannel extends APIDMChannelBase<ChannelType.DM> {
|
||||
/**
|
||||
* The name of the channel (always null for DM channels)
|
||||
*/
|
||||
name: null;
|
||||
}
|
||||
|
||||
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
|
||||
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
@@ -235,8 +248,9 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannelType>
|
||||
extends Omit<APITextBasedChannel<Type>, 'name'>,
|
||||
APIGuildChannel<Type> {
|
||||
extends APITextBasedChannel<Type>,
|
||||
APIGuildChannel<Type>,
|
||||
APIPinChannel<Type> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
@@ -529,18 +543,27 @@ export enum VideoQualityMode {
|
||||
Full,
|
||||
}
|
||||
|
||||
export interface APIMessageMentions {
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIMessage {
|
||||
export interface APIBaseMessageNoChannel {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
|
||||
*
|
||||
@@ -576,16 +599,6 @@ export interface APIMessage {
|
||||
* Whether this message mentions everyone
|
||||
*/
|
||||
mention_everyone: boolean;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
mentions: APIUser[];
|
||||
/**
|
||||
* Roles specifically mentioned in this message
|
||||
*
|
||||
@@ -769,6 +782,21 @@ export interface APIMessage {
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIBaseMessage extends APIBaseMessageNoChannel {
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-structure}
|
||||
*/
|
||||
export interface APIMessage extends APIBaseMessage, APIMessageMentions {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}
|
||||
*/
|
||||
@@ -1698,28 +1726,31 @@ export interface APIActionRowComponent<T extends APIComponentInActionRow>
|
||||
components: T[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
||||
/**
|
||||
* The label to be displayed on the button
|
||||
*/
|
||||
label?: string;
|
||||
export interface APIButtonBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
|
||||
/**
|
||||
* The style of the button
|
||||
*/
|
||||
style: Style;
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* The status of the button
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIButtonBase<Style> {
|
||||
/**
|
||||
* The label to be displayed on the button
|
||||
*/
|
||||
label?: string;
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
}
|
||||
|
||||
export interface APIMessageComponentEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
@@ -1761,8 +1792,7 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/components/reference#button}
|
||||
*/
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
export interface APIButtonComponentWithSKUId extends APIButtonBase<ButtonStyle.Premium> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
|
||||
@@ -60,9 +60,9 @@ export interface APIGatewaySessionStartLimit {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
export interface GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* The user presence is being updated for
|
||||
*
|
||||
@@ -72,10 +72,6 @@ export interface GatewayPresenceUpdate {
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: Partial<APIUser> & Pick<APIUser, 'id'>;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* Either "idle", "dnd", "online", or "offline"
|
||||
*/
|
||||
@@ -94,6 +90,16 @@ export interface GatewayPresenceUpdate {
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate extends GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
|
||||
*/
|
||||
|
||||
@@ -11,14 +11,17 @@ import type { APIRole } from './permissions';
|
||||
import type { APISticker } from './sticker';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
|
||||
*/
|
||||
export interface APIUnavailableGuild {
|
||||
export interface APIBaseGuild {
|
||||
/**
|
||||
* Guild id
|
||||
*/
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
|
||||
*/
|
||||
export interface APIUnavailableGuild extends APIBaseGuild {
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
@@ -28,7 +31,7 @@ export interface APIUnavailableGuild {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-object-guild-structure}
|
||||
*/
|
||||
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
|
||||
export interface APIPartialGuild extends APIBaseGuild {
|
||||
/**
|
||||
* Guild name (2-100 characters, excluding trailing and leading whitespace)
|
||||
*/
|
||||
@@ -71,6 +74,12 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code?: string | null;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -255,12 +264,6 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
/**
|
||||
* The nsfw level of the guild
|
||||
*
|
||||
@@ -633,57 +636,23 @@ export interface APIGuildWidgetSettings {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMember {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: APIUser;
|
||||
export interface APIBaseGuildMember {
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The member's guild banner hash
|
||||
*/
|
||||
banner?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/permissions#role-object}
|
||||
*/
|
||||
roles: Snowflake[];
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
/**
|
||||
* When the user started boosting the guild
|
||||
*
|
||||
* @see {@link https://support.discord.com/hc/articles/360028038352}
|
||||
*/
|
||||
premium_since?: string | null;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
/**
|
||||
* Guild member flags represented as a bit set
|
||||
*
|
||||
* @defaultValue `0`
|
||||
*/
|
||||
flags: GuildMemberFlags;
|
||||
/**
|
||||
* Whether the user has not yet passed the guild's Membership Screening requirements
|
||||
*
|
||||
@@ -702,6 +671,81 @@ export interface APIGuildMember {
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIFlaggedGuildMember {
|
||||
/**
|
||||
* Guild member flags represented as a bit set
|
||||
*
|
||||
* @defaultValue `0`
|
||||
*/
|
||||
flags: GuildMemberFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberJoined {
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberAvatar {
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The member's guild banner hash
|
||||
*/
|
||||
banner?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIBaseVoiceGuildMember {
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMemberUser {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIGuildMember
|
||||
extends APIBaseGuildMember,
|
||||
APIBaseVoiceGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIGuildMemberUser {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags}
|
||||
*/
|
||||
|
||||
@@ -4,22 +4,14 @@
|
||||
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
|
||||
*/
|
||||
export interface APIPoll {
|
||||
export interface APIBasePoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
}
|
||||
|
||||
export interface APIPollDefaults {
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*
|
||||
@@ -32,6 +24,20 @@ export interface APIPoll {
|
||||
* @defaultValue `PollLayoutType.Default`
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure}
|
||||
*/
|
||||
export interface APIPoll extends APIBasePoll, APIPollDefaults {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
expiry: string;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
@@ -64,20 +70,23 @@ export interface APIPollMedia {
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
export interface APIBasePollAnswer {
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure}
|
||||
*/
|
||||
export interface APIPollAnswer extends APIBasePollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure}
|
||||
*/
|
||||
|
||||
@@ -11,14 +11,7 @@ import type { APIGuildMember } from './guild';
|
||||
*/
|
||||
export type GatewayVoiceState = APIVoiceState;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
export interface APIBaseVoiceState {
|
||||
/**
|
||||
* The channel id this user is connected to
|
||||
*/
|
||||
@@ -71,6 +64,16 @@ export interface APIVoiceState {
|
||||
request_to_speak_timestamp: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
|
||||
*/
|
||||
export interface APIVoiceState extends APIBaseVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-region-object}
|
||||
*/
|
||||
|
||||
@@ -952,38 +952,40 @@ export type RESTPutAPIGuildOnboardingJSONBody = _AddUndefinedToPossiblyUndefined
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIGuildOnboardingPrompt = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
export interface RESTAPIGuildOnboardingPrompt
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
>,
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
export interface RESTAPIGuildOnboardingPromptOption
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
>,
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
|
||||
@@ -94,17 +94,18 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = _Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
_StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
export interface RESTPatchAPIGuildScheduledEventJSONBody
|
||||
extends _Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
>,
|
||||
_StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
|
||||
@@ -47,26 +47,29 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
*/
|
||||
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
export type RESTPostAPIBaseApplicationCommandsJSONBody = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<
|
||||
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
export interface RESTPostAPIBaseApplicationCommandsJSONBody
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
>
|
||||
>,
|
||||
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<
|
||||
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
> {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v10';
|
||||
import type { APIBasePoll, APIBasePollAnswer, APIMessage, APIPollDefaults, APIUser } from '../../v10';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
|
||||
@@ -20,13 +20,11 @@ export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure}
|
||||
*/
|
||||
export interface RESTAPIPoll
|
||||
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
|
||||
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
|
||||
export interface RESTAPIPoll extends APIBasePoll, Partial<APIPollDefaults> {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
answers: APIBasePollAnswer[];
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 32 days
|
||||
*
|
||||
|
||||
@@ -958,38 +958,40 @@ export type RESTPutAPIGuildOnboardingJSONBody = _AddUndefinedToPossiblyUndefined
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIGuildOnboardingPrompt = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
export interface RESTAPIGuildOnboardingPrompt
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
>,
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
export interface RESTAPIGuildOnboardingPromptOption
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
>,
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
|
||||
@@ -94,17 +94,18 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = _Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
_StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
export interface RESTPatchAPIGuildScheduledEventJSONBody
|
||||
extends _Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
>,
|
||||
_StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
||||
|
||||
@@ -47,26 +47,29 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
*/
|
||||
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
export type RESTPostAPIBaseApplicationCommandsJSONBody = _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<
|
||||
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
export interface RESTPostAPIBaseApplicationCommandsJSONBody
|
||||
extends _AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
>
|
||||
>,
|
||||
_AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<
|
||||
_NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
> {}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v9';
|
||||
import type { APIBasePoll, APIBasePollAnswer, APIMessage, APIPollDefaults, APIUser } from '../../v9';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
|
||||
@@ -20,13 +20,11 @@ export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure}
|
||||
*/
|
||||
export interface RESTAPIPoll
|
||||
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
|
||||
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
|
||||
export interface RESTAPIPoll extends APIBasePoll, Partial<APIPollDefaults> {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
answers: APIBasePollAnswer[];
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 32 days
|
||||
*
|
||||
|
||||
@@ -26,12 +26,18 @@ export interface RPCAPIMessageParsedContentOriginalMatch {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
export interface RPCAPIMessageParsedContentText {
|
||||
export interface RPCAPIBaseMessageParsedContentText {
|
||||
type: 'text';
|
||||
originalMatch: RPCAPIMessageParsedContentOriginalMatch;
|
||||
content: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
export interface RPCAPIMessageParsedContentText extends RPCAPIBaseMessageParsedContentText {
|
||||
originalMatch: RPCAPIMessageParsedContentOriginalMatch;
|
||||
}
|
||||
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
@@ -44,7 +50,7 @@ export interface RPCAPIMessageParsedContentMention {
|
||||
* Same as {@link RPCAPIMessageParsedContentMention.userId}
|
||||
*/
|
||||
parsedUserId: RPCAPIMessageParsedContentMention['userId'];
|
||||
content: Omit<RPCAPIMessageParsedContentText, 'originalMatch'>;
|
||||
content: RPCAPIBaseMessageParsedContentText;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
import type {
|
||||
APIBaseMessageNoChannel,
|
||||
APIInvite,
|
||||
APIMessage,
|
||||
APIMessageMentions,
|
||||
APIPartialChannel,
|
||||
APIPartialGuild,
|
||||
APIUser,
|
||||
@@ -50,7 +52,7 @@ export interface Relationship {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
export interface RPCAPIMessage extends Omit<APIMessage, 'channel_id'> {
|
||||
export interface RPCAPIMessage extends APIBaseMessageNoChannel, APIMessageMentions {
|
||||
/**
|
||||
* The nickname of the user who sent the message
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../globals';
|
||||
import type { APIMessage, APIUser } from '../v9';
|
||||
import type { APIBaseMessageNoChannel, APIMessageMentions, APIUser } from '../v9';
|
||||
import type { RelationshipType, RPCAPIMessageParsedContentMention, RPCAPIMessageParsedContentText } from './common';
|
||||
|
||||
export * from './common';
|
||||
@@ -25,7 +25,7 @@ export interface Relationship {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
export interface RPCAPIMessage extends Omit<APIMessage, 'channel_id'> {
|
||||
export interface RPCAPIMessage extends APIBaseMessageNoChannel, APIMessageMentions {
|
||||
/**
|
||||
* The nickname of the user who sent the message
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user