discord-slim
Advanced tools
Comparing version 2.6.2 to 2.6.3
@@ -62,3 +62,3 @@ /// <reference types="node" /> | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
threads: types.Channel[]; | ||
threads: types.Thread[]; | ||
members: types.ThreadMember[]; | ||
@@ -71,3 +71,3 @@ has_more: boolean; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
threads: types.Channel[]; | ||
threads: types.Thread[]; | ||
members: types.ThreadMember[]; | ||
@@ -80,3 +80,3 @@ has_more: boolean; | ||
} | undefined, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
threads: types.Channel[]; | ||
threads: types.Thread[]; | ||
members: types.ThreadMember[]; | ||
@@ -136,3 +136,3 @@ has_more: boolean; | ||
icon?: string; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.GroupDMChannel>; | ||
}; | ||
@@ -192,3 +192,3 @@ export declare const Guild: { | ||
ListActiveThreads: (guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<{ | ||
threads: types.Channel[]; | ||
threads: types.Thread[]; | ||
members: types.ThreadMember[]; | ||
@@ -376,3 +376,3 @@ }>; | ||
recipient_id: string; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.DMChannel>; | ||
GetConnections: (requestOptions?: RequestOptions | undefined) => Promise<types.Connection[]>; | ||
@@ -454,20 +454,5 @@ }; | ||
})[]>; | ||
CreateGlobalCommand: (application_id: string, params: { | ||
name: string; | ||
name_localizations?: types.LocaleDictionary | null; | ||
description: string; | ||
description_localizations?: types.LocaleDictionary | null; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
type?: helpers.ApplicationCommandTypes; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
CreateGlobalCommand: (application_id: string, params: types.ApplicationCommandBase, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
GetGlobalCommand: (application_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
EditGlobalCommand: (application_id: string, command_id: string, params: { | ||
name?: string; | ||
name_localizations?: types.LocaleDictionary | null; | ||
description?: string; | ||
description_localizations?: types.LocaleDictionary | null; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
EditGlobalCommand: (application_id: string, command_id: string, params: Partial<Omit<types.ApplicationCommandBase, 'type'>>, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
DeleteGlobalCommand: (application_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
@@ -480,39 +465,8 @@ GetGuildCommands: (application_id: string, guild_id: string, params?: { | ||
})[]>; | ||
BulkOverwriteGlobalCommands: (application_id: string, params: { | ||
name: string; | ||
name_localizations?: types.LocaleDictionary | null; | ||
description: string; | ||
description_localizations?: types.LocaleDictionary | null; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
type?: helpers.ApplicationCommandTypes; | ||
}[], requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand[]>; | ||
CreateGuildCommand: (application_id: string, guild_id: string, params: { | ||
name: string; | ||
name_localizations?: types.LocaleDictionary | null; | ||
description: string; | ||
description_localizations?: types.LocaleDictionary | null; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
type?: helpers.ApplicationCommandTypes; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
BulkOverwriteGlobalCommands: (application_id: string, params: types.ApplicationCommandBase[], requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand[]>; | ||
CreateGuildCommand: (application_id: string, guild_id: string, params: types.ApplicationCommandBase, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
GetGuildCommand: (application_id: string, guild_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
EditGuildCommand: (application_id: string, guild_id: string, command_id: string, params: { | ||
name?: string; | ||
name_localizations?: types.LocaleDictionary | null; | ||
description?: string; | ||
description_localizations?: types.LocaleDictionary | null; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
EditGuildCommand: (application_id: string, guild_id: string, command_id: string, params: Partial<Omit<types.ApplicationCommandBase, 'type'>>, requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand>; | ||
DeleteGuildCommand: (application_id: string, guild_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
BulkOverwriteGuildCommands: (application_id: string, guild_id: string, params: { | ||
name: string; | ||
name_localizations?: types.LocaleDictionary | null; | ||
description: string; | ||
description_localizations?: types.LocaleDictionary | null; | ||
options?: types.ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
type?: helpers.ApplicationCommandTypes; | ||
}[], requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand[]>; | ||
BulkOverwriteGuildCommands: (application_id: string, guild_id: string, params: types.ApplicationCommandBase[], requestOptions?: RequestOptions | undefined) => Promise<types.ApplicationCommand[]>; | ||
GetGuildCommandPermissions: (application_id: string, guild_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.GuildApplicationCommandPermissions[]>; | ||
@@ -583,3 +537,3 @@ GetCommandPermissions: (application_id: string, guild_id: string, command_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.GuildApplicationCommandPermissions>; | ||
export declare const Thread: { | ||
Modify: (channel_id: string, params: { | ||
Modify: (thread_id: string, params: { | ||
name?: string; | ||
@@ -591,4 +545,4 @@ archived?: boolean; | ||
rate_limit_per_user?: number | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
Delete: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Thread>; | ||
Delete: (thread_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.Thread>; | ||
StartWithMessage: (channel_id: string, message_id: string, params: { | ||
@@ -598,3 +552,3 @@ name: string; | ||
rate_limit_per_user?: number | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Thread>; | ||
Start: (channel_id: string, params: { | ||
@@ -606,9 +560,9 @@ name: string; | ||
rate_limit_per_user?: number | null; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Channel>; | ||
Join: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
AddMember: (channel_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Leave: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
RemoveMember: (channel_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
GetMember: (channel_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ThreadMember>; | ||
ListMembers: (channel_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ThreadMember[]>; | ||
}, requestOptions?: RequestOptions | undefined) => Promise<types.Thread>; | ||
Join: (thread_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
AddMember: (thread_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
Leave: (thread_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
RemoveMember: (thread_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<null>; | ||
GetMember: (thread_id: string, user_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ThreadMember>; | ||
ListMembers: (thread_id: string, requestOptions?: RequestOptions | undefined) => Promise<types.ThreadMember[]>; | ||
}; | ||
@@ -615,0 +569,0 @@ export declare const StageInstance: { |
@@ -183,12 +183,12 @@ import { URLSearchParams } from 'url'; | ||
export const Thread = { | ||
Modify: (channel_id, params, requestOptions) => Request("PATCH", Path("channels", channel_id), requestOptions, params), | ||
Delete: (channel_id, requestOptions) => Request("DELETE", Path("channels", channel_id), requestOptions), | ||
Modify: (thread_id, params, requestOptions) => Request("PATCH", Path("channels", thread_id), requestOptions, params), | ||
Delete: (thread_id, requestOptions) => Request("DELETE", Path("channels", thread_id), requestOptions), | ||
StartWithMessage: (channel_id, message_id, params, requestOptions) => Request("POST", Path("channels", channel_id, "messages", message_id, "threads"), requestOptions, params), | ||
Start: (channel_id, params, requestOptions) => Request("POST", Path("channels", channel_id, "threads"), requestOptions, params), | ||
Join: (channel_id, requestOptions) => Request("PUT", Path("channels", channel_id, "thread-members", "@me"), requestOptions), | ||
AddMember: (channel_id, user_id, requestOptions) => Request("PUT", Path("channels", channel_id, "thread-members", user_id), requestOptions), | ||
Leave: (channel_id, requestOptions) => Request("DELETE", Path("channels", channel_id, "thread-members", "@me"), requestOptions), | ||
RemoveMember: (channel_id, user_id, requestOptions) => Request("DELETE", Path("channels", channel_id, "thread-members", user_id), requestOptions), | ||
GetMember: (channel_id, user_id, requestOptions) => Request("GET", Path("channels", channel_id, "thread-members", user_id), requestOptions), | ||
ListMembers: (channel_id, requestOptions) => Request("GET", Path("channels", channel_id, "thread-members"), requestOptions), | ||
Join: (thread_id, requestOptions) => Request("PUT", Path("channels", thread_id, "thread-members", "@me"), requestOptions), | ||
AddMember: (thread_id, user_id, requestOptions) => Request("PUT", Path("channels", thread_id, "thread-members", user_id), requestOptions), | ||
Leave: (thread_id, requestOptions) => Request("DELETE", Path("channels", thread_id, "thread-members", "@me"), requestOptions), | ||
RemoveMember: (thread_id, user_id, requestOptions) => Request("DELETE", Path("channels", thread_id, "thread-members", user_id), requestOptions), | ||
GetMember: (thread_id, user_id, requestOptions) => Request("GET", Path("channels", thread_id, "thread-members", user_id), requestOptions), | ||
ListMembers: (thread_id, requestOptions) => Request("GET", Path("channels", thread_id, "thread-members"), requestOptions), | ||
}; | ||
@@ -195,0 +195,0 @@ export const StageInstance = { |
@@ -1,2 +0,2 @@ | ||
import WebSocket from 'ws'; | ||
import { WebSocket } from 'ws'; | ||
import { EventEmitter } from 'events'; | ||
@@ -3,0 +3,0 @@ import { Intents, TokenTypes, API_VERSION } from './helpers.js'; |
@@ -79,9 +79,9 @@ /// <reference types="node" /> | ||
}; | ||
[Events.THREAD_CREATE]: types.Channel; | ||
[Events.THREAD_UPDATE]: types.Channel; | ||
[Events.THREAD_DELETE]: types.Channel; | ||
[Events.THREAD_CREATE]: types.Thread; | ||
[Events.THREAD_UPDATE]: types.Thread; | ||
[Events.THREAD_DELETE]: types.Thread; | ||
[Events.THREAD_LIST_SYNC]: { | ||
guild_id: string; | ||
channel_ids?: string[]; | ||
threads: types.Channel[]; | ||
threads: types.Thread[]; | ||
members: types.ThreadMember[]; | ||
@@ -107,3 +107,3 @@ }; | ||
channels: types.Channel[]; | ||
threads: types.Channel[]; | ||
threads: types.Thread[]; | ||
presences: types.Presence[]; | ||
@@ -110,0 +110,0 @@ stage_instances: types.StageInstance[]; |
@@ -1,2 +0,2 @@ | ||
import https from 'https'; | ||
import * as https from 'https'; | ||
import { SafeJsonParse } from './util.js'; | ||
@@ -3,0 +3,0 @@ import { API_PATH, TokenTypes } from './helpers.js'; |
@@ -112,2 +112,7 @@ import * as helpers from './helpers.js'; | ||
}; | ||
export declare const Utils: { | ||
GetUserCreationDate: (user: types.User | { | ||
id: string; | ||
} | string) => Date; | ||
}; | ||
export {}; |
@@ -86,1 +86,4 @@ import * as helpers from './helpers.js'; | ||
}; | ||
export const Utils = { | ||
GetUserCreationDate: (user) => new Date(Number(BigInt(EID(user)) >> 22n) + 1420070400000), | ||
}; |
@@ -6,3 +6,3 @@ import type * as helpers from './helpers'; | ||
integrations: Integration[]; | ||
threads: Channel[]; | ||
threads: Thread[]; | ||
users: User[]; | ||
@@ -118,30 +118,72 @@ webhooks: Webhook[]; | ||
}; | ||
export declare type Channel = { | ||
export declare type Channel = (GuildTextChannel | GuildCategory | GuildVoiceChannel | DMChannel | GroupDMChannel | Thread); | ||
export declare type GuildTextChannel = { | ||
id: string; | ||
type: helpers.ChannelTypes; | ||
guild_id?: string; | ||
position?: number; | ||
type: (helpers.ChannelTypes.GUILD_TEXT | helpers.ChannelTypes.GUILD_NEWS); | ||
guild_id: string; | ||
position: number; | ||
permission_overwrites?: PermissionsOverwrite[]; | ||
name?: string | null; | ||
topic?: string | null; | ||
nsfw?: boolean; | ||
last_message_id?: string | null; | ||
bitrate?: number; | ||
user_limit?: number; | ||
rate_limit_per_user?: number; | ||
recipients?: User[]; | ||
icon?: string | null; | ||
owner_id?: string; | ||
name: string; | ||
topic: string | null; | ||
nsfw: boolean; | ||
last_message_id: string | null; | ||
rate_limit_per_user: number; | ||
parent_id: string | null; | ||
last_pin_timestamp: string | null; | ||
}; | ||
export declare type GuildCategory = { | ||
id: string; | ||
type: helpers.ChannelTypes.GUILD_CATEGORY; | ||
guild_id: string; | ||
position: number; | ||
permission_overwrites?: PermissionsOverwrite[]; | ||
name: string; | ||
}; | ||
export declare type GuildVoiceChannel = { | ||
id: string; | ||
type: (helpers.ChannelTypes.GUILD_VOICE | helpers.ChannelTypes.GUILD_STAGE_VOICE); | ||
guild_id: string; | ||
position: number; | ||
permission_overwrites?: PermissionsOverwrite[]; | ||
name: string; | ||
bitrate: number; | ||
user_limit: number; | ||
parent_id: string | null; | ||
rtc_region: string | null; | ||
video_quality_mode: helpers.VideoQualityModes; | ||
}; | ||
export declare type DMChannel = { | ||
id: string; | ||
type: helpers.ChannelTypes.DM; | ||
last_message_id: string | null; | ||
recipients: User[]; | ||
last_pin_timestamp: string | null; | ||
}; | ||
export declare type GroupDMChannel = { | ||
id: string; | ||
type: helpers.ChannelTypes.GROUP_DM; | ||
name: string; | ||
last_message_id: string | null; | ||
recipients: User[]; | ||
icon: string | null; | ||
owner_id: string; | ||
application_id?: string; | ||
parent_id?: string | null; | ||
last_pin_timestamp?: string | null; | ||
rtc_region?: string | null; | ||
video_quality_mode?: helpers.VideoQualityModes; | ||
message_count?: number; | ||
member_count?: number; | ||
thread_metadata?: ThreadMetadata; | ||
member?: ThreadMember; | ||
default_auto_archive_duration?: helpers.ThreadArchiveDurations; | ||
permissions?: string; | ||
last_pin_timestamp: string | null; | ||
}; | ||
export declare type Thread = { | ||
id: string; | ||
type: (helpers.ChannelTypes.GUILD_PUBLIC_THREAD | helpers.ChannelTypes.GUILD_PRIVATE_THREAD | helpers.ChannelTypes.GUILD_NEWS_THREAD); | ||
guild_id: string; | ||
name: string; | ||
last_message_id: string | null; | ||
rate_limit_per_user: number; | ||
owner_id: string; | ||
parent_id: string; | ||
last_pin_timestamp: string | null; | ||
message_count: number; | ||
member_count: number; | ||
thread_metadata: ThreadMetadata; | ||
member: ThreadMember; | ||
default_auto_archive_duration: helpers.ThreadArchiveDurations; | ||
}; | ||
export declare type Message = { | ||
@@ -159,3 +201,3 @@ id: string; | ||
mentions: (User & { | ||
member?: Member; | ||
member?: Omit<Member, 'user'>; | ||
})[]; | ||
@@ -178,3 +220,3 @@ mention_roles: string[]; | ||
interaction?: MessageInteraction; | ||
thread?: Channel; | ||
thread?: Thread; | ||
components?: ActionRow[]; | ||
@@ -546,16 +588,36 @@ sticker_items?: StickerItem[]; | ||
url?: string; | ||
}; | ||
export declare type ApplicationCommand = { | ||
id: string; | ||
} & ({ | ||
type: helpers.WebhookTypes.INCOMING; | ||
token: string; | ||
} | { | ||
token?: undefined; | ||
}) & ({ | ||
type: helpers.WebhookTypes.CHANNEL_FOLLOWER; | ||
source_guild: Guild; | ||
source_channel: Channel; | ||
} | { | ||
source_guild?: undefined; | ||
source_channel?: undefined; | ||
}); | ||
export declare type ApplicationCommandBase = { | ||
type?: helpers.ApplicationCommandTypes; | ||
application_id: string; | ||
guild_id?: string; | ||
name: string; | ||
name_localizations?: LocaleDictionary | null; | ||
description: string; | ||
description?: string; | ||
description_localizations?: LocaleDictionary | null; | ||
options?: ApplicationCommandOption[]; | ||
default_permission?: boolean; | ||
} & ({ | ||
type?: helpers.ApplicationCommandTypes.CHAT_INPUT; | ||
description: string; | ||
} | { | ||
description?: ''; | ||
options?: undefined; | ||
}); | ||
export declare type ApplicationCommand = { | ||
id: string; | ||
application_id: string; | ||
guild_id?: string; | ||
version: string; | ||
}; | ||
} & ApplicationCommandBase; | ||
export declare type ApplicationCommandOption = { | ||
@@ -568,3 +630,3 @@ type: helpers.ApplicationCommandOptionTypes; | ||
required?: boolean; | ||
choices?: ApplicationCommandOptionChoice[]; | ||
choices?: ApplicationCommandOptionChoice<string | number>[]; | ||
options?: ApplicationCommandOption[]; | ||
@@ -575,7 +637,27 @@ channel_types?: helpers.ChannelTypes[]; | ||
autocomplete?: boolean; | ||
}; | ||
export declare type ApplicationCommandOptionChoice = { | ||
} & ({ | ||
type: helpers.ApplicationCommandOptionTypes.STRING; | ||
choices?: ApplicationCommandOptionChoice<string>[]; | ||
min_value?: undefined; | ||
max_value?: undefined; | ||
} | { | ||
type: (helpers.ApplicationCommandOptionTypes.INTEGER | helpers.ApplicationCommandOptionTypes.NUMBER); | ||
choices?: ApplicationCommandOptionChoice<number>[]; | ||
} | { | ||
choices?: undefined; | ||
min_value?: undefined; | ||
max_value?: undefined; | ||
autocomplete?: undefined; | ||
}) & ({ | ||
choices: ApplicationCommandOptionChoice<string | number>[]; | ||
autocomplete?: false; | ||
min_value?: undefined; | ||
max_value?: undefined; | ||
} | { | ||
choices?: undefined; | ||
}); | ||
export declare type ApplicationCommandOptionChoice<T> = { | ||
name: string; | ||
name_localizations?: LocaleDictionary | null; | ||
value: string | number; | ||
value: T; | ||
}; | ||
@@ -600,3 +682,3 @@ export declare type GuildApplicationCommandPermissions = { | ||
type: helpers.InteractionTypes; | ||
data?: InteractionData; | ||
data?: (InteractionData | InteractionDataComponent | InteractionDataModal); | ||
guild_id?: string; | ||
@@ -611,14 +693,58 @@ channel_id?: string; | ||
guild_locale?: helpers.Locales; | ||
}; | ||
} & ({ | ||
type: (helpers.InteractionTypes.APPLICATION_COMMAND | helpers.InteractionTypes.APPLICATION_COMMAND_AUTOCOMPLETE | helpers.InteractionTypes.PING); | ||
data: InteractionData; | ||
} | { | ||
type: helpers.InteractionTypes.MESSAGE_COMPONENT; | ||
data: InteractionDataComponent; | ||
} | { | ||
type: helpers.InteractionTypes.MODAL_SUBMIT; | ||
data: InteractionDataComponent; | ||
} | { | ||
data?: undefined; | ||
}) & ({ | ||
guild_id: string; | ||
member: Member; | ||
user?: undefined; | ||
guild_locale: helpers.Locales; | ||
} | { | ||
guild_id?: undefined; | ||
member?: undefined; | ||
user: User; | ||
guild_locale?: undefined; | ||
}) & ({ | ||
type: helpers.InteractionTypes.PING; | ||
locale?: undefined; | ||
} | { | ||
locale: helpers.Locales; | ||
}); | ||
export declare type InteractionData = { | ||
id: string; | ||
name: string; | ||
type?: helpers.ApplicationCommandTypes; | ||
type: helpers.ApplicationCommandTypes; | ||
resolved?: InteractionDataResolved; | ||
options?: InteractionDataOption[]; | ||
custom_id?: string; | ||
component_type?: helpers.ComponentTypes; | ||
guild_id?: string; | ||
target_id?: string; | ||
} & ({ | ||
type: (helpers.ApplicationCommandTypes.USER | helpers.ApplicationCommandTypes.MESSAGE); | ||
options?: undefined; | ||
target_id: string; | ||
} | { | ||
options: InteractionDataOption[]; | ||
target_id?: undefined; | ||
}); | ||
export declare type InteractionDataComponent = { | ||
custom_id: string; | ||
component_type: helpers.ComponentTypes; | ||
values?: SelectOption[]; | ||
target_id?: string; | ||
components?: Component[]; | ||
} & ({ | ||
component_type: helpers.ComponentTypes.SELECT_MENU; | ||
values: SelectOption[]; | ||
} | { | ||
values?: undefined; | ||
}); | ||
export declare type InteractionDataModal = { | ||
custom_id: string; | ||
components: Component[]; | ||
}; | ||
@@ -630,3 +756,3 @@ export declare type InteractionDataResolved = { | ||
members?: { | ||
[id: string]: Member; | ||
[id: string]: Omit<Member, 'user' | 'deaf' | 'mute'>; | ||
}; | ||
@@ -637,3 +763,10 @@ roles?: { | ||
channels?: { | ||
[id: string]: Channel; | ||
[id: string]: { | ||
id: string; | ||
type: helpers.ChannelTypes; | ||
name?: string; | ||
thread_metadata?: ThreadMetadata; | ||
parent_id?: string | null; | ||
permissions?: string; | ||
}; | ||
}; | ||
@@ -653,3 +786,19 @@ messages?: { | ||
focused?: boolean; | ||
}; | ||
} & ({ | ||
type: (helpers.ApplicationCommandOptionTypes.STRING | helpers.ApplicationCommandOptionTypes.USER | helpers.ApplicationCommandOptionTypes.CHANNEL | helpers.ApplicationCommandOptionTypes.ROLE | helpers.ApplicationCommandOptionTypes.MENTIONABLE | helpers.ApplicationCommandOptionTypes.ATTACHMENT); | ||
value: string; | ||
options?: undefined; | ||
} | { | ||
type: (helpers.ApplicationCommandOptionTypes.INTEGER | helpers.ApplicationCommandOptionTypes.NUMBER); | ||
value: number; | ||
options?: undefined; | ||
} | { | ||
type: helpers.ApplicationCommandOptionTypes.BOOLEAN; | ||
value: boolean; | ||
options?: undefined; | ||
} | { | ||
type: (helpers.ApplicationCommandOptionTypes.SUB_COMMAND | helpers.ApplicationCommandOptionTypes.SUB_COMMAND_GROUP); | ||
value?: undefined; | ||
options: InteractionDataOption[]; | ||
}); | ||
export declare type MessageInteraction = { | ||
@@ -660,7 +809,7 @@ id: string; | ||
user: User; | ||
member?: Member; | ||
member?: Omit<Member, 'user'>; | ||
}; | ||
export declare type InteractionResponse = { | ||
type: helpers.InteractionCallbackTypes.PONG; | ||
} | { | ||
type: helpers.InteractionCallbackTypes; | ||
} & ({ | ||
type: (helpers.InteractionCallbackTypes.CHANNEL_MESSAGE_WITH_SOURCE | helpers.InteractionCallbackTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE | helpers.InteractionCallbackTypes.DEFERRED_UPDATE_MESSAGE | helpers.InteractionCallbackTypes.UPDATE_MESSAGE); | ||
@@ -674,3 +823,3 @@ data: InteractionCallbackData; | ||
data: InteractionModalCallbackData; | ||
}; | ||
}); | ||
export declare type InteractionCallbackData = { | ||
@@ -686,3 +835,3 @@ tts?: boolean; | ||
export declare type InteractionAutocompleteCallbackData = { | ||
choices: ApplicationCommandOptionChoice[]; | ||
choices: ApplicationCommandOptionChoice<string | number>[]; | ||
}; | ||
@@ -692,3 +841,3 @@ export declare type InteractionModalCallbackData = { | ||
title: string; | ||
components: Component[]; | ||
components: TextInput[]; | ||
}; | ||
@@ -790,3 +939,3 @@ export declare type Presence = { | ||
type: helpers.ComponentTypes.ACTION_ROW; | ||
components: (Button | SelectMenu | TextInput)[]; | ||
components: Exclude<Component, ActionRow>[]; | ||
}; | ||
@@ -797,7 +946,15 @@ export declare type Button = { | ||
label?: string; | ||
emoji?: Emoji; | ||
emoji?: Pick<Emoji, 'name' | 'id' | 'animated'>; | ||
custom_id?: string; | ||
url?: string; | ||
disabled?: boolean; | ||
}; | ||
} & ({ | ||
style: Exclude<helpers.ButtonStyles, helpers.ButtonStyles.LINK>; | ||
custom_id: string; | ||
url?: undefined; | ||
} | { | ||
style: Exclude<helpers.ButtonStyles, helpers.ButtonStyles.LINK>; | ||
custom_id?: undefined; | ||
url: string; | ||
}); | ||
export declare type SelectMenu = { | ||
@@ -816,3 +973,3 @@ type: helpers.ComponentTypes.SELECT_MENU; | ||
description?: string; | ||
emoji?: Emoji; | ||
emoji?: Pick<Emoji, 'name' | 'id' | 'animated'>; | ||
default?: boolean; | ||
@@ -851,3 +1008,16 @@ }; | ||
sort_value?: number; | ||
}; | ||
} & ({ | ||
type: helpers.StickerTypes.STANDARD; | ||
pack_id: string; | ||
available?: undefined; | ||
guild_id?: undefined; | ||
user?: undefined; | ||
sort_value: number; | ||
} | { | ||
type: helpers.StickerTypes.GUILD; | ||
pack_id?: undefined; | ||
available: boolean; | ||
guild_id: string; | ||
sort_value?: undefined; | ||
}); | ||
export declare type StickerItem = { | ||
@@ -854,0 +1024,0 @@ id: string; |
@@ -1,2 +0,2 @@ | ||
import WebSocket from 'ws'; | ||
import { WebSocket } from 'ws'; | ||
import { EventEmitter } from 'events'; | ||
@@ -3,0 +3,0 @@ import { Sleep, SafeJsonParse } from './util.js'; |
{ | ||
"name": "discord-slim", | ||
"version": "2.6.2", | ||
"version": "2.6.3", | ||
"description": "Lightweight Discord API library for Node.js.", | ||
@@ -5,0 +5,0 @@ "author": "Hanabishi", |
183733
4042