mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-06-01 08:20:10 +00:00
chore: separate gateway payload data into separate exported types (#50)
This commit is contained in:
@@ -17,6 +17,7 @@ import type {
|
||||
InviteTargetUserType,
|
||||
PresenceUpdateStatus,
|
||||
APIApplicationCommandInteraction,
|
||||
APIApplication,
|
||||
} from '../payloads';
|
||||
|
||||
export const GatewayVersion = '8';
|
||||
@@ -215,14 +216,20 @@ export type GatewayDispatchPayload =
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#hello
|
||||
*/
|
||||
export interface GatewayHello extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Hello;
|
||||
d: {
|
||||
heartbeat_interval: number;
|
||||
};
|
||||
d: GatewayHelloData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#hello
|
||||
*/
|
||||
export interface GatewayHelloData {
|
||||
heartbeat_interval: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -246,9 +253,14 @@ export interface GatewayHeartbeatAck extends NonDispatchPayload {
|
||||
*/
|
||||
export interface GatewayInvalidSession extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.InvalidSession;
|
||||
d: boolean;
|
||||
d: GatewayInvalidSessionData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invalid-session
|
||||
*/
|
||||
export type GatewayInvalidSessionData = boolean;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#reconnect
|
||||
*/
|
||||
@@ -260,24 +272,26 @@ export interface GatewayReconnect extends NonDispatchPayload {
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#ready
|
||||
*/
|
||||
export type GatewayReadyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.Ready,
|
||||
{
|
||||
v: number;
|
||||
user: APIUser;
|
||||
session_id: string;
|
||||
private_channels: [];
|
||||
guilds: APIUnavailableGuild[];
|
||||
shard?: [shardID: number, shardCount: number];
|
||||
}
|
||||
>;
|
||||
export type GatewayReadyDispatch = DataPayload<GatewayDispatchEvents.Ready, GatewayReadyDispatchData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#ready
|
||||
*/
|
||||
export interface GatewayReadyDispatchData {
|
||||
v: number;
|
||||
user: APIUser;
|
||||
session_id: string;
|
||||
private_channels: [];
|
||||
guilds: APIUnavailableGuild[];
|
||||
shard?: [shardID: number, shardCount: number];
|
||||
application: Pick<APIApplication, 'id' | 'flags'>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resumed
|
||||
*/
|
||||
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-create
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-update
|
||||
@@ -285,42 +299,72 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
|
||||
*/
|
||||
export type GatewayChannelModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate,
|
||||
APIChannel
|
||||
GatewayChannelModifyDispatchData
|
||||
>;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-create
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-update
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-delete
|
||||
*/
|
||||
export type GatewayChannelModifyDispatchData = APIChannel;
|
||||
|
||||
export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayChannelCreateDispatchData = GatewayChannelModifyDispatchData;
|
||||
|
||||
export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayChannelUpdateDispatchData = GatewayChannelModifyDispatchData;
|
||||
|
||||
export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
|
||||
*/
|
||||
export type GatewayChannelPinsUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ChannelPinsUpdate,
|
||||
{
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
GatewayChannelPinsUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
|
||||
*/
|
||||
export interface GatewayChannelPinsUpdateDispatchData {
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*/
|
||||
export type GatewayGuildModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate,
|
||||
APIGuild
|
||||
GatewayGuildModifyDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*/
|
||||
export type GatewayGuildModifyDispatchData = APIGuild;
|
||||
|
||||
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
|
||||
export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData;
|
||||
|
||||
export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
|
||||
export type GatewayGuildUpdateDispatchData = GatewayGuildModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-delete
|
||||
*/
|
||||
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
|
||||
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, GatewayGuildDeleteDispatchData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-delete
|
||||
*/
|
||||
export type GatewayGuildDeleteDispatchData = APIUnavailableGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
|
||||
@@ -328,262 +372,413 @@ export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.Guild
|
||||
*/
|
||||
export type GatewayGuildBanModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove,
|
||||
{
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
GatewayGuildBanModifyDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
|
||||
*/
|
||||
export interface GatewayGuildBanModifyDispatchData {
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
|
||||
export type GatewayGuildBanAddDispatchData = GatewayGuildBanModifyDispatchData;
|
||||
|
||||
export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
|
||||
export type GatewayGuildBanRemoveDispatchData = GatewayGuildBanModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
|
||||
*/
|
||||
export type GatewayGuildEmojisUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildEmojisUpdate,
|
||||
{
|
||||
guild_id: string;
|
||||
emojis: APIEmoji[];
|
||||
}
|
||||
GatewayGuildEmojisUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
|
||||
*/
|
||||
export interface GatewayGuildEmojisUpdateDispatchData {
|
||||
guild_id: string;
|
||||
emojis: APIEmoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
|
||||
*/
|
||||
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildIntegrationsUpdate,
|
||||
{ guild_id: string }
|
||||
GatewayGuildIntegrationsUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
|
||||
*/
|
||||
export interface GatewayGuildIntegrationsUpdateDispatchData {
|
||||
guild_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-add
|
||||
*/
|
||||
export type GatewayGuildMemberAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberAdd,
|
||||
APIGuildMember & { guild_id: string }
|
||||
GatewayGuildMemberAddDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-add
|
||||
*/
|
||||
export interface GatewayGuildMemberAddDispatchData extends APIGuildMember {
|
||||
guild_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
|
||||
*/
|
||||
export type GatewayGuildMemberRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberRemove,
|
||||
{
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
GatewayGuildMemberRemoveDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
|
||||
*/
|
||||
export interface GatewayGuildMemberRemoveDispatchData {
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-update
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberUpdate,
|
||||
Omit<APIGuildMember, 'deaf' | 'mute'> & {
|
||||
guild_id: string;
|
||||
}
|
||||
GatewayGuildMemberUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-update
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' | 'mute'> & {
|
||||
guild_id: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
|
||||
*/
|
||||
export type GatewayGuildMembersChunkDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMembersChunk,
|
||||
{
|
||||
guild_id: string;
|
||||
members: APIGuildMember[];
|
||||
chunk_index?: number;
|
||||
chunk_count?: number;
|
||||
not_found?: unknown[];
|
||||
presences?: RawGatewayPresenceUpdate[];
|
||||
nonce?: string;
|
||||
}
|
||||
GatewayGuildMembersChunkDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
|
||||
*/
|
||||
export interface GatewayGuildMembersChunkDispatchData {
|
||||
guild_id: string;
|
||||
members: APIGuildMember[];
|
||||
chunk_index?: number;
|
||||
chunk_count?: number;
|
||||
not_found?: unknown[];
|
||||
presences?: RawGatewayPresenceUpdate[];
|
||||
nonce?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-update
|
||||
*/
|
||||
export type GatewayGuildRoleModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate,
|
||||
{
|
||||
guild_id: string;
|
||||
role: APIRole;
|
||||
}
|
||||
GatewayGuildRoleModifyDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-update
|
||||
*/
|
||||
export interface GatewayGuildRoleModifyDispatchData {
|
||||
guild_id: string;
|
||||
role: APIRole;
|
||||
}
|
||||
|
||||
export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
export type GatewayGuildRoleCreateDispatchData = GatewayGuildRoleModifyDispatchData;
|
||||
|
||||
export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
export type GatewayGuildRoleUpdateDispatchData = GatewayGuildRoleModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
|
||||
*/
|
||||
export type GatewayGuildRoleDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildRoleDelete,
|
||||
{
|
||||
guild_id: string;
|
||||
role_id: string;
|
||||
}
|
||||
GatewayGuildRoleDeleteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
|
||||
*/
|
||||
export interface GatewayGuildRoleDeleteDispatchData {
|
||||
guild_id: string;
|
||||
role_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#interaction-create
|
||||
*/
|
||||
export type GatewayInteractionCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.InteractionCreate,
|
||||
APIApplicationCommandInteraction
|
||||
GatewayInteractionCreateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#interaction-create
|
||||
*/
|
||||
export type GatewayInteractionCreateDispatchData = APIApplicationCommandInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-create
|
||||
*/
|
||||
export type GatewayInviteCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.InviteCreate,
|
||||
{
|
||||
channel_id: string;
|
||||
code: string;
|
||||
created_at: number;
|
||||
guild_id?: string;
|
||||
inviter?: APIUser;
|
||||
max_age: number;
|
||||
max_uses: number;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
temporary: boolean;
|
||||
uses: 0;
|
||||
}
|
||||
GatewayInviteCreateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-create
|
||||
*/
|
||||
export interface GatewayInviteCreateDispatchData {
|
||||
channel_id: string;
|
||||
code: string;
|
||||
created_at: number;
|
||||
guild_id?: string;
|
||||
inviter?: APIUser;
|
||||
max_age: number;
|
||||
max_uses: number;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
temporary: boolean;
|
||||
uses: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-delete
|
||||
*/
|
||||
export type GatewayInviteDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.InviteDelete,
|
||||
{
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
code: string;
|
||||
}
|
||||
GatewayInviteDeleteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-delete
|
||||
*/
|
||||
export interface GatewayInviteDeleteDispatchData {
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
code: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
*/
|
||||
export type GatewayMessageCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageCreate,
|
||||
GatewayMessageCreateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
*/
|
||||
export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
|
||||
export type GatewayMessageCreateDispatchData = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageUpdate,
|
||||
{ id: string; channel_id: string } & Partial<APIMessage>
|
||||
GatewayMessageUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = {
|
||||
id: string;
|
||||
channel_id: string;
|
||||
} & Partial<APIMessage>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
*/
|
||||
export type GatewayMessageDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageDelete,
|
||||
{
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
GatewayMessageDeleteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
*/
|
||||
export interface GatewayMessageDeleteDispatchData {
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
|
||||
*/
|
||||
export type GatewayMessageDeleteBulkDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageDeleteBulk,
|
||||
{
|
||||
ids: string[];
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
GatewayMessageDeleteBulkDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
|
||||
*/
|
||||
export interface GatewayMessageDeleteBulkDispatchData {
|
||||
ids: string[];
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemoveAll,
|
||||
MessageReactionRemoveData
|
||||
GatewayMessageReactionRemoveAllDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveAllDispatchData = MessageReactionRemoveData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemoveEmoji,
|
||||
MessageReactionRemoveData & {
|
||||
emoji: APIEmoji;
|
||||
}
|
||||
GatewayMessageReactionRemoveEmojiDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
|
||||
*/
|
||||
export interface GatewayMessageReactionRemoveEmojiDispatchData extends MessageReactionRemoveData {
|
||||
emoji: APIEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.PresenceUpdate,
|
||||
GatewayPresenceUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
|
||||
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#typing-start
|
||||
*/
|
||||
export type GatewayTypingStartDispatch = DataPayload<
|
||||
GatewayDispatchEvents.TypingStart,
|
||||
{
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
user_id: string;
|
||||
timestamp: number;
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
>;
|
||||
export type GatewayTypingStartDispatch = DataPayload<GatewayDispatchEvents.TypingStart, GatewayTypingStartDispatchData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#typing-start
|
||||
*/
|
||||
export interface GatewayTypingStartDispatchData {
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
user_id: string;
|
||||
timestamp: number;
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#user-update
|
||||
*/
|
||||
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
|
||||
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, GatewayUserUpdateDispatchData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#user-update
|
||||
*/
|
||||
export type GatewayUserUpdateDispatchData = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-state-update
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
|
||||
export type GatewayVoiceStateUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.VoiceStateUpdate,
|
||||
GatewayVoiceStateUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-state-update
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-server-update
|
||||
*/
|
||||
export type GatewayVoiceServerUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.VoiceServerUpdate,
|
||||
{
|
||||
token: string;
|
||||
guild_id: string;
|
||||
endpoint: string;
|
||||
}
|
||||
GatewayVoiceServerUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-server-update
|
||||
*/
|
||||
export interface GatewayVoiceServerUpdateDispatchData {
|
||||
token: string;
|
||||
guild_id: string;
|
||||
endpoint: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#webhooks-update
|
||||
*/
|
||||
export type GatewayWebhooksUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.WebhooksUpdate,
|
||||
{
|
||||
guild_id: string;
|
||||
channel_id: string;
|
||||
}
|
||||
GatewayWebhooksUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#webhooks-update
|
||||
*/
|
||||
export interface GatewayWebhooksUpdateDispatchData {
|
||||
guild_id: string;
|
||||
channel_id: string;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -593,9 +788,14 @@ export type GatewayWebhooksUpdateDispatch = DataPayload<
|
||||
*/
|
||||
export interface GatewayHeartbeat {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
d: number | null;
|
||||
d: GatewayHeartbeatData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
*/
|
||||
export type GatewayHeartbeatData = number | null;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
|
||||
*/
|
||||
@@ -610,17 +810,22 @@ export interface GatewayIdentifyProperties {
|
||||
*/
|
||||
export interface GatewayIdentify {
|
||||
op: GatewayOPCodes.Identify;
|
||||
d: {
|
||||
token: string;
|
||||
properties: GatewayIdentifyProperties;
|
||||
compress?: boolean;
|
||||
large_threshold?: number;
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
shard?: [shard_id: number, shard_count: number];
|
||||
presence?: GatewayPresenceUpdateData;
|
||||
guild_subscriptions?: boolean;
|
||||
intents: number;
|
||||
};
|
||||
d: GatewayIdentifyData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify
|
||||
*/
|
||||
export interface GatewayIdentifyData {
|
||||
token: string;
|
||||
properties: GatewayIdentifyProperties;
|
||||
compress?: boolean;
|
||||
large_threshold?: number;
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
shard?: [shard_id: number, shard_count: number];
|
||||
presence?: GatewayPresenceUpdateData;
|
||||
guild_subscriptions?: boolean;
|
||||
intents: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -628,11 +833,16 @@ export interface GatewayIdentify {
|
||||
*/
|
||||
export interface GatewayResume {
|
||||
op: GatewayOPCodes.Resume;
|
||||
d: {
|
||||
token: string;
|
||||
session_id: string;
|
||||
seq: number;
|
||||
};
|
||||
d: GatewayResumeData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resume
|
||||
*/
|
||||
export interface GatewayResumeData {
|
||||
token: string;
|
||||
session_id: string;
|
||||
seq: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -640,14 +850,19 @@ export interface GatewayResume {
|
||||
*/
|
||||
export interface GatewayRequestGuildMembers {
|
||||
op: GatewayOPCodes.RequestGuildMembers;
|
||||
d: {
|
||||
guild_id: string | string[];
|
||||
query?: string;
|
||||
limit: number;
|
||||
presences?: boolean;
|
||||
user_ids?: string | string[];
|
||||
nonce?: string;
|
||||
};
|
||||
d: GatewayRequestGuildMembersData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
*/
|
||||
export interface GatewayRequestGuildMembersData {
|
||||
guild_id: string | string[];
|
||||
query?: string;
|
||||
limit: number;
|
||||
presences?: boolean;
|
||||
user_ids?: string | string[];
|
||||
nonce?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -655,12 +870,17 @@ export interface GatewayRequestGuildMembers {
|
||||
*/
|
||||
export interface GatewayVoiceStateUpdate {
|
||||
op: GatewayOPCodes.VoiceStateUpdate;
|
||||
d: {
|
||||
guild_id: string;
|
||||
channel_id: string | null;
|
||||
self_mute: boolean;
|
||||
self_deaf: boolean;
|
||||
};
|
||||
d: GatewayVoiceStateUpdateData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-voice-state
|
||||
*/
|
||||
export interface GatewayVoiceStateUpdateData {
|
||||
guild_id: string;
|
||||
channel_id: string | null;
|
||||
self_mute: boolean;
|
||||
self_deaf: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,4 +24,5 @@ export interface APIApplication {
|
||||
primary_sku_id?: string;
|
||||
slug?: string;
|
||||
cover_image?: string;
|
||||
flags?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user