@zygout/eris 0.0.0-stage → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +80 -3
- package/esm.mjs +72 -0
- package/index.d.ts +4397 -0
- package/index.js +75 -0
- package/lib/Client.js +4683 -0
- package/lib/Constants.d.ts +988 -0
- package/lib/Constants.js +1161 -0
- package/lib/command/Command.js +552 -0
- package/lib/command/CommandClient.js +460 -0
- package/lib/errors/DiscordHTTPError.js +63 -0
- package/lib/errors/DiscordRESTError.js +77 -0
- package/lib/gateway/Shard.js +3029 -0
- package/lib/gateway/ShardManager.js +164 -0
- package/lib/rest/Endpoints.js +172 -0
- package/lib/rest/RequestHandler.js +459 -0
- package/lib/structures/ApplicationCommand.js +125 -0
- package/lib/structures/AutoModerationRule.js +143 -0
- package/lib/structures/AutocompleteInteraction.js +80 -0
- package/lib/structures/Base.js +81 -0
- package/lib/structures/CategoryChannel.js +77 -0
- package/lib/structures/Channel.js +98 -0
- package/lib/structures/CommandInteraction.js +473 -0
- package/lib/structures/ComponentInteraction.js +538 -0
- package/lib/structures/DMChannel.js +278 -0
- package/lib/structures/Entitlement.js +77 -0
- package/lib/structures/ExtendedUser.js +46 -0
- package/lib/structures/ForumChannel.js +24 -0
- package/lib/structures/GroupChannel.js +106 -0
- package/lib/structures/Guild.js +1677 -0
- package/lib/structures/GuildAuditLogEntry.js +190 -0
- package/lib/structures/GuildChannel.js +128 -0
- package/lib/structures/GuildIntegration.js +99 -0
- package/lib/structures/GuildPreview.js +97 -0
- package/lib/structures/GuildScheduledEvent.js +176 -0
- package/lib/structures/GuildTemplate.js +76 -0
- package/lib/structures/GuildTextableChannel.js +260 -0
- package/lib/structures/Interaction.js +133 -0
- package/lib/structures/Invite.js +143 -0
- package/lib/structures/Lobby.js +108 -0
- package/lib/structures/LobbyMember.js +59 -0
- package/lib/structures/MediaChannel.js +216 -0
- package/lib/structures/Member.js +371 -0
- package/lib/structures/Message.js +708 -0
- package/lib/structures/ModalSubmitInteraction.js +478 -0
- package/lib/structures/NewsChannel.js +34 -0
- package/lib/structures/NewsThreadChannel.js +12 -0
- package/lib/structures/Permission.js +80 -0
- package/lib/structures/PermissionOverwrite.js +32 -0
- package/lib/structures/PingInteraction.js +39 -0
- package/lib/structures/PrivateThreadChannel.js +25 -0
- package/lib/structures/PublicThreadChannel.js +26 -0
- package/lib/structures/Role.js +163 -0
- package/lib/structures/SKU.js +80 -0
- package/lib/structures/SoundboardSound.js +79 -0
- package/lib/structures/StageChannel.js +59 -0
- package/lib/structures/StageInstance.js +55 -0
- package/lib/structures/Subscription.js +69 -0
- package/lib/structures/TextChannel.js +202 -0
- package/lib/structures/ThreadChannel.js +143 -0
- package/lib/structures/ThreadMember.js +59 -0
- package/lib/structures/UnavailableGuild.js +26 -0
- package/lib/structures/UnknownInteraction.js +502 -0
- package/lib/structures/User.js +296 -0
- package/lib/structures/VoiceChannel.js +166 -0
- package/lib/structures/VoiceState.js +84 -0
- package/lib/util/BrowserWebSocket.js +76 -0
- package/lib/util/Bucket.js +89 -0
- package/lib/util/Collection.js +202 -0
- package/lib/util/MultipartData.js +70 -0
- package/lib/util/Opus.js +33 -0
- package/lib/util/SequentialBucket.js +83 -0
- package/lib/util/emitDeprecation.js +26 -0
- package/lib/voice/Piper.js +300 -0
- package/lib/voice/SharedStream.js +238 -0
- package/lib/voice/VoiceConnection.js +1440 -0
- package/lib/voice/VoiceConnectionManager.js +151 -0
- package/lib/voice/VoiceDataStream.js +22 -0
- package/lib/voice/streams/BaseTransformer.js +40 -0
- package/lib/voice/streams/DCAOpusTransformer.js +78 -0
- package/lib/voice/streams/FFmpegDuplex.js +192 -0
- package/lib/voice/streams/FFmpegOggTransformer.js +35 -0
- package/lib/voice/streams/FFmpegPCMTransformer.js +26 -0
- package/lib/voice/streams/OggOpusTransformer.js +108 -0
- package/lib/voice/streams/PCMOpusTransformer.js +61 -0
- package/lib/voice/streams/VolumeTransformer.js +50 -0
- package/lib/voice/streams/WebmOpusTransformer.js +258 -0
- package/package.json +82 -6
package/index.d.ts
ADDED
|
@@ -0,0 +1,4397 @@
|
|
|
1
|
+
import { EventEmitter } from "events";
|
|
2
|
+
import { Duplex, Readable as ReadableStream, Stream } from "stream";
|
|
3
|
+
import { Agent as HTTPSAgent } from "https";
|
|
4
|
+
import { IncomingMessage, ClientRequest, IncomingHttpHeaders } from "http";
|
|
5
|
+
import OpusScript = require("opusscript"); // Thanks TypeScript
|
|
6
|
+
import { URL } from "url";
|
|
7
|
+
import { Socket as DgramSocket } from "dgram";
|
|
8
|
+
import * as WebSocket from "ws";
|
|
9
|
+
import type Constants from "./lib/Constants.d.ts";
|
|
10
|
+
|
|
11
|
+
declare function Eris(token: string, options?: Eris.ClientOptions): Eris.Client;
|
|
12
|
+
|
|
13
|
+
declare namespace Eris {
|
|
14
|
+
export const Constants: Constants;
|
|
15
|
+
export const VERSION: string;
|
|
16
|
+
|
|
17
|
+
/** @deprecated */
|
|
18
|
+
export const PrivateChannel: typeof DMChannel;
|
|
19
|
+
|
|
20
|
+
// TYPES
|
|
21
|
+
|
|
22
|
+
// Application Commands
|
|
23
|
+
type ApplicationCommandOptions = ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsSubCommandGroup | ApplicationCommandOptionsWithValue;
|
|
24
|
+
type ApplicationCommandOptionsBoolean = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["BOOLEAN"]>;
|
|
25
|
+
type ApplicationCommandOptionsChannel = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["CHANNEL"]>;
|
|
26
|
+
type ApplicationCommandOptionsInteger = ApplicationCommandOptionsIntegerWithAutocomplete | ApplicationCommandOptionsIntegerWithoutAutocomplete | ApplicationCommandOptionsIntegerWithMinMax;
|
|
27
|
+
type ApplicationCommandOptionsIntegerWithAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["INTEGER"]>, "choices" | "min_value" | "max_value"> & AutocompleteEnabled;
|
|
28
|
+
type ApplicationCommandOptionsIntegerWithoutAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["INTEGER"]>, "autocomplete" | "min_value" | "max_value"> & AutocompleteDisabledInteger;
|
|
29
|
+
type ApplicationCommandOptionsIntegerWithMinMax = Omit<ApplicationCommandOptionWithMinMax<Constants["ApplicationCommandOptionTypes"]["INTEGER"]>, "choices" | "autocomplete"> & AutocompleteDisabledIntegerMinMax;
|
|
30
|
+
type ApplicationCommandOptionsMentionable = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["MENTIONABLE"]>;
|
|
31
|
+
type ApplicationCommandOptionsNumber = ApplicationCommandOptionsNumberWithAutocomplete | ApplicationCommandOptionsNumberWithoutAutocomplete | ApplicationCommandOptionsNumberWithMinMax;
|
|
32
|
+
type ApplicationCommandOptionsNumberWithAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["NUMBER"]>, "choices" | "min_value" | "max_value"> & AutocompleteEnabled;
|
|
33
|
+
type ApplicationCommandOptionsNumberWithoutAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["NUMBER"]>, "autocomplete" | "min_value" | "max_value"> & AutocompleteDisabledInteger;
|
|
34
|
+
type ApplicationCommandOptionsNumberWithMinMax = Omit<ApplicationCommandOptionWithMinMax<Constants["ApplicationCommandOptionTypes"]["NUMBER"]>, "choices" | "autocomplete"> & AutocompleteDisabledIntegerMinMax;
|
|
35
|
+
type ApplicationCommandOptionsRole = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["ROLE"]>;
|
|
36
|
+
type ApplicationCommandOptionsString = ApplicationCommandOptionsStringWithAutocomplete | ApplicationCommandOptionsStringWithoutAutocomplete;
|
|
37
|
+
type ApplicationCommandOptionsStringWithAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["STRING"]>, "choices"> & AutocompleteEnabled;
|
|
38
|
+
type ApplicationCommandOptionsStringWithoutAutocomplete = Omit<ApplicationCommandOptionWithChoices<Constants["ApplicationCommandOptionTypes"]["STRING"]>, "autocomplete"> & AutocompleteDisabled;
|
|
39
|
+
type ApplicationCommandOptionsUser = ApplicationCommandOption<Constants["ApplicationCommandOptionTypes"]["USER"]>;
|
|
40
|
+
type ApplicationCommandOptionsWithValue = ApplicationCommandOptionsString | ApplicationCommandOptionsInteger | ApplicationCommandOptionsBoolean | ApplicationCommandOptionsUser | ApplicationCommandOptionsChannel | ApplicationCommandOptionsRole | ApplicationCommandOptionsMentionable | ApplicationCommandOptionsNumber;
|
|
41
|
+
type ApplicationCommandPermissionTypes = Constants["ApplicationCommandPermissionTypes"][keyof Constants["ApplicationCommandPermissionTypes"]];
|
|
42
|
+
type ApplicationCommandTypes = Constants["ApplicationCommandTypes"][keyof Constants["ApplicationCommandTypes"]];
|
|
43
|
+
type ApplicationIntegrationTypes = Constants["ApplicationIntegrationTypes"][keyof Constants["ApplicationIntegrationTypes"]];
|
|
44
|
+
type EntryPointCommandHandlerTypes = Constants["EntryPointCommandHandlerTypes"][keyof Constants["EntryPointCommandHandlerTypes"]];
|
|
45
|
+
type ModalSubmitInteractionDataComponent = ModalSubmitInteractionDataTextInputComponent;
|
|
46
|
+
type ModalSubmitInteractionDataLabelChildComponent = ModalSubmitInteractionDataTextInputComponent | ModalSubmitInteractionDataSelectMenuComponent | ModalSubmitInteractionDataFileUploadComponent | ModalSubmitInteractionDataRadioGroupComponent | ModalSubmitInteractionDataCheckboxGroupComponent | ModalSubmitInteractionDataCheckboxComponent;
|
|
47
|
+
|
|
48
|
+
// Auto Moderation
|
|
49
|
+
type AutoModerationActionType = Constants["AutoModerationActionTypes"][keyof Constants["AutoModerationActionTypes"]];
|
|
50
|
+
type AutoModerationEventType = Constants["AutoModerationEventTypes"][keyof Constants["AutoModerationEventTypes"]];
|
|
51
|
+
type AutoModerationKeywordPresetType = Constants["AutoModerationKeywordPresetTypes"][keyof Constants["AutoModerationKeywordPresetTypes"]];
|
|
52
|
+
type AutoModerationTriggerType = Constants["AutoModerationTriggerTypes"][keyof Constants["AutoModerationTriggerTypes"]];
|
|
53
|
+
|
|
54
|
+
// Cache
|
|
55
|
+
interface Uncached { id: string }
|
|
56
|
+
|
|
57
|
+
// Channel
|
|
58
|
+
type AnyChannel = AnyGuildChannel | AnyThreadChannel | DMChannel | GroupChannel;
|
|
59
|
+
type AnyGuildChannel = AnyGuildTextableChannel | AnyThreadChannel | CategoryChannel | ForumChannel | MediaChannel;
|
|
60
|
+
type AnyGuildTextableChannel = TextChannel | VoiceChannel | NewsChannel | StageChannel;
|
|
61
|
+
type AnyThreadChannel = NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel | ThreadChannel;
|
|
62
|
+
type AnyVoiceChannel = VoiceChannel | StageChannel;
|
|
63
|
+
type ChannelTypeConversion<T extends GuildChannelTypes> =
|
|
64
|
+
T extends Constants["ChannelTypes"]["GUILD_TEXT"] ? TextChannel :
|
|
65
|
+
T extends Constants["ChannelTypes"]["GUILD_VOICE"] ? VoiceChannel :
|
|
66
|
+
T extends Constants["ChannelTypes"]["GUILD_CATEGORY"] ? CategoryChannel :
|
|
67
|
+
T extends Constants["ChannelTypes"]["GUILD_NEWS"] ? NewsChannel :
|
|
68
|
+
T extends Constants["ChannelTypes"]["GUILD_STAGE_VOICE"] ? StageChannel :
|
|
69
|
+
T extends Constants["ChannelTypes"]["GUILD_FORUM"] ? ForumChannel :
|
|
70
|
+
T extends Constants["ChannelTypes"]["GUILD_MEDIA"] ? MediaChannel :
|
|
71
|
+
never;
|
|
72
|
+
type EditGuildChannelOptions = EditForumChannelOptions | EditMediaChannelOptions | EditGuildTextableChannelOptions;
|
|
73
|
+
type EditGuildTextableChannelOptions = EditNewsChannelOptions | EditTextChannelOptions | EditThreadChannelOptions | EditVoiceChannelOptions;
|
|
74
|
+
type GuildTextableWithThreads = AnyGuildTextableChannel | GuildTextableChannel | AnyThreadChannel;
|
|
75
|
+
type InviteChannel = InvitePartialChannel | Exclude<AnyGuildChannel, CategoryChannel | AnyThreadChannel>;
|
|
76
|
+
type PossiblyUncachedSpeakableChannel = AnyVoiceChannel | Uncached;
|
|
77
|
+
type PossiblyUncachedTextableChannel = TextableChannel | Uncached;
|
|
78
|
+
type TextableChannel = GuildTextableWithThreads | DMChannel;
|
|
79
|
+
type VideoQualityMode = Constants["VideoQualityModes"][keyof Constants["VideoQualityModes"]];
|
|
80
|
+
|
|
81
|
+
// Channel Types
|
|
82
|
+
type ChannelTypes = GuildChannelTypes | PrivateChannelTypes;
|
|
83
|
+
type GuildChannelTypes = Exclude<Constants["ChannelTypes"][keyof Constants["ChannelTypes"]], PrivateChannelTypes>;
|
|
84
|
+
type GuildTextChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "GUILD_TEXT" | "GUILD_NEWS">];
|
|
85
|
+
type GuildVoiceChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "GUILD_VOICE" | "GUILD_STAGE_VOICE">];
|
|
86
|
+
type GuildThreadChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "GUILD_NEWS_THREAD" | "GUILD_PRIVATE_THREAD" | "GUILD_PUBLIC_THREAD">];
|
|
87
|
+
type GuildPublicThreadChannelTypes = Exclude<GuildThreadChannelTypes, Constants["ChannelTypes"]["GUILD_PRIVATE_THREAD"]>;
|
|
88
|
+
type PrivateChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "DM" | "GROUP_DM">];
|
|
89
|
+
type TextChannelTypes = GuildTextChannelTypes | PrivateChannelTypes;
|
|
90
|
+
type TextVoiceChannelTypes = Constants["ChannelTypes"][keyof Pick<Constants["ChannelTypes"], "GUILD_VOICE">];
|
|
91
|
+
|
|
92
|
+
// Client
|
|
93
|
+
type ApplicationEventWebhookStatus = Constants["ApplicationEventWebhookStatus"][keyof Constants["ApplicationEventWebhookStatus"]];
|
|
94
|
+
type ApplicationIdentityProfileDynamicField = ApplicationIdentityProfileDynamicMediaField | ApplicationIdentityProfileDynamicNumberField | ApplicationIdentityProfileDynamicStringField;
|
|
95
|
+
type ApplicationRoleConnectionMetadataTypes = Constants["RoleConnectionMetadataTypes"][keyof Constants["RoleConnectionMetadataTypes"]];
|
|
96
|
+
type MembershipStates = Constants["MembershipState"][keyof Constants["MembershipState"]];
|
|
97
|
+
type OAuthTeamMemberRoleTypes = Constants["OAuthTeamMemberRoleTypes"][keyof Constants["OAuthTeamMemberRoleTypes"]];
|
|
98
|
+
|
|
99
|
+
// Command
|
|
100
|
+
type CommandGenerator = CommandGeneratorFunction | MessageContent | MessageContent[] | CommandGeneratorFunction[];
|
|
101
|
+
type CommandGeneratorFunction = (msg: Message, args: string[]) => GeneratorFunctionReturn;
|
|
102
|
+
type GeneratorFunctionReturn = Promise<MessageContent> | Promise<void> | MessageContent | void;
|
|
103
|
+
type GenericCheckFunction<T> = (msg: Message) => T | Promise<T>;
|
|
104
|
+
type ReactionButtonsFilterFunction = (msg: Message, emoji: Emoji, userID: string) => boolean;
|
|
105
|
+
type ReactionButtonsGenerator = ReactionButtonsGeneratorFunction | MessageContent | MessageContent[] | ReactionButtonsGeneratorFunction[];
|
|
106
|
+
type ReactionButtonsGeneratorFunction = (msg: Message, args: string[], userID: string) => GeneratorFunctionReturn;
|
|
107
|
+
|
|
108
|
+
// Gateway/REST
|
|
109
|
+
type IntentStrings = keyof Constants["Intents"];
|
|
110
|
+
type ReconnectDelayFunction = (lastDelay: number, attempts: number) => number;
|
|
111
|
+
type RequestMethod = "GET" | "PATCH" | "DELETE" | "POST" | "PUT";
|
|
112
|
+
|
|
113
|
+
// Guild
|
|
114
|
+
type DefaultNotifications = Constants["DefaultMessageNotificationLevels"][keyof Constants["DefaultMessageNotificationLevels"]];
|
|
115
|
+
type ExplicitContentFilter = Constants["ExplicitContentFilterLevels"][keyof Constants["ExplicitContentFilterLevels"]];
|
|
116
|
+
type GuildFeatures = Constants["GuildFeatures"][number];
|
|
117
|
+
type GuildIntegrationExpireBehavior = Constants["GuildIntegrationExpireBehavior"][keyof Constants["GuildIntegrationExpireBehavior"]];
|
|
118
|
+
type GuildIntegrationTypes = Constants["GuildIntegrationTypes"][number];
|
|
119
|
+
type GuildScheduledEventEditOptions<T extends GuildScheduledEventEntityTypes> = GuildScheduledEventEditOptionsExternal | GuildScheduledEventEditOptionsDiscord | GuildScheduledEventEditOptionsBase<T>;
|
|
120
|
+
type GuildScheduledEventEntityTypes = Constants["GuildScheduledEventEntityTypes"][keyof Constants["GuildScheduledEventEntityTypes"]];
|
|
121
|
+
type GuildScheduledEventOptions<T extends GuildScheduledEventEntityTypes> = GuildScheduledEventOptionsExternal | GuildScheduledEventOptionsDiscord | GuildScheduledEventOptionsBase<T>;
|
|
122
|
+
type GuildScheduledEventPrivacyLevel = Constants["GuildScheduledEventPrivacyLevel"][keyof Constants["GuildScheduledEventPrivacyLevel"]];
|
|
123
|
+
type GuildScheduledEventRecurrenceRuleFrequencyTypes = Constants["GuildScheduledEventRecurrenceRuleFrequency"][keyof Constants["GuildScheduledEventRecurrenceRuleFrequency"]];
|
|
124
|
+
type GuildScheduledEventRecurrenceRuleMonthTypes = Constants["GuildScheduledEventRecurrenceRuleMonth"][keyof Constants["GuildScheduledEventRecurrenceRuleMonth"]];
|
|
125
|
+
type GuildScheduledEventRecurrenceRuleWeekdayTypes = Constants["GuildScheduledEventRecurrenceRuleWeekday"][keyof Constants["GuildScheduledEventRecurrenceRuleWeekday"]];
|
|
126
|
+
type GuildScheduledEventStatus = Constants["GuildScheduledEventStatus"][keyof Constants["GuildScheduledEventStatus"]];
|
|
127
|
+
type GuildWidgetStyles = Constants["GuildWidgetStyles"][keyof Constants["GuildWidgetStyles"]];
|
|
128
|
+
type MFALevel = Constants["MFALevels"][keyof Constants["MFALevels"]];
|
|
129
|
+
type NSFWLevel = Constants["GuildNSFWLevels"][keyof Constants["GuildNSFWLevels"]];
|
|
130
|
+
type OnboardingModes = Constants["GuildOnboardingModes"][keyof Constants["GuildOnboardingModes"]];
|
|
131
|
+
type OnboardingPromptTypes = Constants["GuildOnboardingPromptTypes"][keyof Constants["GuildOnboardingPromptTypes"]];
|
|
132
|
+
type PermissionValueTypes = bigint | number | string;
|
|
133
|
+
type PossiblyUncachedGuild = Guild | Uncached;
|
|
134
|
+
type PossiblyUncachedGuildScheduledEvent = GuildScheduledEvent | Uncached;
|
|
135
|
+
type PossiblyUncachedGuildSoundboardSound = SoundboardSound | { id: string; guild: PossiblyUncachedGuild };
|
|
136
|
+
type PremiumTier = Constants["PremiumTiers"][keyof Constants["PremiumTiers"]];
|
|
137
|
+
type SearchMessagesAuthorTypes = "user" | "bot" | "webhook";
|
|
138
|
+
type SearchMessagesHasTypes = "image" | "sound" | "video" | "file" | "sticker" | "embed" | "link" | "poll" | "snapshot";
|
|
139
|
+
type SystemChannelFlags = Constants["SystemChannelFlags"][keyof Constants["SystemChannelFlags"]];
|
|
140
|
+
type VerificationLevel = Constants["VerificationLevels"][keyof Constants["VerificationLevels"]];
|
|
141
|
+
|
|
142
|
+
// Interaction
|
|
143
|
+
type AnyInteraction = PingInteraction | CommandInteraction | ComponentInteraction | AutocompleteInteraction | ModalSubmitInteraction;
|
|
144
|
+
type InteractionCallbackData = InteractionAutocomplete | InteractionContent | InteractionModal;
|
|
145
|
+
type InteractionContent = Pick<WebhookPayload, "content" | "embeds" | "allowedMentions" | "tts" | "flags" | "components" | "poll">;
|
|
146
|
+
type InteractionContentEdit = Pick<WebhookPayload, "content" | "embeds" | "allowedMentions" | "components" | "poll">;
|
|
147
|
+
type InteractionContextTypes = Constants["InteractionContextTypes"][keyof Constants["InteractionContextTypes"]];
|
|
148
|
+
type InteractionDataOptions = InteractionDataOptionsSubCommand | InteractionDataOptionsSubCommandGroup | InteractionDataOptionsWithValue;
|
|
149
|
+
type InteractionDataOptionsBoolean = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["BOOLEAN"], boolean>;
|
|
150
|
+
type InteractionDataOptionsChannel = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["CHANNEL"], string>;
|
|
151
|
+
type InteractionDataOptionsInteger = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["INTEGER"], number>;
|
|
152
|
+
type InteractionDataOptionsMentionable = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["MENTIONABLE"], string>;
|
|
153
|
+
type InteractionDataOptionsNumber = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["NUMBER"], number>;
|
|
154
|
+
type InteractionDataOptionsRole = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["ROLE"], string>;
|
|
155
|
+
type InteractionDataOptionsString = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["STRING"], string>;
|
|
156
|
+
type InteractionDataOptionsUser = InteractionDataOptionWithValue<Constants["ApplicationCommandOptionTypes"]["USER"], string>;
|
|
157
|
+
type InteractionDataOptionsWithValue = InteractionDataOptionsString | InteractionDataOptionsInteger | InteractionDataOptionsBoolean | InteractionDataOptionsUser | InteractionDataOptionsChannel | InteractionDataOptionsRole | InteractionDataOptionsMentionable | InteractionDataOptionsNumber;
|
|
158
|
+
type InteractionResponseTypes = Constants["InteractionResponseTypes"][keyof Constants["InteractionResponseTypes"]];
|
|
159
|
+
type InteractionTypes = Constants["InteractionTypes"][keyof Constants["InteractionTypes"]];
|
|
160
|
+
type LocaleStrings = Constants["Locales"][keyof Constants["Locales"]];
|
|
161
|
+
|
|
162
|
+
// Invite
|
|
163
|
+
type InviteTargetTypes = Constants["InviteTargetTypes"][keyof Constants["InviteTargetTypes"]];
|
|
164
|
+
type InviteTargetUsersJobStatus = Constants["InviteTargetUsersJobStatus"][keyof Constants["InviteTargetUsersJobStatus"]];
|
|
165
|
+
type InviteTypes = Constants["InviteTypes"][keyof Constants["InviteTypes"]];
|
|
166
|
+
|
|
167
|
+
// Message
|
|
168
|
+
type ActionRowComponents = Button | SelectMenu;
|
|
169
|
+
type BaseThemeTypes = Constants["BaseThemeTypes"][keyof Constants["BaseThemeTypes"]];
|
|
170
|
+
type Button = InteractionButton | PremiumButton | URLButton;
|
|
171
|
+
type ButtonStyles = Constants["ButtonStyles"][keyof Constants["ButtonStyles"]];
|
|
172
|
+
type Component = ActionRow | ActionRowComponents | ComponentsV2;
|
|
173
|
+
type ComponentsV2 = Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container;
|
|
174
|
+
type ImageFormat = Constants["ImageFormats"][number];
|
|
175
|
+
type LabelChildComponent = TextInput | SelectMenu | FileUpload | RadioGroup | CheckboxGroup | Checkbox;
|
|
176
|
+
type MessageActivityTypes = Constants["MessageActivityTypes"][keyof Constants["MessageActivityTypes"]];
|
|
177
|
+
type MessageContent = string | AdvancedMessageContent;
|
|
178
|
+
type MessageContentEdit = string | AdvancedMessageContentEdit;
|
|
179
|
+
type MessageReferenceTypes = Constants["MessageReferenceTypes"][keyof Constants["MessageReferenceTypes"]];
|
|
180
|
+
type ModalComponent = ModalContentActionRow | Label | TextDisplay;
|
|
181
|
+
type PollLayoutTypes = Constants["PollLayoutTypes"][keyof Constants["PollLayoutTypes"]];
|
|
182
|
+
type PossiblyUncachedMessage = Message | { channel: TextableChannel | { id: string; guild?: Uncached }; guildID?: string; id: string };
|
|
183
|
+
type ReactionTypes = Constants["ReactionTypes"][keyof Constants["ReactionTypes"]];
|
|
184
|
+
type SelectMenu = StringSelectMenu | ChannelSelectMenu | ResolvedSelectMenus;
|
|
185
|
+
type SelectMenuNonResolvedTypes = Constants["ComponentTypes"][keyof Pick<Constants["ComponentTypes"], "STRING_SELECT">];
|
|
186
|
+
type SelectMenuResolvedTypes = Constants["ComponentTypes"][keyof Pick<Constants["ComponentTypes"], "USER_SELECT" | "ROLE_SELECT" | "MENTIONABLE_SELECT" | "CHANNEL_SELECT">];
|
|
187
|
+
type SelectMenuTypes = SelectMenuNonResolvedTypes | SelectMenuResolvedTypes;
|
|
188
|
+
|
|
189
|
+
// Monetization
|
|
190
|
+
type EntitlementOwnerTypes = Constants["EntitlementOwnerTypes"][keyof Constants["EntitlementOwnerTypes"]];
|
|
191
|
+
type EntitlementTypes = Constants["EntitlementTypes"][keyof Constants["EntitlementTypes"]];
|
|
192
|
+
type SKUTypes = Constants["SKUTypes"][keyof Constants["SKUTypes"]];
|
|
193
|
+
type SubscriptionStatuses = Constants["SubscriptionStatuses"][keyof Constants["SubscriptionStatuses"]];
|
|
194
|
+
|
|
195
|
+
// Permission
|
|
196
|
+
type PermissionType = Constants["PermissionOverwriteTypes"][keyof Constants["PermissionOverwriteTypes"]];
|
|
197
|
+
|
|
198
|
+
// Presence
|
|
199
|
+
type ActivityFlags = Constants["ActivityFlags"][keyof Constants["ActivityFlags"]];
|
|
200
|
+
type ActivityType = Constants["ActivityTypes"][keyof Constants["ActivityTypes"]];
|
|
201
|
+
type SelfStatus = Status | "invisible";
|
|
202
|
+
type Status = "online" | "idle" | "dnd";
|
|
203
|
+
type UserStatus = Status | "offline";
|
|
204
|
+
|
|
205
|
+
// Sticker
|
|
206
|
+
type StickerFormats = Constants["StickerFormats"][keyof Constants["StickerFormats"]];
|
|
207
|
+
type StickerTypes = Constants["StickerTypes"][keyof Constants["StickerTypes"]];
|
|
208
|
+
|
|
209
|
+
// Thread/Forum
|
|
210
|
+
type AutoArchiveDuration = 60 | 1440 | 4320 | 10080;
|
|
211
|
+
type ChannelFlags = Constants["ChannelFlags"][keyof Constants["ChannelFlags"]];
|
|
212
|
+
type ForumLayoutTypes = Constants["ForumLayoutTypes"][keyof Constants["ForumLayoutTypes"]];
|
|
213
|
+
type SortOrderTypes = Constants["SortOrderTypes"][keyof Constants["SortOrderTypes"]];
|
|
214
|
+
|
|
215
|
+
// User
|
|
216
|
+
type PossiblyUncachedUser = User | Uncached;
|
|
217
|
+
type PremiumTypes = Constants["PremiumTypes"][keyof Constants["PremiumTypes"]];
|
|
218
|
+
|
|
219
|
+
// Voice
|
|
220
|
+
type ConverterCommand = "./ffmpeg" | "./avconv" | "ffmpeg" | "avconv";
|
|
221
|
+
type StageInstancePrivacyLevel = Constants["StageInstancePrivacyLevel"][keyof Constants["StageInstancePrivacyLevel"]];
|
|
222
|
+
type VoiceChannelEffectAnimationType = Constants["VoiceChannelEffectAnimationTypes"][keyof Constants["VoiceChannelEffectAnimationTypes"]];
|
|
223
|
+
|
|
224
|
+
// Webhook
|
|
225
|
+
type WebhookPayloadEdit = Pick<WebhookPayload, "attachments" | "content" | "embed" | "embeds" | "file" | "allowedMentions" | "components">;
|
|
226
|
+
type WebhookTypes = Constants["WebhookTypes"][keyof Constants["WebhookTypes"]];
|
|
227
|
+
|
|
228
|
+
// INTERFACES
|
|
229
|
+
// Internals
|
|
230
|
+
type JSONCache = Record<string, unknown>;
|
|
231
|
+
interface NestedJSON {
|
|
232
|
+
toJSON(arg?: unknown, cache?: (string | unknown)[]): JSONCache;
|
|
233
|
+
}
|
|
234
|
+
interface SimpleJSON {
|
|
235
|
+
toJSON(props?: string[]): JSONCache;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Application Commands
|
|
239
|
+
/** Generic T is `true` if editing Guild scoped commands, and `false` if not */
|
|
240
|
+
interface ApplicationCommandEditOptions<T extends boolean, U = ApplicationCommandTypes> {
|
|
241
|
+
contexts?: InteractionContextTypes[] | null;
|
|
242
|
+
defaultMemberPermissions?: bigint | number | string | Permission | null;
|
|
243
|
+
/** @deprecated */
|
|
244
|
+
defaultPermission?: boolean;
|
|
245
|
+
description?: U extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? string : "" | void;
|
|
246
|
+
descriptionLocalizations?: U extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? Partial<Record<LocaleStrings, string>> | null : null;
|
|
247
|
+
/** @deprecated */
|
|
248
|
+
dmPermission?: T extends true ? never : boolean | null;
|
|
249
|
+
handler?: U extends Constants["ApplicationCommandTypes"]["PRIMARY_ENTRY_POINT"] ? EntryPointCommandHandlerTypes : never;
|
|
250
|
+
integrationTypes?: T extends true ? never : ApplicationIntegrationTypes[];
|
|
251
|
+
name?: string;
|
|
252
|
+
nameLocalizations?: Partial<Record<LocaleStrings, string>> | null;
|
|
253
|
+
nsfw?: boolean;
|
|
254
|
+
options?: ApplicationCommandOptions[];
|
|
255
|
+
}
|
|
256
|
+
/** Generic T is `true` if creating Guild scoped commands, and `false` if not */
|
|
257
|
+
interface ApplicationCommandCreateOptions<T extends boolean, U = ApplicationCommandTypes> extends ApplicationCommandEditOptions<T, U> {
|
|
258
|
+
description: U extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? string : "" | void;
|
|
259
|
+
name: string;
|
|
260
|
+
type?: U;
|
|
261
|
+
}
|
|
262
|
+
/** Generic T is `true` if editing Guild scoped commands, and `false` if not */
|
|
263
|
+
interface ApplicationCommandBulkEditOptions<T extends boolean, U = ApplicationCommandTypes> extends ApplicationCommandCreateOptions<T, U> {
|
|
264
|
+
id?: string;
|
|
265
|
+
}
|
|
266
|
+
interface ApplicationCommandOption<T extends Constants["ApplicationCommandOptionTypes"][Exclude<keyof Constants["ApplicationCommandOptionTypes"], "SUB_COMMAND" | "SUB_COMMAND_GROUP">]> {
|
|
267
|
+
channel_types?: T extends Constants["ApplicationCommandOptionTypes"]["CHANNEL"] ? ChannelTypes[] : never;
|
|
268
|
+
channelTypes?: T extends Constants["ApplicationCommandOptionTypes"]["CHANNEL"] ? ChannelTypes[] : never;
|
|
269
|
+
description: string;
|
|
270
|
+
descriptionLocalizations?: Record<LocaleStrings, string> | null;
|
|
271
|
+
name: string;
|
|
272
|
+
nameLocalizations?: Record<LocaleStrings, string> | null;
|
|
273
|
+
required?: boolean;
|
|
274
|
+
type: T;
|
|
275
|
+
}
|
|
276
|
+
interface ApplicationCommandOptionChoice<T extends Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "STRING" | "INTEGER" | "NUMBER">] | unknown = unknown> {
|
|
277
|
+
name: string;
|
|
278
|
+
value: T extends Constants["ApplicationCommandOptionTypes"]["STRING"]
|
|
279
|
+
? string
|
|
280
|
+
: T extends Constants["ApplicationCommandOptionTypes"]["NUMBER"]
|
|
281
|
+
? number
|
|
282
|
+
: T extends Constants["ApplicationCommandOptionTypes"]["INTEGER"]
|
|
283
|
+
? number
|
|
284
|
+
: number | string;
|
|
285
|
+
}
|
|
286
|
+
interface ApplicationCommandOptionsSubCommand {
|
|
287
|
+
description: string;
|
|
288
|
+
descriptionLocalizations?: Record<LocaleStrings, string> | null;
|
|
289
|
+
name: string;
|
|
290
|
+
nameLocalizations?: Record<LocaleStrings, string> | null;
|
|
291
|
+
options?: ApplicationCommandOptionsWithValue[];
|
|
292
|
+
type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND"];
|
|
293
|
+
}
|
|
294
|
+
interface ApplicationCommandOptionsSubCommandGroup {
|
|
295
|
+
description: string;
|
|
296
|
+
descriptionLocalizations?: Record<LocaleStrings, string> | null;
|
|
297
|
+
name: string;
|
|
298
|
+
nameLocalizations?: Record<LocaleStrings, string> | null;
|
|
299
|
+
options?: (ApplicationCommandOptionsSubCommand | ApplicationCommandOptionsWithValue)[];
|
|
300
|
+
type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND_GROUP"];
|
|
301
|
+
}
|
|
302
|
+
interface ApplicationCommandOptionWithChoices<T extends Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "STRING" | "INTEGER" | "NUMBER">] = Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "STRING" | "INTEGER" | "NUMBER">]> {
|
|
303
|
+
autocomplete?: boolean;
|
|
304
|
+
choices?: ApplicationCommandOptionChoice<T>[];
|
|
305
|
+
description: string;
|
|
306
|
+
descriptionLocalizations?: Partial<Record<LocaleStrings, string>> | null;
|
|
307
|
+
max_length?: T extends Constants["ApplicationCommandOptionTypes"]["STRING"] ? number : never;
|
|
308
|
+
maxLength?: T extends Constants["ApplicationCommandOptionTypes"]["STRING"] ? number : never;
|
|
309
|
+
min_length?: T extends Constants["ApplicationCommandOptionTypes"]["STRING"] ? number : never;
|
|
310
|
+
minLength?: T extends Constants["ApplicationCommandOptionTypes"]["STRING"] ? number : never;
|
|
311
|
+
name: string;
|
|
312
|
+
nameLocalizations?: Record<LocaleStrings, string> | null;
|
|
313
|
+
required?: boolean;
|
|
314
|
+
type: T;
|
|
315
|
+
}
|
|
316
|
+
interface ApplicationCommandOptionWithMinMax<T extends Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "INTEGER" | "NUMBER">] = Constants["ApplicationCommandOptionTypes"][keyof Pick<Constants["ApplicationCommandOptionTypes"], "INTEGER" | "NUMBER">]> {
|
|
317
|
+
autocomplete?: boolean;
|
|
318
|
+
choices?: ApplicationCommandOptionChoice<T>[];
|
|
319
|
+
description: string;
|
|
320
|
+
descriptionLocalizations?: Record<LocaleStrings, string> | null;
|
|
321
|
+
max_value?: number;
|
|
322
|
+
maxValue?: number;
|
|
323
|
+
min_value?: number;
|
|
324
|
+
minValue?: number;
|
|
325
|
+
name: string;
|
|
326
|
+
nameLocalizations?: Record<LocaleStrings, string> | null;
|
|
327
|
+
required?: boolean;
|
|
328
|
+
type: T;
|
|
329
|
+
}
|
|
330
|
+
interface ApplicationCommandPermissions {
|
|
331
|
+
id: string;
|
|
332
|
+
permission: boolean;
|
|
333
|
+
type: ApplicationCommandPermissionTypes;
|
|
334
|
+
}
|
|
335
|
+
interface AutocompleteEnabled {
|
|
336
|
+
autocomplete: true;
|
|
337
|
+
}
|
|
338
|
+
interface AutocompleteDisabled {
|
|
339
|
+
autocomplete?: false;
|
|
340
|
+
}
|
|
341
|
+
interface AutocompleteDisabledInteger extends AutocompleteDisabled {
|
|
342
|
+
max_value?: null;
|
|
343
|
+
maxValue?: null;
|
|
344
|
+
min_value?: null;
|
|
345
|
+
minValue?: null;
|
|
346
|
+
}
|
|
347
|
+
interface AutocompleteDisabledIntegerMinMax extends AutocompleteDisabled {
|
|
348
|
+
choices?: null;
|
|
349
|
+
}
|
|
350
|
+
interface GuildApplicationCommandPermissions {
|
|
351
|
+
application_id: string;
|
|
352
|
+
guild_id: string;
|
|
353
|
+
id: string;
|
|
354
|
+
permissions: ApplicationCommandPermissions[];
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// Auto Moderation
|
|
358
|
+
interface AutoModerationAction<T = AutoModerationActionType> {
|
|
359
|
+
metadata: T extends Constants["AutoModerationActionTypes"]["BLOCK_MEMBER_INTERACTION"] ? never : AutoModerationActionMetadata<T>;
|
|
360
|
+
type: T;
|
|
361
|
+
}
|
|
362
|
+
interface AutoModerationActionExecution {
|
|
363
|
+
action: AutoModerationAction;
|
|
364
|
+
alertSystemMessageID?: string;
|
|
365
|
+
channelID?: string;
|
|
366
|
+
content?: string;
|
|
367
|
+
guildID: string;
|
|
368
|
+
matchedContent?: string | null;
|
|
369
|
+
matchedKeyword: string | null;
|
|
370
|
+
messageID?: string;
|
|
371
|
+
ruleID: string;
|
|
372
|
+
ruleTriggerType: AutoModerationTriggerType;
|
|
373
|
+
userID: string;
|
|
374
|
+
}
|
|
375
|
+
interface AutoModerationActionMetadata<T = AutoModerationActionType> {
|
|
376
|
+
channelID: T extends Constants["AutoModerationActionTypes"]["SEND_ALERT_MESSAGE"] ? string : never;
|
|
377
|
+
customMessage: T extends Constants["AutoModerationActionTypes"]["BLOCK_MESSAGE"] ? string : never;
|
|
378
|
+
durationSeconds: T extends Constants["AutoModerationActionTypes"]["TIMEOUT"] ? number : never;
|
|
379
|
+
}
|
|
380
|
+
interface AutoModerationCreateOptions<T = AutoModerationTriggerType> {
|
|
381
|
+
actions: AutoModerationAction[];
|
|
382
|
+
eventType: AutoModerationEventType;
|
|
383
|
+
name: string;
|
|
384
|
+
triggerMetadata: T extends Constants["AutoModerationTriggerTypes"]["SPAM"] ? never : AutoModerationTriggerMetadata<T>;
|
|
385
|
+
triggerType: T;
|
|
386
|
+
}
|
|
387
|
+
interface AutoModerationEditOptions<T extends AutoModerationTriggerType> {
|
|
388
|
+
actions?: AutoModerationAction[];
|
|
389
|
+
enabled?: boolean;
|
|
390
|
+
eventType?: AutoModerationEventType;
|
|
391
|
+
exemptChannels?: string[];
|
|
392
|
+
exemptRoles?: string[];
|
|
393
|
+
name?: string;
|
|
394
|
+
reason?: string;
|
|
395
|
+
triggerMetadata: T extends Constants["AutoModerationTriggerTypes"]["SPAM"] ? never : AutoModerationTriggerMetadata<T> | undefined;
|
|
396
|
+
}
|
|
397
|
+
interface AutoModerationTriggerMetadata<T = AutoModerationTriggerType> {
|
|
398
|
+
allowList: T extends Constants["AutoModerationTriggerTypes"]["KEYWORD" | "KEYWORD_PRESET" | "MEMBER_PROFILE"] ? string[] : never;
|
|
399
|
+
keywordFilter: T extends Constants["AutoModerationTriggerTypes"]["KEYWORD" | "MEMBER_PROFILE"] ? string[] : never;
|
|
400
|
+
mentionRaidProtectionEnabled: T extends Constants["AutoModerationTriggerTypes"]["MENTION_SPAM"] ? boolean : never;
|
|
401
|
+
mentionTotalLimit: T extends Constants["AutoModerationTriggerTypes"]["MENTION_SPAM"] ? number : never;
|
|
402
|
+
presets: T extends Constants["AutoModerationTriggerTypes"]["KEYWORD_PRESET"] ? AutoModerationKeywordPresetType[] : never;
|
|
403
|
+
regexPatterns: T extends Constants["AutoModerationTriggerTypes"]["KEYWORD" | "MEMBER_PROFILE"] ? string[] : never;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Channel
|
|
407
|
+
interface ChannelFollow {
|
|
408
|
+
channel_id: string;
|
|
409
|
+
webhook_id: string;
|
|
410
|
+
}
|
|
411
|
+
interface ChannelPosition extends EditChannelPositionOptions {
|
|
412
|
+
id: string;
|
|
413
|
+
position?: number;
|
|
414
|
+
}
|
|
415
|
+
interface CreateChannelOptions {
|
|
416
|
+
availableTags?: ForumTag[];
|
|
417
|
+
bitrate?: number;
|
|
418
|
+
defaultAutoArchiveDuration?: AutoArchiveDuration;
|
|
419
|
+
defaultForumLayout?: ForumLayoutTypes;
|
|
420
|
+
defaultReactionEmoji?: DefaultReactionEmoji;
|
|
421
|
+
defaultSortOrder?: SortOrderTypes;
|
|
422
|
+
defaultThreadRateLimitPerUser?: number;
|
|
423
|
+
nsfw?: boolean;
|
|
424
|
+
parentID?: string;
|
|
425
|
+
permissionOverwrites?: Overwrite[];
|
|
426
|
+
position?: number;
|
|
427
|
+
rateLimitPerUser?: number;
|
|
428
|
+
reason?: string;
|
|
429
|
+
topic?: string;
|
|
430
|
+
userLimit?: number;
|
|
431
|
+
}
|
|
432
|
+
interface EditChannelOptionsBase {
|
|
433
|
+
name?: string;
|
|
434
|
+
position?: number;
|
|
435
|
+
permissionOverwrites?: Overwrite[];
|
|
436
|
+
}
|
|
437
|
+
interface EditNewsChannelOptions extends EditChannelOptionsBase {
|
|
438
|
+
defaultAutoArchiveDuration?: AutoArchiveDuration | null;
|
|
439
|
+
nsfw?: boolean | null;
|
|
440
|
+
parentID?: string | null;
|
|
441
|
+
topic?: string | null;
|
|
442
|
+
type?: GuildTextChannelTypes;
|
|
443
|
+
}
|
|
444
|
+
interface EditTextChannelOptions extends EditNewsChannelOptions {
|
|
445
|
+
defaultThreadRateLimitPerUser?: number | null;
|
|
446
|
+
rateLimitPerUser?: number | null;
|
|
447
|
+
}
|
|
448
|
+
interface EditVoiceChannelOptions extends EditChannelOptionsBase {
|
|
449
|
+
bitrate?: number | null;
|
|
450
|
+
nsfw?: boolean | null;
|
|
451
|
+
parentID?: string | null;
|
|
452
|
+
rateLimitPerUser?: number | null;
|
|
453
|
+
rtcRegion?: string | null;
|
|
454
|
+
userLimit?: number | null;
|
|
455
|
+
videoQualityMode?: VideoQualityMode | null;
|
|
456
|
+
}
|
|
457
|
+
interface EditMediaChannelOptions extends EditChannelOptionsBase {
|
|
458
|
+
availableTags?: ForumTag[];
|
|
459
|
+
defaultAutoArchiveDuration?: AutoArchiveDuration | null;
|
|
460
|
+
defaultReactionEmoji?: DefaultReactionEmoji | null;
|
|
461
|
+
defaultSortOrder?: SortOrderTypes | null;
|
|
462
|
+
defaultThreadRateLimitPerUser?: number;
|
|
463
|
+
flags?: ChannelFlags;
|
|
464
|
+
nsfw?: boolean | null;
|
|
465
|
+
parentID?: string | null;
|
|
466
|
+
rateLimitPerUser?: number | null;
|
|
467
|
+
topic?: string | null;
|
|
468
|
+
}
|
|
469
|
+
interface EditForumChannelOptions extends EditMediaChannelOptions {
|
|
470
|
+
defaultForumLayout?: ForumLayoutTypes | null;
|
|
471
|
+
}
|
|
472
|
+
interface EditThreadChannelOptions {
|
|
473
|
+
appliedTags?: string[];
|
|
474
|
+
archived?: boolean;
|
|
475
|
+
autoArchiveDuration?: AutoArchiveDuration;
|
|
476
|
+
flags?: ChannelFlags;
|
|
477
|
+
invitable?: boolean;
|
|
478
|
+
locked?: boolean;
|
|
479
|
+
name?: string;
|
|
480
|
+
rateLimitPerUser?: number | null;
|
|
481
|
+
}
|
|
482
|
+
interface EditChannelPositionOptions {
|
|
483
|
+
lockPermissions?: boolean;
|
|
484
|
+
parentID?: string;
|
|
485
|
+
}
|
|
486
|
+
interface EditGroupChannelOptions {
|
|
487
|
+
icon?: string | null;
|
|
488
|
+
name?: string;
|
|
489
|
+
}
|
|
490
|
+
interface GetMessagesOptions {
|
|
491
|
+
after?: string;
|
|
492
|
+
around?: string;
|
|
493
|
+
before?: string;
|
|
494
|
+
limit?: number;
|
|
495
|
+
}
|
|
496
|
+
interface GetPinsOptions {
|
|
497
|
+
before?: Date;
|
|
498
|
+
limit?: number;
|
|
499
|
+
}
|
|
500
|
+
interface GroupRecipientOptions {
|
|
501
|
+
accessToken: string;
|
|
502
|
+
nick?: string;
|
|
503
|
+
}
|
|
504
|
+
interface PartialChannel {
|
|
505
|
+
bitrate?: number;
|
|
506
|
+
id: string;
|
|
507
|
+
name?: string;
|
|
508
|
+
nsfw?: boolean;
|
|
509
|
+
parent_id?: number;
|
|
510
|
+
permission_overwrites?: Overwrite[];
|
|
511
|
+
rate_limit_per_user?: number;
|
|
512
|
+
topic?: string | null;
|
|
513
|
+
type: number;
|
|
514
|
+
user_limit?: number;
|
|
515
|
+
}
|
|
516
|
+
interface Permissionable {
|
|
517
|
+
permissionOverwrites: Collection<PermissionOverwrite>;
|
|
518
|
+
position: number;
|
|
519
|
+
deletePermission(overwriteID: string, reason?: string): Promise<void>;
|
|
520
|
+
editPermission(overwriteID: string, allow: PermissionValueTypes, deny: PermissionValueTypes, type: PermissionType, reason?: string): Promise<PermissionOverwrite>;
|
|
521
|
+
}
|
|
522
|
+
interface Pinnable {
|
|
523
|
+
lastPinTimestamp: number | null;
|
|
524
|
+
/** @deprecated */
|
|
525
|
+
getPins(): Promise<Message[]>;
|
|
526
|
+
getPins(options?: GetPinsOptions): Promise<GetPinsResponse>;
|
|
527
|
+
pinMessage(messageID: string): Promise<void>;
|
|
528
|
+
unpinMessage(messageID: string): Promise<void>;
|
|
529
|
+
}
|
|
530
|
+
interface GetPinsResponse {
|
|
531
|
+
hasMore: boolean;
|
|
532
|
+
items: GetPinsResponseItem;
|
|
533
|
+
}
|
|
534
|
+
interface GetPinsResponseItem {
|
|
535
|
+
pinnedAt: number;
|
|
536
|
+
message: Message;
|
|
537
|
+
}
|
|
538
|
+
interface PurgeChannelOptions {
|
|
539
|
+
after?: string;
|
|
540
|
+
before?: string;
|
|
541
|
+
filter?: (m: Message<AnyGuildTextableChannel>) => boolean;
|
|
542
|
+
limit: number;
|
|
543
|
+
reason?: string;
|
|
544
|
+
}
|
|
545
|
+
interface WebhookData {
|
|
546
|
+
channelID: string;
|
|
547
|
+
guildID: string;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
// Client
|
|
551
|
+
interface ApplicationActivityInstance {
|
|
552
|
+
applicationID: string;
|
|
553
|
+
instanceID: string;
|
|
554
|
+
launchID: string;
|
|
555
|
+
location: ApplicationActivityInstanceLocation;
|
|
556
|
+
users: string[];
|
|
557
|
+
}
|
|
558
|
+
interface ApplicationActivityInstanceLocation {
|
|
559
|
+
channelID: string;
|
|
560
|
+
guildID?: string | null;
|
|
561
|
+
id: string;
|
|
562
|
+
kind: "gc" | "pc";
|
|
563
|
+
}
|
|
564
|
+
interface ApplicationIdentity {
|
|
565
|
+
providerID: string | null;
|
|
566
|
+
providerIssuedUserID: string;
|
|
567
|
+
providerType: string;
|
|
568
|
+
userID: string;
|
|
569
|
+
}
|
|
570
|
+
interface ApplicationIdentityProfile {
|
|
571
|
+
data: ApplicationIdentityProfileData | null;
|
|
572
|
+
metadata: Record<string, unknown> | null;
|
|
573
|
+
username: string | null;
|
|
574
|
+
}
|
|
575
|
+
interface ApplicationIdentityProfileData {
|
|
576
|
+
dynamic?: ApplicationIdentityProfileDynamicField[];
|
|
577
|
+
primary?: ApplicationIdentityProfilePrimaryData;
|
|
578
|
+
}
|
|
579
|
+
interface ApplicationIdentityProfileDynamicMediaField {
|
|
580
|
+
name: string;
|
|
581
|
+
type: Constants["ProfileDynamicFieldTypes"]["MEDIA"];
|
|
582
|
+
value: ApplicationIdentityProfileMedia;
|
|
583
|
+
}
|
|
584
|
+
interface ApplicationIdentityProfileDynamicNumberField {
|
|
585
|
+
name: string;
|
|
586
|
+
type: Constants["ProfileDynamicFieldTypes"]["NUMBER"];
|
|
587
|
+
value: number;
|
|
588
|
+
}
|
|
589
|
+
interface ApplicationIdentityProfileDynamicStringField {
|
|
590
|
+
name: string;
|
|
591
|
+
type: Constants["ProfileDynamicFieldTypes"]["STRING"];
|
|
592
|
+
value: string;
|
|
593
|
+
}
|
|
594
|
+
interface ApplicationIdentityProfileMedia {
|
|
595
|
+
url: string;
|
|
596
|
+
}
|
|
597
|
+
interface ApplicationIdentityProfilePrimaryData {
|
|
598
|
+
current_period_assists?: number;
|
|
599
|
+
current_period_deaths?: number;
|
|
600
|
+
current_period_games?: number;
|
|
601
|
+
current_period_kills?: number;
|
|
602
|
+
current_period_wins?: number;
|
|
603
|
+
featured_played_character?: string;
|
|
604
|
+
featured_played_character_image?: ApplicationIdentityProfileMedia;
|
|
605
|
+
highest_rank?: string;
|
|
606
|
+
highest_rank_image?: ApplicationIdentityProfileMedia;
|
|
607
|
+
playtime_hours?: number;
|
|
608
|
+
rank_image?: ApplicationIdentityProfileMedia;
|
|
609
|
+
rank_name?: string;
|
|
610
|
+
season?: string;
|
|
611
|
+
total_assists?: number;
|
|
612
|
+
total_deaths?: number;
|
|
613
|
+
total_games?: number;
|
|
614
|
+
total_kills?: number;
|
|
615
|
+
total_wins?: number;
|
|
616
|
+
}
|
|
617
|
+
interface ApplicationInstallParams {
|
|
618
|
+
permissions: string;
|
|
619
|
+
scopes: string[];
|
|
620
|
+
}
|
|
621
|
+
interface ApplicationIntegrationTypeConfiguration {
|
|
622
|
+
oauth2_install_params?: ApplicationInstallParams;
|
|
623
|
+
}
|
|
624
|
+
interface ApplicationRoleConnectionMetadata {
|
|
625
|
+
description: string;
|
|
626
|
+
description_localizations?: Record<LocaleStrings, string>;
|
|
627
|
+
key: string;
|
|
628
|
+
name: string;
|
|
629
|
+
name_localizations?: Record<LocaleStrings, string>;
|
|
630
|
+
type: ApplicationRoleConnectionMetadataTypes;
|
|
631
|
+
}
|
|
632
|
+
interface ClientOptions {
|
|
633
|
+
/** @deprecated */
|
|
634
|
+
agent?: HTTPSAgent;
|
|
635
|
+
allowedMentions?: AllowedMentions;
|
|
636
|
+
autoreconnect?: boolean;
|
|
637
|
+
compress?: boolean;
|
|
638
|
+
connectionTimeout?: number;
|
|
639
|
+
defaultImageFormat?: string;
|
|
640
|
+
defaultImageSize?: number;
|
|
641
|
+
disableEvents?: Record<string, boolean>;
|
|
642
|
+
firstShardID?: number;
|
|
643
|
+
getAllUsers?: boolean;
|
|
644
|
+
guildCreateTimeout?: number;
|
|
645
|
+
intents: number | (IntentStrings | number)[];
|
|
646
|
+
largeThreshold?: number;
|
|
647
|
+
lastShardID?: number;
|
|
648
|
+
/** @deprecated */
|
|
649
|
+
latencyThreshold?: number;
|
|
650
|
+
maxReconnectAttempts?: number;
|
|
651
|
+
maxResumeAttempts?: number;
|
|
652
|
+
maxShards?: number | "auto";
|
|
653
|
+
messageLimit?: number;
|
|
654
|
+
opusOnly?: boolean;
|
|
655
|
+
/** @deprecated */
|
|
656
|
+
ratelimiterOffset?: number;
|
|
657
|
+
reconnectDelay?: ReconnectDelayFunction;
|
|
658
|
+
requestTimeout?: number;
|
|
659
|
+
rest?: RequestHandlerOptions;
|
|
660
|
+
restMode?: boolean;
|
|
661
|
+
seedVoiceConnections?: boolean;
|
|
662
|
+
shardConcurrency?: number | "auto";
|
|
663
|
+
ws?: unknown;
|
|
664
|
+
}
|
|
665
|
+
interface CommandClientOptions {
|
|
666
|
+
argsSplitter?: (str: string) => string[];
|
|
667
|
+
defaultCommandOptions?: CommandOptions;
|
|
668
|
+
defaultHelpCommand?: boolean;
|
|
669
|
+
description?: string;
|
|
670
|
+
ignoreBots?: boolean;
|
|
671
|
+
ignoreSelf?: boolean;
|
|
672
|
+
name?: string;
|
|
673
|
+
owner?: string;
|
|
674
|
+
prefix?: string | string[];
|
|
675
|
+
}
|
|
676
|
+
interface EditApplicationIdentityProfileOptions {
|
|
677
|
+
data?: ApplicationIdentityProfileData;
|
|
678
|
+
username?: string;
|
|
679
|
+
}
|
|
680
|
+
interface EditApplicationOptions {
|
|
681
|
+
coverImage?: string | null;
|
|
682
|
+
customInstallURL?: string;
|
|
683
|
+
description?: string;
|
|
684
|
+
eventWebhooksStatus?: ApplicationEventWebhookStatus;
|
|
685
|
+
eventWebhooksTypes?: string[];
|
|
686
|
+
eventWebhooksURL?: string;
|
|
687
|
+
flags?: number;
|
|
688
|
+
icon?: string | null;
|
|
689
|
+
installParams?: ApplicationInstallParams;
|
|
690
|
+
integrationTypesConfig?: Partial<Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>>;
|
|
691
|
+
interactionsEndpointURL?: string;
|
|
692
|
+
roleConnectionsVerificationURL?: string;
|
|
693
|
+
tags?: string[];
|
|
694
|
+
}
|
|
695
|
+
interface EditSelfOptions {
|
|
696
|
+
avatar?: string | null;
|
|
697
|
+
banner?: string | null;
|
|
698
|
+
username?: string;
|
|
699
|
+
}
|
|
700
|
+
interface RequestHandlerOptions {
|
|
701
|
+
agent?: HTTPSAgent;
|
|
702
|
+
baseURL?: string;
|
|
703
|
+
decodeReasons?: boolean;
|
|
704
|
+
disableLatencyCompensation?: boolean;
|
|
705
|
+
domain?: string;
|
|
706
|
+
latencyThreshold?: number;
|
|
707
|
+
ratelimiterOffset?: number;
|
|
708
|
+
requestTimeout?: number;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
// Command
|
|
712
|
+
interface CommandCooldownExclusions {
|
|
713
|
+
channelIDs?: string[];
|
|
714
|
+
guildIDs?: string[];
|
|
715
|
+
userIDs?: string[];
|
|
716
|
+
}
|
|
717
|
+
interface CommandOptions {
|
|
718
|
+
aliases?: string[];
|
|
719
|
+
argsRequired?: boolean;
|
|
720
|
+
caseInsensitive?: boolean;
|
|
721
|
+
cooldown?: number;
|
|
722
|
+
cooldownExclusions?: CommandCooldownExclusions;
|
|
723
|
+
cooldownMessage?: MessageContent | GenericCheckFunction<MessageContent> | false;
|
|
724
|
+
cooldownReturns?: number;
|
|
725
|
+
defaultSubcommandOptions?: CommandOptions;
|
|
726
|
+
deleteCommand?: boolean;
|
|
727
|
+
description?: string;
|
|
728
|
+
dmOnly?: boolean;
|
|
729
|
+
errorMessage?: MessageContent | GenericCheckFunction<MessageContent>;
|
|
730
|
+
fullDescription?: string;
|
|
731
|
+
guildOnly?: boolean;
|
|
732
|
+
hidden?: boolean;
|
|
733
|
+
hooks?: Hooks;
|
|
734
|
+
invalidUsageMessage?: MessageContent | GenericCheckFunction<MessageContent> | false;
|
|
735
|
+
permissionMessage?: MessageContent | GenericCheckFunction<MessageContent> | false;
|
|
736
|
+
reactionButtons?: CommandReactionButtonsOptions[] | null;
|
|
737
|
+
reactionButtonTimeout?: number;
|
|
738
|
+
requirements?: CommandRequirements;
|
|
739
|
+
restartCooldown?: boolean;
|
|
740
|
+
usage?: string;
|
|
741
|
+
}
|
|
742
|
+
interface CommandReactionButtons extends CommandReactionButtonsOptions {
|
|
743
|
+
execute: (msg: Message, args: string[], userID: string) => string | GeneratorFunctionReturn;
|
|
744
|
+
responses: ((() => string) | ReactionButtonsGeneratorFunction)[];
|
|
745
|
+
}
|
|
746
|
+
interface CommandReactionButtonsOptions {
|
|
747
|
+
emoji: string;
|
|
748
|
+
filter: ReactionButtonsFilterFunction;
|
|
749
|
+
response: string | ReactionButtonsGeneratorFunction;
|
|
750
|
+
type: "edit" | "cancel";
|
|
751
|
+
}
|
|
752
|
+
interface CommandRequirements {
|
|
753
|
+
custom?: GenericCheckFunction<boolean>;
|
|
754
|
+
permissions?: Record<string, boolean> | GenericCheckFunction<Record<string, boolean>>;
|
|
755
|
+
roleIDs?: string[] | GenericCheckFunction<string[]>;
|
|
756
|
+
roleNames?: string[] | GenericCheckFunction<string[]>;
|
|
757
|
+
userIDs?: string[] | GenericCheckFunction<string[]>;
|
|
758
|
+
}
|
|
759
|
+
interface Hooks {
|
|
760
|
+
postCheck?: (msg: Message, args: string[], checksPassed: boolean) => void;
|
|
761
|
+
postCommand?: (msg: Message, args: string[], sent?: Message) => void;
|
|
762
|
+
postExecution?: (msg: Message, args: string[], executionSuccess: boolean) => void;
|
|
763
|
+
preCommand?: (msg: Message, args: string[]) => void;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
// Embed
|
|
767
|
+
// Omit<T, K> used to override
|
|
768
|
+
interface Embed extends Omit<EmbedOptions, "footer" | "image" | "thumbnail" | "author"> {
|
|
769
|
+
author?: EmbedAuthor;
|
|
770
|
+
footer?: EmbedFooter;
|
|
771
|
+
image?: EmbedImage;
|
|
772
|
+
provider?: EmbedProvider;
|
|
773
|
+
thumbnail?: EmbedImage;
|
|
774
|
+
type: string;
|
|
775
|
+
video?: EmbedVideo;
|
|
776
|
+
}
|
|
777
|
+
interface EmbedAuthor extends EmbedAuthorOptions {
|
|
778
|
+
proxy_icon_url?: string;
|
|
779
|
+
}
|
|
780
|
+
interface EmbedAuthorOptions {
|
|
781
|
+
icon_url?: string;
|
|
782
|
+
name: string;
|
|
783
|
+
url?: string;
|
|
784
|
+
}
|
|
785
|
+
interface EmbedField {
|
|
786
|
+
inline?: boolean;
|
|
787
|
+
name: string;
|
|
788
|
+
value: string;
|
|
789
|
+
}
|
|
790
|
+
interface EmbedFooter extends EmbedFooterOptions {
|
|
791
|
+
proxy_icon_url?: string;
|
|
792
|
+
}
|
|
793
|
+
interface EmbedFooterOptions {
|
|
794
|
+
icon_url?: string;
|
|
795
|
+
text: string;
|
|
796
|
+
}
|
|
797
|
+
interface EmbedImage extends EmbedImageOptions {
|
|
798
|
+
height?: number;
|
|
799
|
+
proxy_url?: string;
|
|
800
|
+
width?: number;
|
|
801
|
+
}
|
|
802
|
+
interface EmbedImageOptions {
|
|
803
|
+
url?: string;
|
|
804
|
+
}
|
|
805
|
+
interface EmbedOptions {
|
|
806
|
+
author?: EmbedAuthorOptions;
|
|
807
|
+
color?: number;
|
|
808
|
+
description?: string;
|
|
809
|
+
fields?: EmbedField[];
|
|
810
|
+
footer?: EmbedFooterOptions;
|
|
811
|
+
image?: EmbedImageOptions;
|
|
812
|
+
thumbnail?: EmbedImageOptions;
|
|
813
|
+
timestamp?: Date | string;
|
|
814
|
+
title?: string;
|
|
815
|
+
url?: string;
|
|
816
|
+
}
|
|
817
|
+
interface EmbedProvider {
|
|
818
|
+
name?: string;
|
|
819
|
+
url?: string;
|
|
820
|
+
}
|
|
821
|
+
interface EmbedVideo {
|
|
822
|
+
height?: number;
|
|
823
|
+
proxy_url?: string;
|
|
824
|
+
url?: string;
|
|
825
|
+
width?: number;
|
|
826
|
+
}
|
|
827
|
+
interface PollEmbed {
|
|
828
|
+
fields: PollEmbedField[];
|
|
829
|
+
type: "poll_result";
|
|
830
|
+
}
|
|
831
|
+
interface PollEmbedField extends EmbedField {
|
|
832
|
+
/** Only `poll_question_text`, `victor_answer_votes` and `total_votes` are guaranteed. Other names are optional and may not be present. */
|
|
833
|
+
name: "poll_question_text" | "victor_answer_votes" | "total_votes" | "victor_answer_id" | "victor_answer_text" | "victor_answer_emoji_id" | "victor_answer_emoji_name" | "victor_answer_emoji_animated"; // REVIEW Is there a better way to do this?
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
// Emoji
|
|
837
|
+
interface Emoji extends EmojiBase {
|
|
838
|
+
animated: boolean;
|
|
839
|
+
available: boolean;
|
|
840
|
+
id: string;
|
|
841
|
+
managed: boolean;
|
|
842
|
+
require_colons: boolean;
|
|
843
|
+
roles: string[];
|
|
844
|
+
user?: PartialUser;
|
|
845
|
+
}
|
|
846
|
+
interface EmojiBase {
|
|
847
|
+
icon?: string;
|
|
848
|
+
name: string;
|
|
849
|
+
}
|
|
850
|
+
interface EmojiOptions extends Exclude<EmojiBase, "icon"> {
|
|
851
|
+
image: string;
|
|
852
|
+
roles?: string[];
|
|
853
|
+
}
|
|
854
|
+
interface EditApplicationEmojiOptions {
|
|
855
|
+
name: string;
|
|
856
|
+
}
|
|
857
|
+
interface ApplicationEmojiOptions extends EditApplicationEmojiOptions {
|
|
858
|
+
image: string;
|
|
859
|
+
}
|
|
860
|
+
interface ApplicationEmojis {
|
|
861
|
+
items: Emoji[];
|
|
862
|
+
}
|
|
863
|
+
interface PartialEmoji {
|
|
864
|
+
id: string | null;
|
|
865
|
+
name: string;
|
|
866
|
+
animated?: boolean;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// Events
|
|
870
|
+
interface OldAutoModerationRule {
|
|
871
|
+
actions: AutoModerationAction[];
|
|
872
|
+
enabled: boolean;
|
|
873
|
+
eventType: AutoModerationEventType;
|
|
874
|
+
exemptChannels: string[];
|
|
875
|
+
exemptRoles: string[];
|
|
876
|
+
name: string;
|
|
877
|
+
triggerMetadata: AutoModerationTriggerMetadata;
|
|
878
|
+
}
|
|
879
|
+
interface OldCall {
|
|
880
|
+
endedTimestamp?: number;
|
|
881
|
+
participants: string[];
|
|
882
|
+
region: string;
|
|
883
|
+
ringing: string[];
|
|
884
|
+
unavailable: boolean;
|
|
885
|
+
}
|
|
886
|
+
interface OldForumChannel extends OldGuildChannel {
|
|
887
|
+
availableTags: ForumTag[];
|
|
888
|
+
defaultAutoArchiveDuration: AutoArchiveDuration;
|
|
889
|
+
defaultForumLayout: ForumLayoutTypes;
|
|
890
|
+
defaultReactionEmoji: DefaultReactionEmoji;
|
|
891
|
+
defaultSortOrder: SortOrderTypes;
|
|
892
|
+
defaultThreadRateLimitPerUser: number;
|
|
893
|
+
}
|
|
894
|
+
interface OldGroupChannel {
|
|
895
|
+
icon: string;
|
|
896
|
+
name: string;
|
|
897
|
+
ownerID: string;
|
|
898
|
+
type: Constants["ChannelTypes"]["GROUP_DM"];
|
|
899
|
+
}
|
|
900
|
+
interface OldGuild {
|
|
901
|
+
afkChannelID: string | null;
|
|
902
|
+
afkTimeout: number;
|
|
903
|
+
autoRemoved: boolean | null;
|
|
904
|
+
banner: string | null;
|
|
905
|
+
defaultNotifications: DefaultNotifications;
|
|
906
|
+
description: string | null;
|
|
907
|
+
discoverySplash: string | null;
|
|
908
|
+
emojiCount: number | null;
|
|
909
|
+
emojis: Omit<Emoji, "user" | "icon">[];
|
|
910
|
+
explicitContentFilter: ExplicitContentFilter;
|
|
911
|
+
features: GuildFeatures[];
|
|
912
|
+
icon: string | null;
|
|
913
|
+
incidentsData?: GuildIncidentData | null;
|
|
914
|
+
keywords: string[] | null;
|
|
915
|
+
large: boolean;
|
|
916
|
+
maxMembers?: number;
|
|
917
|
+
maxVideoChannelUsers?: number;
|
|
918
|
+
mfaLevel: MFALevel;
|
|
919
|
+
name: string;
|
|
920
|
+
/** @deprecated */
|
|
921
|
+
nsfw: boolean;
|
|
922
|
+
nsfwLevel: NSFWLevel;
|
|
923
|
+
ownerID: string;
|
|
924
|
+
preferredLocale?: LocaleStrings;
|
|
925
|
+
premiumProgressBarEnabled: boolean;
|
|
926
|
+
premiumSubscriptionCount?: number;
|
|
927
|
+
premiumTier: PremiumTier;
|
|
928
|
+
primaryCategory?: DiscoveryCategory;
|
|
929
|
+
primaryCategoryID: number | null;
|
|
930
|
+
publicUpdatesChannelID: string | null;
|
|
931
|
+
rulesChannelID: string | null;
|
|
932
|
+
splash: string | null;
|
|
933
|
+
stickers?: Sticker[];
|
|
934
|
+
systemChannelFlags: number;
|
|
935
|
+
systemChannelID: string | null;
|
|
936
|
+
vanityURL: string | null;
|
|
937
|
+
verificationLevel: VerificationLevel;
|
|
938
|
+
welcomeScreen?: WelcomeScreen;
|
|
939
|
+
}
|
|
940
|
+
interface OldGuildChannel {
|
|
941
|
+
bitrate?: number;
|
|
942
|
+
flags?: number;
|
|
943
|
+
name: string;
|
|
944
|
+
nsfw?: boolean;
|
|
945
|
+
parentID: string | null;
|
|
946
|
+
permissionOverwrites: Collection<PermissionOverwrite>;
|
|
947
|
+
position: number;
|
|
948
|
+
rateLimitPerUser?: number;
|
|
949
|
+
rtcRegion?: string | null;
|
|
950
|
+
topic?: string | null;
|
|
951
|
+
type: GuildChannelTypes;
|
|
952
|
+
}
|
|
953
|
+
interface OldGuildScheduledEvent {
|
|
954
|
+
channel: PossiblyUncachedSpeakableChannel | null;
|
|
955
|
+
description?: string | null;
|
|
956
|
+
entityID: string | null;
|
|
957
|
+
entityMetadata: GuildScheduledEventMetadata | null;
|
|
958
|
+
entityType: GuildScheduledEventEntityTypes;
|
|
959
|
+
image?: string;
|
|
960
|
+
name: string;
|
|
961
|
+
privacyLevel: GuildScheduledEventPrivacyLevel;
|
|
962
|
+
scheduledEndTime: number | null;
|
|
963
|
+
scheduledStartTime: number;
|
|
964
|
+
status: GuildScheduledEventStatus;
|
|
965
|
+
}
|
|
966
|
+
interface OldGuildSoundboardSound {
|
|
967
|
+
available: boolean;
|
|
968
|
+
emojiID: string | null;
|
|
969
|
+
emojiName: string | null;
|
|
970
|
+
name: string;
|
|
971
|
+
volume: number;
|
|
972
|
+
}
|
|
973
|
+
interface OldGuildTextChannel extends OldGuildChannel {
|
|
974
|
+
nsfw: boolean;
|
|
975
|
+
rateLimitPerUser: number;
|
|
976
|
+
topic?: string | null;
|
|
977
|
+
type: GuildTextChannelTypes;
|
|
978
|
+
}
|
|
979
|
+
interface OldMember {
|
|
980
|
+
avatar: string | null;
|
|
981
|
+
avatarDecorationData?: AvatarDecorationData | null;
|
|
982
|
+
banner?: string | null;
|
|
983
|
+
collectibles?: UserCollectibles | null;
|
|
984
|
+
communicationDisabledUntil?: number | null;
|
|
985
|
+
flags?: number;
|
|
986
|
+
nick: string | null;
|
|
987
|
+
pending?: boolean;
|
|
988
|
+
premiumSince?: number | null;
|
|
989
|
+
roles: string[];
|
|
990
|
+
}
|
|
991
|
+
interface OldMessage {
|
|
992
|
+
attachments: Attachment[];
|
|
993
|
+
channelMentions: string[];
|
|
994
|
+
content: string;
|
|
995
|
+
editedTimestamp?: number;
|
|
996
|
+
embeds: Embed[];
|
|
997
|
+
flags: number;
|
|
998
|
+
mentionedBy?: unknown;
|
|
999
|
+
mentions: User[];
|
|
1000
|
+
pinned: boolean;
|
|
1001
|
+
poll?: Poll;
|
|
1002
|
+
roleMentions: string[];
|
|
1003
|
+
tts: boolean;
|
|
1004
|
+
}
|
|
1005
|
+
interface OldRole {
|
|
1006
|
+
color: number;
|
|
1007
|
+
colors: RoleColors;
|
|
1008
|
+
flags: number;
|
|
1009
|
+
hoist: boolean;
|
|
1010
|
+
icon: string | null;
|
|
1011
|
+
managed: boolean;
|
|
1012
|
+
mentionable: boolean;
|
|
1013
|
+
name: string;
|
|
1014
|
+
permissions: Permission;
|
|
1015
|
+
position: number;
|
|
1016
|
+
unicodeEmoji: string | null;
|
|
1017
|
+
}
|
|
1018
|
+
interface OldStageInstance {
|
|
1019
|
+
discoverableDisabled: boolean;
|
|
1020
|
+
privacyLevel: StageInstancePrivacyLevel;
|
|
1021
|
+
topic: string;
|
|
1022
|
+
}
|
|
1023
|
+
interface OldVoiceChannel extends OldGuildChannel {
|
|
1024
|
+
bitrate: number;
|
|
1025
|
+
rtcRegion: string | null;
|
|
1026
|
+
type: GuildVoiceChannelTypes;
|
|
1027
|
+
userLimit: number;
|
|
1028
|
+
videoQualityMode: VideoQualityMode;
|
|
1029
|
+
}
|
|
1030
|
+
interface OldVoiceChannelStartTime {
|
|
1031
|
+
voiceStartTime?: number | null;
|
|
1032
|
+
}
|
|
1033
|
+
interface OldThread {
|
|
1034
|
+
appliedTags: string[];
|
|
1035
|
+
autoArchiveDuration: number;
|
|
1036
|
+
name: string;
|
|
1037
|
+
rateLimitPerUser: number;
|
|
1038
|
+
threadMetadata: ThreadMetadata;
|
|
1039
|
+
}
|
|
1040
|
+
interface OldThreadMember {
|
|
1041
|
+
flags: number;
|
|
1042
|
+
}
|
|
1043
|
+
interface OldVoiceState {
|
|
1044
|
+
deaf: boolean;
|
|
1045
|
+
mute: boolean;
|
|
1046
|
+
selfDeaf: boolean;
|
|
1047
|
+
selfMute: boolean;
|
|
1048
|
+
selfStream: boolean;
|
|
1049
|
+
selfVideo: boolean;
|
|
1050
|
+
}
|
|
1051
|
+
interface EventListeners {
|
|
1052
|
+
applicationCommandPermissionsUpdate: [applicationCommandPermissions: GuildApplicationCommandPermissions];
|
|
1053
|
+
autoModerationActionExecution: [guild: Guild, action: AutoModerationActionExecution];
|
|
1054
|
+
autoModerationRuleCreate: [guild: Guild, rule: AutoModerationRule];
|
|
1055
|
+
autoModerationRuleDelete: [guild: Guild, rule: AutoModerationRule];
|
|
1056
|
+
autoModerationRuleUpdate: [guild: Guild, rule: AutoModerationRule, oldRule: OldAutoModerationRule | null];
|
|
1057
|
+
channelCreate: [channel: AnyGuildChannel];
|
|
1058
|
+
channelDelete: [channel: Exclude<AnyChannel, GroupChannel>];
|
|
1059
|
+
channelInfo: [guild: PossiblyUncachedGuild, channels: ChannelInfo[]];
|
|
1060
|
+
channelPinUpdate: [channel: TextableChannel, timestamp: number, oldTimestamp: number];
|
|
1061
|
+
channelUpdate: [channel: AnyGuildChannel, oldChannel: OldGuildChannel | OldForumChannel | OldGuildTextChannel | OldVoiceChannel]
|
|
1062
|
+
| [channel: GroupChannel, oldChannel: OldGroupChannel];
|
|
1063
|
+
connect: [id: number];
|
|
1064
|
+
debug: [message: string, id?: number];
|
|
1065
|
+
disconnect: [];
|
|
1066
|
+
entitlementCreate: [entitlement: Entitlement];
|
|
1067
|
+
entitlementDelete: [entitlement: Entitlement];
|
|
1068
|
+
entitlementUpdate: [entitlement: Entitlement];
|
|
1069
|
+
error: [err: Error, id?: number];
|
|
1070
|
+
guildAuditLogEntryCreate: [guildAuditLogEntry: GuildAuditLogEntry];
|
|
1071
|
+
guildAvailable: [guild: Guild];
|
|
1072
|
+
guildBanAdd: [guild: Guild, user: User];
|
|
1073
|
+
guildBanRemove: [guild: Guild, user: User];
|
|
1074
|
+
guildCreate: [guild: Guild];
|
|
1075
|
+
guildDelete: [guild: PossiblyUncachedGuild];
|
|
1076
|
+
guildEmojisUpdate: [guild: PossiblyUncachedGuild, emojis: Emoji[], oldEmojis: Emoji[] | null];
|
|
1077
|
+
guildIntegrationsUpdate: [guild: PossiblyUncachedGuild];
|
|
1078
|
+
guildMemberAdd: [guild: Guild, member: Member];
|
|
1079
|
+
guildMemberChunk: [guild: Guild, member: Member[]];
|
|
1080
|
+
guildMemberRemove: [guild: Guild, member: Member | MemberPartial];
|
|
1081
|
+
guildMemberUpdate: [guild: Guild, member: Member, oldMember: OldMember | null];
|
|
1082
|
+
guildRoleCreate: [guild: Guild, role: Role];
|
|
1083
|
+
guildRoleDelete: [guild: Guild, role: Role];
|
|
1084
|
+
guildRoleUpdate: [guild: Guild, role: Role, oldRole: OldRole];
|
|
1085
|
+
guildScheduledEventCreate: [event: GuildScheduledEvent];
|
|
1086
|
+
guildScheduledEventDelete: [event: GuildScheduledEvent];
|
|
1087
|
+
guildScheduledEventUpdate: [event: GuildScheduledEvent, oldEvent: OldGuildScheduledEvent | null];
|
|
1088
|
+
guildScheduledEventUserAdd: [event: PossiblyUncachedGuildScheduledEvent, user: PossiblyUncachedUser];
|
|
1089
|
+
guildScheduledEventUserRemove: [event: PossiblyUncachedGuildScheduledEvent, user: PossiblyUncachedUser];
|
|
1090
|
+
guildSoundboardSoundCreate: [sound: SoundboardSound];
|
|
1091
|
+
guildSoundboardSoundDelete: [sound: PossiblyUncachedGuildSoundboardSound];
|
|
1092
|
+
guildSoundboardSoundUpdate: [sound: SoundboardSound, oldSound: OldGuildSoundboardSound | null];
|
|
1093
|
+
guildSoundboardSoundsUpdate: [guild: PossiblyUncachedGuild, sounds: SoundboardSound[], oldSounds: (OldGuildSoundboardSound | null)[]];
|
|
1094
|
+
guildStickersUpdate: [guild: PossiblyUncachedGuild, stickers: Sticker[], oldStickers: Sticker[] | null];
|
|
1095
|
+
guildUnavailable: [guild: UnavailableGuild];
|
|
1096
|
+
guildUpdate: [guild: Guild, oldGuild: OldGuild];
|
|
1097
|
+
hello: [trace: string[], id: number];
|
|
1098
|
+
integrationCreate: [guild: PossiblyUncachedGuild, integration: GuildIntegration];
|
|
1099
|
+
integrationDelete: [guild: PossiblyUncachedGuild, integration: DeletedGuildIntegration];
|
|
1100
|
+
integrationUpdate: [guild: PossiblyUncachedGuild, integration: GuildIntegration];
|
|
1101
|
+
interactionCreate: [interaction: PingInteraction | CommandInteraction | ComponentInteraction | AutocompleteInteraction | ModalSubmitInteraction | UnknownInteraction];
|
|
1102
|
+
inviteCreate: [guild: Guild, invite: Invite];
|
|
1103
|
+
inviteDelete: [guild: Guild, invite: Invite];
|
|
1104
|
+
messageCreate: [message: Message<PossiblyUncachedTextableChannel>];
|
|
1105
|
+
messageDelete: [message: PossiblyUncachedMessage];
|
|
1106
|
+
messageDeleteBulk: [messages: PossiblyUncachedMessage[]];
|
|
1107
|
+
messagePollVoteAdd: [message: PossiblyUncachedMessage, user: PossiblyUncachedUser, answerID: number];
|
|
1108
|
+
messagePollVoteRemove: [message: PossiblyUncachedMessage, user: PossiblyUncachedUser, answerID: number];
|
|
1109
|
+
messageReactionAdd: [message: PossiblyUncachedMessage, emoji: PartialEmoji, reactor: Member | Uncached, burst: boolean];
|
|
1110
|
+
messageReactionRemove: [message: PossiblyUncachedMessage, emoji: PartialEmoji, userID: string, burst: boolean];
|
|
1111
|
+
messageReactionRemoveAll: [message: PossiblyUncachedMessage];
|
|
1112
|
+
messageReactionRemoveEmoji: [message: PossiblyUncachedMessage, emoji: PartialEmoji];
|
|
1113
|
+
messageUpdate: [message: Message<PossiblyUncachedTextableChannel>, oldMessage: OldMessage | null];
|
|
1114
|
+
presenceUpdate: [other: Member, oldPresence: Presence | null];
|
|
1115
|
+
rateLimited: [rateLimit: GatewayRateLimit, id: number];
|
|
1116
|
+
rawREST: [request: RawRESTRequest];
|
|
1117
|
+
rawWS: [packet: RawPacket, id: number];
|
|
1118
|
+
ready: [];
|
|
1119
|
+
shardPreReady: [id: number];
|
|
1120
|
+
soundboardSounds: [guild: PossiblyUncachedGuild, sounds: SoundboardSound[]];
|
|
1121
|
+
stageInstanceCreate: [stageInstance: StageInstance];
|
|
1122
|
+
stageInstanceDelete: [stageInstance: StageInstance];
|
|
1123
|
+
stageInstanceUpdate: [stageInstance: StageInstance, oldStageInstance: OldStageInstance | null];
|
|
1124
|
+
subscriptionCreate: [subscription: Subscription];
|
|
1125
|
+
subscriptionDelete: [subscription: Subscription];
|
|
1126
|
+
subscriptionUpdate: [subscription: Subscription];
|
|
1127
|
+
threadCreate: [channel: AnyThreadChannel];
|
|
1128
|
+
threadDelete: [channel: AnyThreadChannel];
|
|
1129
|
+
threadListSync: [guild: Guild, deletedThreads: (AnyThreadChannel | Uncached)[], activeThreads: AnyThreadChannel[], joinedThreadsMember: ThreadMember[]];
|
|
1130
|
+
threadMembersUpdate: [channel: AnyThreadChannel, addedMembers: ThreadMember[], removedMembers: (ThreadMember | Uncached)[]];
|
|
1131
|
+
threadMemberUpdate: [channel: AnyThreadChannel, member: ThreadMember, oldMember: OldThreadMember];
|
|
1132
|
+
threadUpdate: [channel: AnyThreadChannel, oldChannel: OldThread | null];
|
|
1133
|
+
typingStart: [channel: AnyGuildTextableChannel | Uncached, user: PossiblyUncachedUser, member: Member]
|
|
1134
|
+
| [channel: DMChannel | Uncached, user: PossiblyUncachedUser, member: null];
|
|
1135
|
+
unavailableGuildCreate: [guild: UnavailableGuild];
|
|
1136
|
+
unknown: [packet: RawPacket, id?: number];
|
|
1137
|
+
userUpdate: [user: User, oldUser: PartialUser | null];
|
|
1138
|
+
voiceChannelEffectSend: [effect: VoiceChannelEffect];
|
|
1139
|
+
voiceChannelJoin: [member: Member, channel: AnyVoiceChannel];
|
|
1140
|
+
voiceChannelLeave: [member: Member, channel: AnyVoiceChannel];
|
|
1141
|
+
voiceChannelStartTimeUpdate: [channel: AnyVoiceChannel, oldChannel: OldVoiceChannelStartTime];
|
|
1142
|
+
voiceChannelStatusUpdate: [channel: AnyVoiceChannel, oldChannel: VoiceStatus];
|
|
1143
|
+
voiceChannelSwitch: [member: Member, newChannel: AnyVoiceChannel, oldChannel: AnyVoiceChannel];
|
|
1144
|
+
voiceStateUpdate: [member: Member, oldState: OldVoiceState];
|
|
1145
|
+
warn: [message: string, id?: number];
|
|
1146
|
+
webhooksUpdate: [data: WebhookData];
|
|
1147
|
+
}
|
|
1148
|
+
interface ClientEvents extends EventListeners {
|
|
1149
|
+
shardDisconnect: [err: Error | undefined, id: number];
|
|
1150
|
+
shardReady: [id: number];
|
|
1151
|
+
shardResume: [id: number];
|
|
1152
|
+
}
|
|
1153
|
+
interface ShardEvents extends EventListeners {
|
|
1154
|
+
resume: [];
|
|
1155
|
+
}
|
|
1156
|
+
interface StreamEvents {
|
|
1157
|
+
end: [];
|
|
1158
|
+
error: [err: Error];
|
|
1159
|
+
start: [];
|
|
1160
|
+
}
|
|
1161
|
+
interface VoiceEvents {
|
|
1162
|
+
connect: [];
|
|
1163
|
+
daveTransition: [transitionID: number, protocolVersion: number];
|
|
1164
|
+
debug: [message: string];
|
|
1165
|
+
disconnect: [err?: Error];
|
|
1166
|
+
end: [];
|
|
1167
|
+
error: [err: Error];
|
|
1168
|
+
pong: [latency: number];
|
|
1169
|
+
ready: [];
|
|
1170
|
+
resumed: [];
|
|
1171
|
+
speakingStart: [userID: string];
|
|
1172
|
+
speakingStop: [userID: string];
|
|
1173
|
+
start: [];
|
|
1174
|
+
unknown: [packet: RawPacket];
|
|
1175
|
+
usersConnect: [userIDs: string[]];
|
|
1176
|
+
userDisconnect: [userID: string];
|
|
1177
|
+
warn: [message: string];
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// Gateway/REST
|
|
1181
|
+
interface GatewayRateLimit {
|
|
1182
|
+
meta: { guildID?: string; nonce?: string };
|
|
1183
|
+
opcode: number;
|
|
1184
|
+
retryAfter: number;
|
|
1185
|
+
}
|
|
1186
|
+
interface HTTPResponse {
|
|
1187
|
+
code: number;
|
|
1188
|
+
message: string;
|
|
1189
|
+
}
|
|
1190
|
+
interface LatencyRef {
|
|
1191
|
+
lastTimeOffsetCheck: number;
|
|
1192
|
+
latency: number;
|
|
1193
|
+
raw: number[];
|
|
1194
|
+
timeOffset: number;
|
|
1195
|
+
timeOffsets: number[];
|
|
1196
|
+
}
|
|
1197
|
+
interface RawPacket {
|
|
1198
|
+
d?: unknown;
|
|
1199
|
+
op: number;
|
|
1200
|
+
s?: number;
|
|
1201
|
+
t?: string;
|
|
1202
|
+
}
|
|
1203
|
+
interface RawRESTRequest {
|
|
1204
|
+
auth: boolean;
|
|
1205
|
+
body?: unknown;
|
|
1206
|
+
file?: FileContent;
|
|
1207
|
+
latency: number;
|
|
1208
|
+
method: string;
|
|
1209
|
+
resp: IncomingMessage;
|
|
1210
|
+
route: string;
|
|
1211
|
+
short: boolean;
|
|
1212
|
+
url: string;
|
|
1213
|
+
}
|
|
1214
|
+
interface RequestChannelInfoPromise {
|
|
1215
|
+
res: (value: ChannelInfo[]) => void;
|
|
1216
|
+
timeout: NodeJS.Timeout;
|
|
1217
|
+
}
|
|
1218
|
+
interface RequestMembersPromise {
|
|
1219
|
+
members: Member[];
|
|
1220
|
+
received: number;
|
|
1221
|
+
res: (value: Member[]) => void;
|
|
1222
|
+
timeout: NodeJS.Timeout;
|
|
1223
|
+
}
|
|
1224
|
+
interface RequestSoundboardSoundsPromise {
|
|
1225
|
+
res: (value: Record<string, SoundboardSound[]>) => void;
|
|
1226
|
+
soundboardSounds: Record<string, SoundboardSound[]>;
|
|
1227
|
+
timeout: NodeJS.Timeout;
|
|
1228
|
+
}
|
|
1229
|
+
interface ShardManagerOptions {
|
|
1230
|
+
concurrency?: number | "auto";
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
// Guild
|
|
1234
|
+
interface AddGuildMemberOptions {
|
|
1235
|
+
deaf?: boolean;
|
|
1236
|
+
mute?: boolean;
|
|
1237
|
+
nick?: string;
|
|
1238
|
+
roles?: string[];
|
|
1239
|
+
}
|
|
1240
|
+
interface BanMemberOptions {
|
|
1241
|
+
/** @deprecated */
|
|
1242
|
+
deleteMessageDays?: number;
|
|
1243
|
+
deleteMessageSeconds?: number;
|
|
1244
|
+
reason?: string;
|
|
1245
|
+
}
|
|
1246
|
+
interface BulkBanMembersOptions extends Omit<BanMemberOptions, "deleteMessageDays"> {
|
|
1247
|
+
userIDs: string[];
|
|
1248
|
+
}
|
|
1249
|
+
interface BulkBanMembersResponse {
|
|
1250
|
+
banned_users: string[];
|
|
1251
|
+
failed_users: string[];
|
|
1252
|
+
}
|
|
1253
|
+
interface DiscoveryCategory {
|
|
1254
|
+
id: number;
|
|
1255
|
+
is_primary: boolean;
|
|
1256
|
+
name: {
|
|
1257
|
+
default: string;
|
|
1258
|
+
localizations?: Record<LocaleStrings, string>;
|
|
1259
|
+
};
|
|
1260
|
+
}
|
|
1261
|
+
interface DiscoveryMetadata {
|
|
1262
|
+
category_ids: number[];
|
|
1263
|
+
emoji_discoverability_enabled: boolean;
|
|
1264
|
+
guild_id: string;
|
|
1265
|
+
keywords: string[] | null;
|
|
1266
|
+
primary_category_id: number;
|
|
1267
|
+
}
|
|
1268
|
+
interface DiscoveryOptions {
|
|
1269
|
+
emojiDiscoverabilityEnabled?: boolean;
|
|
1270
|
+
keywords?: string[];
|
|
1271
|
+
primaryCategoryID?: string;
|
|
1272
|
+
reason?: string;
|
|
1273
|
+
}
|
|
1274
|
+
interface DiscoverySubcategoryResponse {
|
|
1275
|
+
category_id: number;
|
|
1276
|
+
guild_id: string;
|
|
1277
|
+
}
|
|
1278
|
+
interface ChannelInfo {
|
|
1279
|
+
id: string;
|
|
1280
|
+
status?: string | null;
|
|
1281
|
+
voiceStartTime?: number | null;
|
|
1282
|
+
}
|
|
1283
|
+
interface DeletedGuildIntegration {
|
|
1284
|
+
applicationID?: string;
|
|
1285
|
+
id: string;
|
|
1286
|
+
}
|
|
1287
|
+
interface EditGuildIncidentDataOptions {
|
|
1288
|
+
dmsDisabledUntil?: Date | null;
|
|
1289
|
+
invitesDisabledUntil?: Date | null;
|
|
1290
|
+
}
|
|
1291
|
+
interface GetGuildAuditLogOptions {
|
|
1292
|
+
actionType?: number;
|
|
1293
|
+
before?: string;
|
|
1294
|
+
limit?: number;
|
|
1295
|
+
userID?: string;
|
|
1296
|
+
}
|
|
1297
|
+
interface GetGuildBansOptions {
|
|
1298
|
+
after?: string;
|
|
1299
|
+
before?: string;
|
|
1300
|
+
limit?: number;
|
|
1301
|
+
}
|
|
1302
|
+
interface GetGuildScheduledEventOptions {
|
|
1303
|
+
withUserCount?: boolean;
|
|
1304
|
+
}
|
|
1305
|
+
interface GetGuildScheduledEventUsersOptions {
|
|
1306
|
+
after?: string;
|
|
1307
|
+
before?: string;
|
|
1308
|
+
limit?: number;
|
|
1309
|
+
withMember?: boolean;
|
|
1310
|
+
}
|
|
1311
|
+
interface GetPruneOptions {
|
|
1312
|
+
days?: number;
|
|
1313
|
+
includeRoles?: string[];
|
|
1314
|
+
}
|
|
1315
|
+
interface GetRESTGuildMembersOptions {
|
|
1316
|
+
after?: string;
|
|
1317
|
+
limit?: number;
|
|
1318
|
+
}
|
|
1319
|
+
interface GetRESTGuildsOptions {
|
|
1320
|
+
after?: string;
|
|
1321
|
+
before?: string;
|
|
1322
|
+
limit?: number;
|
|
1323
|
+
withCounts?: boolean;
|
|
1324
|
+
}
|
|
1325
|
+
interface GuildAuditLog {
|
|
1326
|
+
entries: GuildAuditLogEntry[];
|
|
1327
|
+
integrations: GuildIntegration[];
|
|
1328
|
+
threads: AnyThreadChannel[];
|
|
1329
|
+
users: User[];
|
|
1330
|
+
webhooks: Webhook[];
|
|
1331
|
+
}
|
|
1332
|
+
interface GuildBan {
|
|
1333
|
+
reason?: string;
|
|
1334
|
+
user: User;
|
|
1335
|
+
}
|
|
1336
|
+
interface GuildChannelInfoOptions {
|
|
1337
|
+
fields?: ("status" | "voice_start_time")[];
|
|
1338
|
+
timeout?: number;
|
|
1339
|
+
}
|
|
1340
|
+
interface GuildIncidentData {
|
|
1341
|
+
dmsDisabledUntil: number | null;
|
|
1342
|
+
dmSpamDetectedAt: number | null;
|
|
1343
|
+
invitesDisabledUntil: number | null;
|
|
1344
|
+
raidDetectedAt: number | null;
|
|
1345
|
+
}
|
|
1346
|
+
interface GuildOnboarding {
|
|
1347
|
+
default_channel_ids: string[];
|
|
1348
|
+
enabled: boolean;
|
|
1349
|
+
guild_id: string;
|
|
1350
|
+
mode: OnboardingModes;
|
|
1351
|
+
prompts: GuildOnboardingPrompt[];
|
|
1352
|
+
}
|
|
1353
|
+
interface GuildOnboardingOptions extends Omit<GuildOnboarding, "guild_id" | "prompt"> {
|
|
1354
|
+
prompts: GuildOnboardingPromptOptions[];
|
|
1355
|
+
}
|
|
1356
|
+
interface GuildOnboardingPrompt {
|
|
1357
|
+
id: string;
|
|
1358
|
+
in_onboarding: boolean;
|
|
1359
|
+
options: GuildOnboardingPromptOption[];
|
|
1360
|
+
required: boolean;
|
|
1361
|
+
single_select: boolean;
|
|
1362
|
+
title: string;
|
|
1363
|
+
type: OnboardingPromptTypes;
|
|
1364
|
+
}
|
|
1365
|
+
interface GuildOnboardingPromptOption {
|
|
1366
|
+
channel_ids: string[];
|
|
1367
|
+
description: string | null;
|
|
1368
|
+
emoji?: PartialEmoji;
|
|
1369
|
+
id: string;
|
|
1370
|
+
role_ids: string[];
|
|
1371
|
+
title: string;
|
|
1372
|
+
}
|
|
1373
|
+
interface GuildOnboardingPromptOptionOptions<T = boolean> extends Omit<GuildOnboardingPromptOption, "emoji"> {
|
|
1374
|
+
emoji_animated: T extends true ? boolean : never;
|
|
1375
|
+
emoji_id: T extends true ? string : never;
|
|
1376
|
+
emoji_name: T extends true ? string : never;
|
|
1377
|
+
}
|
|
1378
|
+
interface GuildOnboardingPromptOptions extends Omit<GuildOnboardingPrompt, "options"> {
|
|
1379
|
+
options: GuildOnboardingPromptOptionOptions[];
|
|
1380
|
+
}
|
|
1381
|
+
interface GuildOptions {
|
|
1382
|
+
afkChannelID?: string | null;
|
|
1383
|
+
afkTimeout?: number;
|
|
1384
|
+
banner?: string | null;
|
|
1385
|
+
defaultNotifications?: DefaultNotifications | null;
|
|
1386
|
+
description?: string | null;
|
|
1387
|
+
discoverySplash?: string | null;
|
|
1388
|
+
explicitContentFilter?: ExplicitContentFilter | null;
|
|
1389
|
+
features?: GuildFeatures[]; // Though only some are editable?
|
|
1390
|
+
icon?: string | null;
|
|
1391
|
+
name?: string;
|
|
1392
|
+
preferredLocale?: LocaleStrings | null;
|
|
1393
|
+
publicUpdatesChannelID?: string | null;
|
|
1394
|
+
rulesChannelID?: string | null;
|
|
1395
|
+
safetyAlertsChannelID?: string | null;
|
|
1396
|
+
splash?: string | null;
|
|
1397
|
+
systemChannelFlags?: number;
|
|
1398
|
+
systemChannelID?: string | null;
|
|
1399
|
+
verificationLevel?: VerificationLevel | null;
|
|
1400
|
+
}
|
|
1401
|
+
interface GuildScheduledEventEditOptionsBase<T extends GuildScheduledEventEntityTypes = GuildScheduledEventEntityTypes> {
|
|
1402
|
+
channelID?: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? null : string;
|
|
1403
|
+
description?: string | null;
|
|
1404
|
+
entityMetadata?: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? Required<GuildScheduledEventMetadata> : GuildScheduledEventMetadata | null;
|
|
1405
|
+
entityType?: T;
|
|
1406
|
+
image?: string;
|
|
1407
|
+
name?: string;
|
|
1408
|
+
privacyLevel?: GuildScheduledEventPrivacyLevel;
|
|
1409
|
+
recurrenceRule?: GuildScheduledEventRecurrenceRuleOptions;
|
|
1410
|
+
scheduledEndTime?: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? Date : Date | undefined;
|
|
1411
|
+
scheduledStartTime?: Date;
|
|
1412
|
+
status?: GuildScheduledEventStatus;
|
|
1413
|
+
}
|
|
1414
|
+
interface GuildScheduledEventEditOptionsDiscord extends GuildScheduledEventEditOptionsBase<Exclude<GuildScheduledEventEntityTypes, Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"]>> {
|
|
1415
|
+
channelID: string;
|
|
1416
|
+
entityMetadata: GuildScheduledEventMetadata;
|
|
1417
|
+
}
|
|
1418
|
+
interface GuildScheduledEventEditOptionsExternal extends GuildScheduledEventEditOptionsBase<Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"]> {
|
|
1419
|
+
channelID: null;
|
|
1420
|
+
entityMetadata: Required<GuildScheduledEventMetadata>;
|
|
1421
|
+
scheduledEndTime: Date;
|
|
1422
|
+
}
|
|
1423
|
+
interface GuildScheduledEventMetadata {
|
|
1424
|
+
location?: string;
|
|
1425
|
+
}
|
|
1426
|
+
interface GuildScheduledEventOptionsBase<T extends GuildScheduledEventEntityTypes> extends Omit<GuildScheduledEventEditOptionsBase<T>, "entityMetadata" | "status"> {
|
|
1427
|
+
channelID: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? never : string;
|
|
1428
|
+
entityMetadata?: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? Required<GuildScheduledEventMetadata> : GuildScheduledEventMetadata | undefined;
|
|
1429
|
+
entityType: T;
|
|
1430
|
+
name: string;
|
|
1431
|
+
privacyLevel: GuildScheduledEventPrivacyLevel;
|
|
1432
|
+
scheduledStartTime: Date;
|
|
1433
|
+
}
|
|
1434
|
+
interface GuildScheduledEventOptionsDiscord extends GuildScheduledEventEditOptionsBase<Exclude<GuildScheduledEventEntityTypes, Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"]>> {
|
|
1435
|
+
channelID: string;
|
|
1436
|
+
entityMetadata: GuildScheduledEventMetadata;
|
|
1437
|
+
}
|
|
1438
|
+
interface GuildScheduledEventOptionsExternal extends GuildScheduledEventOptionsBase<Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"]> {
|
|
1439
|
+
channelID: never;
|
|
1440
|
+
entityMetadata: Required<GuildScheduledEventMetadata>;
|
|
1441
|
+
scheduledEndTime: Date;
|
|
1442
|
+
}
|
|
1443
|
+
interface GuildScheduledEventRecurrenceRuleNWeekday {
|
|
1444
|
+
day: GuildScheduledEventRecurrenceRuleWeekdayTypes;
|
|
1445
|
+
n: 1 | 2 | 3 | 4 | 5;
|
|
1446
|
+
}
|
|
1447
|
+
interface GuildScheduledEventRecurrenceRule extends GuildScheduledEventRecurrenceRuleOptions {
|
|
1448
|
+
byYearDay: number[];
|
|
1449
|
+
count: number | null;
|
|
1450
|
+
end: number | null;
|
|
1451
|
+
}
|
|
1452
|
+
interface GuildScheduledEventRecurrenceRuleOptions { // TODO More precision? Depends on Discord
|
|
1453
|
+
byMonth: GuildScheduledEventRecurrenceRuleMonthTypes[] | null;
|
|
1454
|
+
byMonthDay: number[];
|
|
1455
|
+
byNWeekday: GuildScheduledEventRecurrenceRuleNWeekday[] | null;
|
|
1456
|
+
byWeekday: GuildScheduledEventRecurrenceRuleWeekdayTypes[] | null;
|
|
1457
|
+
frequency: GuildScheduledEventRecurrenceRuleFrequencyTypes;
|
|
1458
|
+
interval: number;
|
|
1459
|
+
start: number;
|
|
1460
|
+
}
|
|
1461
|
+
interface GuildScheduledEventUser {
|
|
1462
|
+
guildScheduledEventID: string;
|
|
1463
|
+
member?: Member;
|
|
1464
|
+
user: User;
|
|
1465
|
+
}
|
|
1466
|
+
interface GuildSoundboardSoundBase {
|
|
1467
|
+
emojiID?: string | null;
|
|
1468
|
+
emojiName?: string | null;
|
|
1469
|
+
name?: string;
|
|
1470
|
+
volume?: number | null;
|
|
1471
|
+
}
|
|
1472
|
+
interface GuildSoundboardSoundCreate extends GuildSoundboardSoundBase {
|
|
1473
|
+
name: string;
|
|
1474
|
+
sound: string;
|
|
1475
|
+
}
|
|
1476
|
+
interface GuildSoundboardSoundEdit extends GuildSoundboardSoundBase {
|
|
1477
|
+
reason?: string;
|
|
1478
|
+
}
|
|
1479
|
+
interface GuildSoundboardSoundSend {
|
|
1480
|
+
soundID: string;
|
|
1481
|
+
sourceGuildID?: string;
|
|
1482
|
+
}
|
|
1483
|
+
interface GuildTemplateOptions {
|
|
1484
|
+
description?: string | null;
|
|
1485
|
+
name?: string;
|
|
1486
|
+
}
|
|
1487
|
+
interface GuildVanity {
|
|
1488
|
+
code: string | null;
|
|
1489
|
+
uses: number;
|
|
1490
|
+
}
|
|
1491
|
+
interface IntegrationApplication {
|
|
1492
|
+
bot?: User;
|
|
1493
|
+
description: string;
|
|
1494
|
+
icon: string | null;
|
|
1495
|
+
id: string;
|
|
1496
|
+
name: string;
|
|
1497
|
+
}
|
|
1498
|
+
interface IntegrationOptions {
|
|
1499
|
+
enableEmoticons?: string;
|
|
1500
|
+
expireBehavior?: string;
|
|
1501
|
+
expireGracePeriod?: string;
|
|
1502
|
+
}
|
|
1503
|
+
interface PruneMemberOptions extends GetPruneOptions {
|
|
1504
|
+
computePruneCount?: boolean;
|
|
1505
|
+
reason?: string;
|
|
1506
|
+
}
|
|
1507
|
+
interface SearchGuildMessagesOptions {
|
|
1508
|
+
attachmentExtensions?: string[];
|
|
1509
|
+
attachmentFilenames?: string[];
|
|
1510
|
+
authorIDs?: string[];
|
|
1511
|
+
authorTypes?: (SearchMessagesAuthorTypes | `-${SearchMessagesAuthorTypes}`)[];
|
|
1512
|
+
channelIDs?: string[];
|
|
1513
|
+
content?: string;
|
|
1514
|
+
embedProviders?: string[];
|
|
1515
|
+
embedTypes?: ("image" | "video" | "gif" | "sound" | "article")[];
|
|
1516
|
+
has?: (SearchMessagesHasTypes | `-${SearchMessagesHasTypes}`)[];
|
|
1517
|
+
includeNSFW?: boolean;
|
|
1518
|
+
limit?: number;
|
|
1519
|
+
linkHostnames?: string[];
|
|
1520
|
+
maxID?: string;
|
|
1521
|
+
mentionEveryone?: boolean;
|
|
1522
|
+
mentions?: string[];
|
|
1523
|
+
mentionsRoleIDs?: string[];
|
|
1524
|
+
minID?: string;
|
|
1525
|
+
offset?: number;
|
|
1526
|
+
pinned?: boolean;
|
|
1527
|
+
repliedToMessageIDs?: string[];
|
|
1528
|
+
repliedToUserIDs?: string[];
|
|
1529
|
+
slop?: number;
|
|
1530
|
+
sortBy?: "timestamp" | "relevance";
|
|
1531
|
+
sortOrder?: "asc" | "desc";
|
|
1532
|
+
}
|
|
1533
|
+
interface SearchGuildMessagesResult {
|
|
1534
|
+
doingDeepHistoricalIndex: boolean;
|
|
1535
|
+
documentsIndexed?: number;
|
|
1536
|
+
indexed: boolean;
|
|
1537
|
+
members: ThreadMember[];
|
|
1538
|
+
messages: Message[];
|
|
1539
|
+
retryAfter?: number;
|
|
1540
|
+
threads: AnyThreadChannel[];
|
|
1541
|
+
totalResults: number;
|
|
1542
|
+
}
|
|
1543
|
+
interface VoiceRegion {
|
|
1544
|
+
custom: boolean;
|
|
1545
|
+
deprecated: boolean;
|
|
1546
|
+
id: string;
|
|
1547
|
+
name: string;
|
|
1548
|
+
optimal: boolean;
|
|
1549
|
+
vip: boolean;
|
|
1550
|
+
}
|
|
1551
|
+
interface WelcomeChannel {
|
|
1552
|
+
channelID: string;
|
|
1553
|
+
description: string;
|
|
1554
|
+
emojiID: string | null;
|
|
1555
|
+
emojiName: string | null;
|
|
1556
|
+
}
|
|
1557
|
+
interface WelcomeScreen {
|
|
1558
|
+
description: string;
|
|
1559
|
+
welcomeChannels: WelcomeChannel[];
|
|
1560
|
+
}
|
|
1561
|
+
interface WelcomeScreenOptions extends WelcomeScreen {
|
|
1562
|
+
enabled: boolean;
|
|
1563
|
+
}
|
|
1564
|
+
interface Widget extends Omit<WidgetOptions, "channelID" | "reason"> {
|
|
1565
|
+
channel_id: string | null;
|
|
1566
|
+
enabled: boolean;
|
|
1567
|
+
}
|
|
1568
|
+
interface WidgetChannel {
|
|
1569
|
+
id: string;
|
|
1570
|
+
name: string;
|
|
1571
|
+
position: number;
|
|
1572
|
+
}
|
|
1573
|
+
interface WidgetData {
|
|
1574
|
+
channels: WidgetChannel[];
|
|
1575
|
+
id: string;
|
|
1576
|
+
instant_invite: string;
|
|
1577
|
+
members: WidgetMember[];
|
|
1578
|
+
name: string;
|
|
1579
|
+
presence_count: number;
|
|
1580
|
+
}
|
|
1581
|
+
interface WidgetMember {
|
|
1582
|
+
avatar: string | null;
|
|
1583
|
+
avatar_url: string;
|
|
1584
|
+
discriminator: string;
|
|
1585
|
+
id: string;
|
|
1586
|
+
status: string;
|
|
1587
|
+
username: string;
|
|
1588
|
+
}
|
|
1589
|
+
interface WidgetOptions {
|
|
1590
|
+
channelID?: string | null;
|
|
1591
|
+
channel_id?: string | null;
|
|
1592
|
+
enabled?: boolean;
|
|
1593
|
+
reason?: string;
|
|
1594
|
+
}
|
|
1595
|
+
|
|
1596
|
+
// Interaction
|
|
1597
|
+
interface AuthorizingIntegrationOwners {
|
|
1598
|
+
guildInstall?: string;
|
|
1599
|
+
userInstall?: string;
|
|
1600
|
+
}
|
|
1601
|
+
interface AutocompleteInteractionData {
|
|
1602
|
+
id: string;
|
|
1603
|
+
name: string;
|
|
1604
|
+
type: Constants["ApplicationCommandTypes"]["CHAT_INPUT"];
|
|
1605
|
+
target_id?: string;
|
|
1606
|
+
options: InteractionDataOptions[];
|
|
1607
|
+
}
|
|
1608
|
+
interface CommandInteractionData {
|
|
1609
|
+
id: string;
|
|
1610
|
+
name: string;
|
|
1611
|
+
type: ApplicationCommandTypes;
|
|
1612
|
+
target_id?: string;
|
|
1613
|
+
resolved?: CommandInteractionResolvedData;
|
|
1614
|
+
options?: InteractionDataOptions[];
|
|
1615
|
+
}
|
|
1616
|
+
interface CommandInteractionResolvedData extends InteractionResolvedData {
|
|
1617
|
+
messages?: Collection<Message>;
|
|
1618
|
+
}
|
|
1619
|
+
interface ComponentInteractionButtonData {
|
|
1620
|
+
component_type: Constants["ComponentTypes"]["BUTTON"];
|
|
1621
|
+
custom_id: string;
|
|
1622
|
+
}
|
|
1623
|
+
interface ComponentInteractionSelectMenuData {
|
|
1624
|
+
component_type: SelectMenuTypes;
|
|
1625
|
+
custom_id: string;
|
|
1626
|
+
values: string[];
|
|
1627
|
+
resolved?: InteractionResolvedData;
|
|
1628
|
+
}
|
|
1629
|
+
interface InteractionAutocomplete {
|
|
1630
|
+
choices: ApplicationCommandOptionChoice[];
|
|
1631
|
+
}
|
|
1632
|
+
interface InteractionCallback {
|
|
1633
|
+
activityInstanceID?: string;
|
|
1634
|
+
id: string;
|
|
1635
|
+
responseMessageEphemeral?: boolean;
|
|
1636
|
+
responseMessageID?: string;
|
|
1637
|
+
responseMessageLoading?: boolean;
|
|
1638
|
+
type: InteractionTypes;
|
|
1639
|
+
}
|
|
1640
|
+
interface InteractionCallbackResource {
|
|
1641
|
+
activityInstance?: { id: string };
|
|
1642
|
+
message?: Message;
|
|
1643
|
+
type: InteractionResponseTypes;
|
|
1644
|
+
}
|
|
1645
|
+
interface InteractionCallbackResponse {
|
|
1646
|
+
interaction: InteractionCallback;
|
|
1647
|
+
resource?: InteractionCallbackResource;
|
|
1648
|
+
}
|
|
1649
|
+
interface InteractionDataOptionsSubCommand {
|
|
1650
|
+
name: string;
|
|
1651
|
+
options?: InteractionDataOptions[];
|
|
1652
|
+
type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND"];
|
|
1653
|
+
}
|
|
1654
|
+
interface InteractionDataOptionsSubCommandGroup {
|
|
1655
|
+
name: string;
|
|
1656
|
+
options: InteractionDataOptions[];
|
|
1657
|
+
type: Constants["ApplicationCommandOptionTypes"]["SUB_COMMAND_GROUP"];
|
|
1658
|
+
}
|
|
1659
|
+
interface InteractionDataOptionWithValue<T extends Constants["ApplicationCommandOptionTypes"][Exclude<keyof Constants["ApplicationCommandOptionTypes"], "SUB_COMMAND" | "SUB_COMMAND_GROUP">] = Constants["ApplicationCommandOptionTypes"][Exclude<keyof Constants["ApplicationCommandOptionTypes"], "SUB_COMMAND" | "SUB_COMMAND_GROUP">], V = unknown> {
|
|
1660
|
+
focused?: boolean;
|
|
1661
|
+
name: string;
|
|
1662
|
+
type: T;
|
|
1663
|
+
value: V;
|
|
1664
|
+
}
|
|
1665
|
+
interface InteractionModal {
|
|
1666
|
+
components: ModalComponent[];
|
|
1667
|
+
custom_id: string;
|
|
1668
|
+
title: string;
|
|
1669
|
+
}
|
|
1670
|
+
interface InteractionOptions {
|
|
1671
|
+
data?: InteractionCallbackData;
|
|
1672
|
+
type: InteractionResponseTypes;
|
|
1673
|
+
withResponse?: boolean;
|
|
1674
|
+
}
|
|
1675
|
+
interface InteractionResolvedData {
|
|
1676
|
+
channels?: Collection<AnyChannel>;
|
|
1677
|
+
members?: Collection<Member>;
|
|
1678
|
+
roles?: Collection<Role>;
|
|
1679
|
+
users?: Collection<User>;
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
// Invite
|
|
1683
|
+
interface CreateChannelInviteOptions extends CreateInviteOptions {
|
|
1684
|
+
roleIDs?: string[];
|
|
1685
|
+
targetApplicationID?: string;
|
|
1686
|
+
targetType?: InviteTargetTypes;
|
|
1687
|
+
targetUserID?: string;
|
|
1688
|
+
targetUserIDs?: string[];
|
|
1689
|
+
targetUsersFile?: Buffer;
|
|
1690
|
+
}
|
|
1691
|
+
interface CreateInviteOptions {
|
|
1692
|
+
maxAge?: number;
|
|
1693
|
+
maxUses?: number;
|
|
1694
|
+
temporary?: boolean;
|
|
1695
|
+
unique?: boolean;
|
|
1696
|
+
}
|
|
1697
|
+
interface Invitable {
|
|
1698
|
+
createInvite(options?: CreateInviteOptions, reason?: string): Promise<Invite>;
|
|
1699
|
+
getInvites(): Promise<Invite[]>;
|
|
1700
|
+
}
|
|
1701
|
+
interface InvitePartialChannel {
|
|
1702
|
+
icon?: string | null;
|
|
1703
|
+
id: string;
|
|
1704
|
+
name: string | null;
|
|
1705
|
+
recipients?: { username: string }[];
|
|
1706
|
+
type: Exclude<ChannelTypes, 1>;
|
|
1707
|
+
}
|
|
1708
|
+
interface InviteTargetUsersJob {
|
|
1709
|
+
completedAt: number | null;
|
|
1710
|
+
createdAt: number | null;
|
|
1711
|
+
errorMessage?: string | null;
|
|
1712
|
+
processedUsers: number;
|
|
1713
|
+
status: InviteTargetUsersJobStatus;
|
|
1714
|
+
totalUsers: number;
|
|
1715
|
+
}
|
|
1716
|
+
interface InviteStageInstance {
|
|
1717
|
+
members: Member[];
|
|
1718
|
+
participantCount: number;
|
|
1719
|
+
speakerCount: number;
|
|
1720
|
+
topic: string;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
// Lobby
|
|
1724
|
+
interface BulkEditLobbyMemberOptions extends LobbyMemberOptions {
|
|
1725
|
+
id: string;
|
|
1726
|
+
removeMember?: boolean;
|
|
1727
|
+
}
|
|
1728
|
+
interface LobbyInvite {
|
|
1729
|
+
code: string;
|
|
1730
|
+
}
|
|
1731
|
+
interface LobbyMemberOptions {
|
|
1732
|
+
additionalName?: string | null;
|
|
1733
|
+
flags?: number;
|
|
1734
|
+
metadata?: Record<string, string> | null;
|
|
1735
|
+
}
|
|
1736
|
+
interface LobbyOptions {
|
|
1737
|
+
idleTimeoutSeconds?: number;
|
|
1738
|
+
members?: (LobbyMemberOptions & { id: string })[];
|
|
1739
|
+
metadata?: Record<string, string> | null;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
// Member/User
|
|
1743
|
+
interface AvatarDecorationData {
|
|
1744
|
+
asset: string;
|
|
1745
|
+
sku_id: string;
|
|
1746
|
+
}
|
|
1747
|
+
interface MemberOptions {
|
|
1748
|
+
avatar?: string | null;
|
|
1749
|
+
banner?: string | null;
|
|
1750
|
+
bio?: string | null;
|
|
1751
|
+
channelID?: string | null;
|
|
1752
|
+
communicationDisabledUntil?: Date | null;
|
|
1753
|
+
deaf?: boolean;
|
|
1754
|
+
flags?: number;
|
|
1755
|
+
mute?: boolean;
|
|
1756
|
+
nick?: string | null;
|
|
1757
|
+
roles?: string[];
|
|
1758
|
+
}
|
|
1759
|
+
interface MemberPartial {
|
|
1760
|
+
id: string;
|
|
1761
|
+
user: User;
|
|
1762
|
+
}
|
|
1763
|
+
interface MemberRoles extends BaseData {
|
|
1764
|
+
roles: string[];
|
|
1765
|
+
}
|
|
1766
|
+
interface PartialUser {
|
|
1767
|
+
accentColor?: number | null;
|
|
1768
|
+
avatar: string | null;
|
|
1769
|
+
avatarDecorationData?: AvatarDecorationData | null;
|
|
1770
|
+
banner?: string | null;
|
|
1771
|
+
collectibles?: UserCollectibles | null;
|
|
1772
|
+
discriminator: string;
|
|
1773
|
+
id: string;
|
|
1774
|
+
primaryGuild?: PrimaryGuild | null;
|
|
1775
|
+
username: string;
|
|
1776
|
+
}
|
|
1777
|
+
interface PrimaryGuild {
|
|
1778
|
+
badge?: string | null;
|
|
1779
|
+
identityEnabled?: boolean | null;
|
|
1780
|
+
identityGuildID?: string | null;
|
|
1781
|
+
tag?: string | null;
|
|
1782
|
+
}
|
|
1783
|
+
interface RequestGuildMembersOptions {
|
|
1784
|
+
limit?: number;
|
|
1785
|
+
presences?: boolean;
|
|
1786
|
+
query?: string;
|
|
1787
|
+
timeout?: number;
|
|
1788
|
+
userIDs?: string[];
|
|
1789
|
+
}
|
|
1790
|
+
interface RequestGuildSoundboardSoundsOptions {
|
|
1791
|
+
guildIDs: string[];
|
|
1792
|
+
timeout?: number;
|
|
1793
|
+
}
|
|
1794
|
+
interface UserCollectibles {
|
|
1795
|
+
nameplate?: UserCollectiblesNameplate;
|
|
1796
|
+
}
|
|
1797
|
+
interface UserCollectiblesNameplate {
|
|
1798
|
+
asset: string;
|
|
1799
|
+
label: string;
|
|
1800
|
+
palette: string;
|
|
1801
|
+
sku_id: string;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
// Message
|
|
1805
|
+
interface ActionRow {
|
|
1806
|
+
components: ActionRowComponents[];
|
|
1807
|
+
type: Constants["ComponentTypes"]["ACTION_ROW"];
|
|
1808
|
+
}
|
|
1809
|
+
interface ModalContentActionRow {
|
|
1810
|
+
components: TextInput[];
|
|
1811
|
+
type: Constants["ComponentTypes"]["ACTION_ROW"];
|
|
1812
|
+
}
|
|
1813
|
+
interface ActiveMessages {
|
|
1814
|
+
args: string[];
|
|
1815
|
+
command: Command;
|
|
1816
|
+
message: Message;
|
|
1817
|
+
timeout: NodeJS.Timer;
|
|
1818
|
+
}
|
|
1819
|
+
interface AdvancedMessageContent extends AdvancedMessageContentEdit {
|
|
1820
|
+
messageReference?: MessageReferenceReply | MessageReferenceForward;
|
|
1821
|
+
/** @deprecated */
|
|
1822
|
+
messageReferenceID?: string;
|
|
1823
|
+
poll?: PollCreateOptions;
|
|
1824
|
+
stickerIDs?: string[];
|
|
1825
|
+
tts?: boolean;
|
|
1826
|
+
}
|
|
1827
|
+
interface AdvancedMessageContentEdit {
|
|
1828
|
+
allowedMentions?: AllowedMentions;
|
|
1829
|
+
attachments?: PartialAttachment[];
|
|
1830
|
+
components?: ActionRow[] | Component[];
|
|
1831
|
+
content?: string;
|
|
1832
|
+
/** @deprecated */
|
|
1833
|
+
embed?: EmbedOptions;
|
|
1834
|
+
embeds?: EmbedOptions[];
|
|
1835
|
+
enforceNonce?: boolean;
|
|
1836
|
+
file?: FileContent | FileContent[];
|
|
1837
|
+
flags?: number;
|
|
1838
|
+
}
|
|
1839
|
+
interface AllowedMentions {
|
|
1840
|
+
everyone?: boolean;
|
|
1841
|
+
repliedUser?: boolean;
|
|
1842
|
+
roles?: boolean | string[];
|
|
1843
|
+
users?: boolean | string[];
|
|
1844
|
+
}
|
|
1845
|
+
interface Attachment extends PartialAttachment {
|
|
1846
|
+
content_type?: string;
|
|
1847
|
+
duration_secs?: number;
|
|
1848
|
+
ephemeral?: boolean;
|
|
1849
|
+
filename: string;
|
|
1850
|
+
flags?: number;
|
|
1851
|
+
height?: number;
|
|
1852
|
+
id: string;
|
|
1853
|
+
proxy_url: string;
|
|
1854
|
+
size: number;
|
|
1855
|
+
url: string;
|
|
1856
|
+
waveform?: string;
|
|
1857
|
+
width?: number;
|
|
1858
|
+
}
|
|
1859
|
+
interface ButtonBase {
|
|
1860
|
+
disabled?: boolean;
|
|
1861
|
+
emoji?: Partial<PartialEmoji>;
|
|
1862
|
+
label?: string;
|
|
1863
|
+
type: Constants["ComponentTypes"]["BUTTON"];
|
|
1864
|
+
}
|
|
1865
|
+
interface CreateStickerOptions extends Required<Pick<EditStickerOptions, "name" | "tags">> {
|
|
1866
|
+
file: FileContent;
|
|
1867
|
+
}
|
|
1868
|
+
interface EditStickerOptions {
|
|
1869
|
+
description?: string;
|
|
1870
|
+
name?: string;
|
|
1871
|
+
tags?: string;
|
|
1872
|
+
}
|
|
1873
|
+
interface FileContent {
|
|
1874
|
+
file: Buffer | string;
|
|
1875
|
+
name: string;
|
|
1876
|
+
}
|
|
1877
|
+
interface TextInput {
|
|
1878
|
+
custom_id: string;
|
|
1879
|
+
id?: number;
|
|
1880
|
+
/** @deprecated */
|
|
1881
|
+
label?: string;
|
|
1882
|
+
max_length?: number;
|
|
1883
|
+
min_length?: number;
|
|
1884
|
+
placeholder?: string;
|
|
1885
|
+
required?: boolean;
|
|
1886
|
+
style: Constants["TextInputStyles"][keyof Constants["TextInputStyles"]];
|
|
1887
|
+
type: Constants["ComponentTypes"]["TEXT_INPUT"];
|
|
1888
|
+
value?: string;
|
|
1889
|
+
}
|
|
1890
|
+
interface GetMessageReactionOptions {
|
|
1891
|
+
after?: string;
|
|
1892
|
+
/** @deprecated */
|
|
1893
|
+
before?: string;
|
|
1894
|
+
limit?: number;
|
|
1895
|
+
type?: ReactionTypes;
|
|
1896
|
+
}
|
|
1897
|
+
interface GetPollAnswerVotersOptions {
|
|
1898
|
+
after?: string;
|
|
1899
|
+
limit?: number;
|
|
1900
|
+
}
|
|
1901
|
+
interface InteractionButton extends ButtonBase {
|
|
1902
|
+
custom_id: string;
|
|
1903
|
+
style: Exclude<ButtonStyles, Constants["ButtonStyles"]["LINK"] | Constants["ButtonStyles"]["PREMIUM"]>;
|
|
1904
|
+
}
|
|
1905
|
+
interface MessageActivity {
|
|
1906
|
+
party_id?: string;
|
|
1907
|
+
type: MessageActivityTypes;
|
|
1908
|
+
}
|
|
1909
|
+
interface MessageApplication {
|
|
1910
|
+
cover_image?: string;
|
|
1911
|
+
description: string;
|
|
1912
|
+
icon: string | null;
|
|
1913
|
+
id: string;
|
|
1914
|
+
name: string;
|
|
1915
|
+
}
|
|
1916
|
+
interface MessageCall {
|
|
1917
|
+
endedTimestamp: number | null;
|
|
1918
|
+
participants: string[];
|
|
1919
|
+
}
|
|
1920
|
+
interface MessageInteraction {
|
|
1921
|
+
id: string;
|
|
1922
|
+
member: Member | null;
|
|
1923
|
+
name: string;
|
|
1924
|
+
type: InteractionTypes;
|
|
1925
|
+
user: User;
|
|
1926
|
+
}
|
|
1927
|
+
interface MessageInteractionMetadata {
|
|
1928
|
+
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
|
1929
|
+
id: string;
|
|
1930
|
+
interactedMessageID?: string;
|
|
1931
|
+
originalResponseMessageID?: string;
|
|
1932
|
+
targetMessageID?: string;
|
|
1933
|
+
targetUser?: User;
|
|
1934
|
+
triggeringInteractionMetadata?: MessageInteractionMetadata;
|
|
1935
|
+
type: InteractionTypes;
|
|
1936
|
+
user: User;
|
|
1937
|
+
}
|
|
1938
|
+
interface MessageReference extends MessageReferenceBase {
|
|
1939
|
+
channelID: string;
|
|
1940
|
+
}
|
|
1941
|
+
interface MessageReferenceBase {
|
|
1942
|
+
channelID?: string;
|
|
1943
|
+
guildID?: string;
|
|
1944
|
+
messageID?: string;
|
|
1945
|
+
type?: MessageReferenceTypes;
|
|
1946
|
+
}
|
|
1947
|
+
interface MessageReferenceForward extends MessageReferenceBase {
|
|
1948
|
+
channelID: string;
|
|
1949
|
+
messageID: string;
|
|
1950
|
+
type: Constants["MessageReferenceTypes"]["FORWARD"];
|
|
1951
|
+
}
|
|
1952
|
+
interface MessageReferenceReply extends MessageReferenceBase {
|
|
1953
|
+
messageID: string;
|
|
1954
|
+
failIfNotExists?: boolean;
|
|
1955
|
+
type?: Constants["MessageReferenceTypes"]["DEFAULT"];
|
|
1956
|
+
}
|
|
1957
|
+
interface MessageSnapshot {
|
|
1958
|
+
guildID?: string;
|
|
1959
|
+
message: Pick<Message, "attachments" | "components" | "content" | "editedTimestamp" | "embeds" | "flags" | "id" | "mentions" | "roleMentions" | "stickerItems" | "stickers" | "timestamp" | "type">;
|
|
1960
|
+
}
|
|
1961
|
+
interface PartialAttachment {
|
|
1962
|
+
description?: string;
|
|
1963
|
+
filename?: string;
|
|
1964
|
+
id: string | number;
|
|
1965
|
+
}
|
|
1966
|
+
interface Poll {
|
|
1967
|
+
allow_multiselect: boolean;
|
|
1968
|
+
answers: PollAnswer[];
|
|
1969
|
+
expiry: number | null;
|
|
1970
|
+
layout_type: PollLayoutTypes;
|
|
1971
|
+
question: Pick<PollMedia, "text">;
|
|
1972
|
+
results?: PollResult;
|
|
1973
|
+
}
|
|
1974
|
+
interface PollAnswer {
|
|
1975
|
+
answer_id: number;
|
|
1976
|
+
poll_media: PollMedia;
|
|
1977
|
+
}
|
|
1978
|
+
interface PollCreateOptions extends Omit<Poll, "expiry" | "results"> {
|
|
1979
|
+
duration: number;
|
|
1980
|
+
}
|
|
1981
|
+
interface PollMedia {
|
|
1982
|
+
emoji?: PartialEmoji;
|
|
1983
|
+
text: string;
|
|
1984
|
+
}
|
|
1985
|
+
interface PollResult {
|
|
1986
|
+
answer_counts: PollAnswerCount[];
|
|
1987
|
+
is_finalized: boolean;
|
|
1988
|
+
}
|
|
1989
|
+
interface PollAnswerCount {
|
|
1990
|
+
count: number;
|
|
1991
|
+
id: number;
|
|
1992
|
+
me_voted: boolean;
|
|
1993
|
+
}
|
|
1994
|
+
interface Reaction {
|
|
1995
|
+
burst_colors: string[];
|
|
1996
|
+
count: number;
|
|
1997
|
+
count_details: ReactionCountDetails;
|
|
1998
|
+
me: boolean;
|
|
1999
|
+
me_burst: boolean;
|
|
2000
|
+
type: ReactionTypes;
|
|
2001
|
+
}
|
|
2002
|
+
interface ReactionCountDetails {
|
|
2003
|
+
burst: number;
|
|
2004
|
+
normal: number;
|
|
2005
|
+
}
|
|
2006
|
+
interface SelectMenuBase {
|
|
2007
|
+
custom_id: string;
|
|
2008
|
+
disabled?: boolean;
|
|
2009
|
+
max_values?: number;
|
|
2010
|
+
min_values?: number;
|
|
2011
|
+
placeholder?: string;
|
|
2012
|
+
type: SelectMenuTypes;
|
|
2013
|
+
}
|
|
2014
|
+
interface ChannelSelectMenu extends SelectMenuBase {
|
|
2015
|
+
channel_types?: ChannelTypes[];
|
|
2016
|
+
type: Constants["ComponentTypes"]["CHANNEL_SELECT"];
|
|
2017
|
+
}
|
|
2018
|
+
interface StringSelectMenu extends SelectMenuBase {
|
|
2019
|
+
options: StringSelectOptions[];
|
|
2020
|
+
type: Constants["ComponentTypes"]["STRING_SELECT"];
|
|
2021
|
+
}
|
|
2022
|
+
interface StringSelectOptions {
|
|
2023
|
+
default?: boolean;
|
|
2024
|
+
description?: string;
|
|
2025
|
+
emoji?: Partial<PartialEmoji>;
|
|
2026
|
+
label: string;
|
|
2027
|
+
value: string;
|
|
2028
|
+
}
|
|
2029
|
+
interface ResolvedSelectMenus extends SelectMenuBase {
|
|
2030
|
+
default_values?: SelectDefaultValues[];
|
|
2031
|
+
type: SelectMenuResolvedTypes;
|
|
2032
|
+
}
|
|
2033
|
+
interface SelectDefaultValues {
|
|
2034
|
+
id: string;
|
|
2035
|
+
type: "user" | "role" | "channel";
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
interface Section {
|
|
2039
|
+
accessory?: Thumbnail | Button;
|
|
2040
|
+
components: TextDisplay[];
|
|
2041
|
+
id?: number;
|
|
2042
|
+
type: Constants["ComponentTypes"]["SECTION"];
|
|
2043
|
+
}
|
|
2044
|
+
interface TextDisplay {
|
|
2045
|
+
content: string;
|
|
2046
|
+
id?: number;
|
|
2047
|
+
type: Constants["ComponentTypes"]["TEXT_DISPLAY"];
|
|
2048
|
+
}
|
|
2049
|
+
interface Thumbnail {
|
|
2050
|
+
description?: string;
|
|
2051
|
+
id?: number;
|
|
2052
|
+
media: UnfurledMediaItem;
|
|
2053
|
+
spoiler?: boolean;
|
|
2054
|
+
type: Constants["ComponentTypes"]["THUMBNAIL"];
|
|
2055
|
+
}
|
|
2056
|
+
interface MediaGallery {
|
|
2057
|
+
id?: number;
|
|
2058
|
+
items: MediaGalleryItem[];
|
|
2059
|
+
type: Constants["ComponentTypes"]["MEDIA_GALLERY"];
|
|
2060
|
+
}
|
|
2061
|
+
interface MediaGalleryItem {
|
|
2062
|
+
description?: string;
|
|
2063
|
+
media: UnfurledMediaItem;
|
|
2064
|
+
spoiler?: boolean;
|
|
2065
|
+
}
|
|
2066
|
+
interface File {
|
|
2067
|
+
file: UnfurledMediaItem;
|
|
2068
|
+
id?: number;
|
|
2069
|
+
name?: string;
|
|
2070
|
+
size?: number;
|
|
2071
|
+
spoiler?: boolean;
|
|
2072
|
+
type: Constants["ComponentTypes"]["FILE"];
|
|
2073
|
+
}
|
|
2074
|
+
interface Separator {
|
|
2075
|
+
divider?: boolean;
|
|
2076
|
+
id?: number;
|
|
2077
|
+
spacing?: 1 | 2;
|
|
2078
|
+
type: Constants["ComponentTypes"]["SEPARATOR"];
|
|
2079
|
+
}
|
|
2080
|
+
interface Container {
|
|
2081
|
+
accent_color?: number;
|
|
2082
|
+
components: (ActionRow | TextDisplay | Section | MediaGallery | Separator | File)[];
|
|
2083
|
+
id?: number;
|
|
2084
|
+
spoiler?: boolean;
|
|
2085
|
+
type: Constants["ComponentTypes"]["CONTAINER"];
|
|
2086
|
+
}
|
|
2087
|
+
interface UnfurledMediaItem {
|
|
2088
|
+
attachment_id?: string;
|
|
2089
|
+
content_scan_metadata?: { flags: number };
|
|
2090
|
+
content_type?: string;
|
|
2091
|
+
flags?: number;
|
|
2092
|
+
height?: number | null;
|
|
2093
|
+
placeholder?: string;
|
|
2094
|
+
placeholder_version?: number;
|
|
2095
|
+
proxy_url?: string;
|
|
2096
|
+
url: string;
|
|
2097
|
+
width?: number | null;
|
|
2098
|
+
}
|
|
2099
|
+
interface Sticker extends StickerItems {
|
|
2100
|
+
available?: boolean;
|
|
2101
|
+
description: string;
|
|
2102
|
+
guild_id?: string;
|
|
2103
|
+
pack_id?: string;
|
|
2104
|
+
sort_value?: number;
|
|
2105
|
+
tags: string;
|
|
2106
|
+
type: StickerTypes;
|
|
2107
|
+
user?: User;
|
|
2108
|
+
}
|
|
2109
|
+
interface StickerItems {
|
|
2110
|
+
format_type: StickerFormats;
|
|
2111
|
+
id: string;
|
|
2112
|
+
name: string;
|
|
2113
|
+
}
|
|
2114
|
+
interface StickerPack {
|
|
2115
|
+
banner_asset_id: string;
|
|
2116
|
+
cover_sticker_id?: string;
|
|
2117
|
+
description: string;
|
|
2118
|
+
id: string;
|
|
2119
|
+
name: string;
|
|
2120
|
+
sku_id: string;
|
|
2121
|
+
stickers: Sticker[];
|
|
2122
|
+
}
|
|
2123
|
+
interface PremiumButton {
|
|
2124
|
+
disabled?: boolean;
|
|
2125
|
+
id?: number;
|
|
2126
|
+
sku_id: string;
|
|
2127
|
+
style: Constants["ButtonStyles"]["PREMIUM"];
|
|
2128
|
+
type: Constants["ComponentTypes"]["BUTTON"];
|
|
2129
|
+
}
|
|
2130
|
+
interface SharedClientTheme {
|
|
2131
|
+
baseMix: number;
|
|
2132
|
+
baseTheme: BaseThemeTypes | null;
|
|
2133
|
+
colors: string[];
|
|
2134
|
+
gradientAngle: number;
|
|
2135
|
+
}
|
|
2136
|
+
interface URLButton extends ButtonBase {
|
|
2137
|
+
style: Constants["ButtonStyles"]["LINK"];
|
|
2138
|
+
url: string;
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
// Monetization
|
|
2142
|
+
interface CreateTestEntitlementOptions {
|
|
2143
|
+
ownerID: string;
|
|
2144
|
+
ownerType: EntitlementOwnerTypes;
|
|
2145
|
+
skuID: string;
|
|
2146
|
+
}
|
|
2147
|
+
interface GetEntitlementsOptions {
|
|
2148
|
+
after?: string;
|
|
2149
|
+
before?: string;
|
|
2150
|
+
excludeDeleted?: boolean;
|
|
2151
|
+
excludeEnded?: boolean;
|
|
2152
|
+
guildID?: string;
|
|
2153
|
+
limit?: number;
|
|
2154
|
+
skuIDs?: string[];
|
|
2155
|
+
userID?: string;
|
|
2156
|
+
}
|
|
2157
|
+
interface GetSKUSubscriptionsOptions {
|
|
2158
|
+
after?: string;
|
|
2159
|
+
before?: string;
|
|
2160
|
+
limit?: number;
|
|
2161
|
+
userID: string;
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
// Presence
|
|
2165
|
+
interface Activity<T extends ActivityType = ActivityType> extends ActivityPartial<T> {
|
|
2166
|
+
application_id?: string;
|
|
2167
|
+
assets?: {
|
|
2168
|
+
large_image?: string;
|
|
2169
|
+
large_text?: string;
|
|
2170
|
+
small_image?: string;
|
|
2171
|
+
small_text?: string;
|
|
2172
|
+
[key: string]: unknown;
|
|
2173
|
+
};
|
|
2174
|
+
created_at: number;
|
|
2175
|
+
details?: string;
|
|
2176
|
+
emoji?: { animated?: boolean; id?: string; name: string };
|
|
2177
|
+
flags?: number;
|
|
2178
|
+
instance?: boolean;
|
|
2179
|
+
party?: { id?: string; size?: [number, number] };
|
|
2180
|
+
secrets?: { join?: string; spectate?: string; match?: string };
|
|
2181
|
+
state?: string;
|
|
2182
|
+
timestamps?: { end?: number; start: number };
|
|
2183
|
+
type: T;
|
|
2184
|
+
// the stuff attached to this object apparently varies even more than documented, so...
|
|
2185
|
+
[key: string]: unknown;
|
|
2186
|
+
}
|
|
2187
|
+
interface ActivityPartial<T extends ActivityType> {
|
|
2188
|
+
name: string;
|
|
2189
|
+
state?: string;
|
|
2190
|
+
type?: T;
|
|
2191
|
+
url?: string;
|
|
2192
|
+
}
|
|
2193
|
+
interface ClientPresence {
|
|
2194
|
+
activities: Activity[] | null;
|
|
2195
|
+
afk: boolean;
|
|
2196
|
+
since: number | null;
|
|
2197
|
+
status: SelfStatus;
|
|
2198
|
+
}
|
|
2199
|
+
interface ClientStatus {
|
|
2200
|
+
desktop: UserStatus;
|
|
2201
|
+
mobile: UserStatus;
|
|
2202
|
+
web: UserStatus;
|
|
2203
|
+
}
|
|
2204
|
+
interface Presence {
|
|
2205
|
+
activities?: Activity[];
|
|
2206
|
+
clientStatus?: ClientStatus;
|
|
2207
|
+
status?: UserStatus;
|
|
2208
|
+
}
|
|
2209
|
+
|
|
2210
|
+
// Role
|
|
2211
|
+
interface Overwrite {
|
|
2212
|
+
allow: bigint | number;
|
|
2213
|
+
deny: bigint | number;
|
|
2214
|
+
id: string;
|
|
2215
|
+
type: PermissionType;
|
|
2216
|
+
}
|
|
2217
|
+
interface PartialRole {
|
|
2218
|
+
color?: number;
|
|
2219
|
+
flags?: number;
|
|
2220
|
+
hoist?: boolean;
|
|
2221
|
+
id: string;
|
|
2222
|
+
mentionable?: boolean;
|
|
2223
|
+
name?: string;
|
|
2224
|
+
permissions?: number;
|
|
2225
|
+
position?: number;
|
|
2226
|
+
}
|
|
2227
|
+
interface RoleColors {
|
|
2228
|
+
primaryColor: number;
|
|
2229
|
+
secondaryColor?: number | null;
|
|
2230
|
+
tertiaryColor?: number | null;
|
|
2231
|
+
}
|
|
2232
|
+
interface RoleOptions {
|
|
2233
|
+
color?: number;
|
|
2234
|
+
colors?: RoleColors;
|
|
2235
|
+
hoist?: boolean;
|
|
2236
|
+
icon?: string;
|
|
2237
|
+
mentionable?: boolean;
|
|
2238
|
+
name?: string;
|
|
2239
|
+
permissions?: bigint | number | string | Permission;
|
|
2240
|
+
unicodeEmoji?: string;
|
|
2241
|
+
}
|
|
2242
|
+
interface RoleSubscriptionData {
|
|
2243
|
+
isRenewal: boolean;
|
|
2244
|
+
roleSubscriptionListingID: string;
|
|
2245
|
+
tierName: string;
|
|
2246
|
+
totalMonthsSubscribed: number;
|
|
2247
|
+
}
|
|
2248
|
+
interface RoleTags {
|
|
2249
|
+
bot_id?: string;
|
|
2250
|
+
integration_id?: string;
|
|
2251
|
+
premium_subscriber?: true;
|
|
2252
|
+
subscription_listing_id?: string;
|
|
2253
|
+
available_for_purchase?: true;
|
|
2254
|
+
guild_connections?: true;
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
// Forum/Thread
|
|
2258
|
+
interface CreateThreadOptions {
|
|
2259
|
+
autoArchiveDuration?: AutoArchiveDuration;
|
|
2260
|
+
name: string;
|
|
2261
|
+
rateLimitPerUser?: number;
|
|
2262
|
+
reason?: string;
|
|
2263
|
+
}
|
|
2264
|
+
interface CreateForumThreadOptions extends CreateThreadOptions {
|
|
2265
|
+
appliedTags?: string[];
|
|
2266
|
+
message: Omit<AdvancedMessageContent, "messageReference" | "messageReferenceID" | "tts"> & FileContent[];
|
|
2267
|
+
}
|
|
2268
|
+
interface CreateThreadWithoutMessageOptions<T = AnyThreadChannel["type"]> extends CreateThreadOptions {
|
|
2269
|
+
invitable?: T extends PrivateThreadChannel["type"] ? boolean : never;
|
|
2270
|
+
type?: T;
|
|
2271
|
+
}
|
|
2272
|
+
interface DefaultReactionEmoji {
|
|
2273
|
+
emoji_id?: string;
|
|
2274
|
+
emoji_name?: string;
|
|
2275
|
+
}
|
|
2276
|
+
interface ForumTag extends DefaultReactionEmoji {
|
|
2277
|
+
id: string;
|
|
2278
|
+
name: string;
|
|
2279
|
+
moderated: boolean;
|
|
2280
|
+
}
|
|
2281
|
+
interface GetArchivedThreadsOptions {
|
|
2282
|
+
before?: Date;
|
|
2283
|
+
limit?: number;
|
|
2284
|
+
}
|
|
2285
|
+
interface GetThreadMembersOptions {
|
|
2286
|
+
after?: string;
|
|
2287
|
+
limit?: number;
|
|
2288
|
+
withMember?: boolean;
|
|
2289
|
+
}
|
|
2290
|
+
interface ListedChannelThreads<T extends ThreadChannel = AnyThreadChannel> extends ListedGuildThreads<T> {
|
|
2291
|
+
hasMore: boolean;
|
|
2292
|
+
}
|
|
2293
|
+
interface ListedGuildThreads<T extends ThreadChannel = AnyThreadChannel> {
|
|
2294
|
+
members: ThreadMember[];
|
|
2295
|
+
threads: T[];
|
|
2296
|
+
}
|
|
2297
|
+
interface PrivateThreadMetadata extends ThreadMetadata {
|
|
2298
|
+
invitable: boolean;
|
|
2299
|
+
}
|
|
2300
|
+
interface ThreadMetadata {
|
|
2301
|
+
archived: boolean;
|
|
2302
|
+
archiveTimestamp: number;
|
|
2303
|
+
autoArchiveDuration: AutoArchiveDuration;
|
|
2304
|
+
createTimestamp?: number | null;
|
|
2305
|
+
locked: boolean;
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
// Modals
|
|
2309
|
+
interface Checkbox {
|
|
2310
|
+
custom_id: string;
|
|
2311
|
+
default?: boolean;
|
|
2312
|
+
id?: number;
|
|
2313
|
+
type: Constants["ComponentTypes"]["CHECKBOX"];
|
|
2314
|
+
}
|
|
2315
|
+
interface CheckboxGroup {
|
|
2316
|
+
custom_id: string;
|
|
2317
|
+
id?: number;
|
|
2318
|
+
max_values?: number;
|
|
2319
|
+
min_values?: number;
|
|
2320
|
+
options: ModalChoiceOption[];
|
|
2321
|
+
required?: boolean;
|
|
2322
|
+
type: Constants["ComponentTypes"]["CHECKBOX_GROUP"];
|
|
2323
|
+
}
|
|
2324
|
+
interface FileUpload {
|
|
2325
|
+
custom_id: string;
|
|
2326
|
+
file_types?: string[];
|
|
2327
|
+
id?: number;
|
|
2328
|
+
max_values?: number;
|
|
2329
|
+
min_values?: number;
|
|
2330
|
+
required?: boolean;
|
|
2331
|
+
type: Constants["ComponentTypes"]["FILE_UPLOAD"];
|
|
2332
|
+
}
|
|
2333
|
+
interface Label {
|
|
2334
|
+
component: LabelChildComponent;
|
|
2335
|
+
description?: string;
|
|
2336
|
+
id?: number;
|
|
2337
|
+
label: string;
|
|
2338
|
+
type: Constants["ComponentTypes"]["LABEL"];
|
|
2339
|
+
}
|
|
2340
|
+
interface ModalChoiceOption {
|
|
2341
|
+
default?: boolean;
|
|
2342
|
+
description?: string;
|
|
2343
|
+
label: string;
|
|
2344
|
+
value: string;
|
|
2345
|
+
}
|
|
2346
|
+
interface ModalSubmitInteractionDataComponents {
|
|
2347
|
+
component?: never;
|
|
2348
|
+
components: ModalSubmitInteractionDataComponent[];
|
|
2349
|
+
type: Constants["ComponentTypes"]["ACTION_ROW"];
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
interface RadioGroup {
|
|
2353
|
+
custom_id: string;
|
|
2354
|
+
id?: number;
|
|
2355
|
+
options: ModalChoiceOption[];
|
|
2356
|
+
required?: boolean;
|
|
2357
|
+
type: Constants["ComponentTypes"]["RADIO_GROUP"];
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
interface ModalSubmitInteractionDataTextInputComponent {
|
|
2361
|
+
custom_id: string;
|
|
2362
|
+
id?: number;
|
|
2363
|
+
type: Constants["ComponentTypes"]["TEXT_INPUT"];
|
|
2364
|
+
value: string;
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
interface ModalSubmitInteractionData {
|
|
2368
|
+
components: (ModalSubmitInteractionDataComponents | ModalSubmitInteractionDataLabelComponent | ModalSubmitInteractionDataTextDisplayComponent)[];
|
|
2369
|
+
custom_id: string;
|
|
2370
|
+
resolved?: ModalSubmitInteractionResolvedData;
|
|
2371
|
+
}
|
|
2372
|
+
interface ModalSubmitInteractionDataCheckboxComponent {
|
|
2373
|
+
custom_id: string;
|
|
2374
|
+
id: number;
|
|
2375
|
+
type: Constants["ComponentTypes"]["CHECKBOX"];
|
|
2376
|
+
value: boolean;
|
|
2377
|
+
}
|
|
2378
|
+
interface ModalSubmitInteractionDataCheckboxGroupComponent {
|
|
2379
|
+
custom_id: string;
|
|
2380
|
+
id: number;
|
|
2381
|
+
type: Constants["ComponentTypes"]["CHECKBOX_GROUP"];
|
|
2382
|
+
values: string[];
|
|
2383
|
+
}
|
|
2384
|
+
interface ModalSubmitInteractionDataFileUploadComponent {
|
|
2385
|
+
custom_id: string;
|
|
2386
|
+
id: number;
|
|
2387
|
+
type: Constants["ComponentTypes"]["FILE_UPLOAD"];
|
|
2388
|
+
values: string[];
|
|
2389
|
+
}
|
|
2390
|
+
interface ModalSubmitInteractionDataLabelComponent {
|
|
2391
|
+
component: ModalSubmitInteractionDataLabelChildComponent;
|
|
2392
|
+
components?: never;
|
|
2393
|
+
id: number;
|
|
2394
|
+
type: Constants["ComponentTypes"]["LABEL"];
|
|
2395
|
+
}
|
|
2396
|
+
interface ModalSubmitInteractionDataRadioGroupComponent {
|
|
2397
|
+
custom_id: string;
|
|
2398
|
+
id: number;
|
|
2399
|
+
type: Constants["ComponentTypes"]["RADIO_GROUP"];
|
|
2400
|
+
value: string | null;
|
|
2401
|
+
}
|
|
2402
|
+
interface ModalSubmitInteractionDataSelectMenuComponent {
|
|
2403
|
+
custom_id: string;
|
|
2404
|
+
id: number;
|
|
2405
|
+
type: SelectMenuTypes;
|
|
2406
|
+
values: string[];
|
|
2407
|
+
}
|
|
2408
|
+
interface ModalSubmitInteractionDataTextDisplayComponent {
|
|
2409
|
+
component?: never;
|
|
2410
|
+
components?: never;
|
|
2411
|
+
id: number;
|
|
2412
|
+
type: Constants["ComponentTypes"]["TEXT_DISPLAY"];
|
|
2413
|
+
}
|
|
2414
|
+
interface ModalSubmitInteractionResolvedData extends InteractionResolvedData {
|
|
2415
|
+
attachments?: Record<string, Attachment>;
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
// Voice
|
|
2419
|
+
interface JoinVoiceChannelOptions {
|
|
2420
|
+
daveEncryption?: boolean;
|
|
2421
|
+
decryptionFailureTolerance?: number;
|
|
2422
|
+
opusOnly?: boolean;
|
|
2423
|
+
selfDeaf?: boolean;
|
|
2424
|
+
selfMute?: boolean;
|
|
2425
|
+
shared?: boolean;
|
|
2426
|
+
}
|
|
2427
|
+
interface VoiceConnectionOptions {
|
|
2428
|
+
daveEncryption?: boolean;
|
|
2429
|
+
decryptionFailureTolerance?: number;
|
|
2430
|
+
opusOnly?: boolean;
|
|
2431
|
+
shard?: Shard;
|
|
2432
|
+
shared?: boolean;
|
|
2433
|
+
}
|
|
2434
|
+
interface VoiceDaveSession {
|
|
2435
|
+
readonly canEncrypt: boolean;
|
|
2436
|
+
readonly protocolVersion: number;
|
|
2437
|
+
readonly ready: boolean;
|
|
2438
|
+
readonly voicePrivacyCode: string;
|
|
2439
|
+
getVerificationCode(userID: string): Promise<string>;
|
|
2440
|
+
}
|
|
2441
|
+
interface StageInstanceOptions {
|
|
2442
|
+
privacyLevel?: StageInstancePrivacyLevel;
|
|
2443
|
+
topic?: string;
|
|
2444
|
+
}
|
|
2445
|
+
interface UncachedMemberVoiceState {
|
|
2446
|
+
id: string;
|
|
2447
|
+
voiceState: OldVoiceState;
|
|
2448
|
+
}
|
|
2449
|
+
interface VoiceChannelEffect {
|
|
2450
|
+
animationID?: number;
|
|
2451
|
+
animationType?: VoiceChannelEffectAnimationType | null;
|
|
2452
|
+
channel: PossiblyUncachedSpeakableChannel;
|
|
2453
|
+
emoji?: PartialEmoji | null;
|
|
2454
|
+
guild: PossiblyUncachedGuild;
|
|
2455
|
+
soundID?: string | number;
|
|
2456
|
+
soundVolume?: number;
|
|
2457
|
+
user: PossiblyUncachedUser;
|
|
2458
|
+
}
|
|
2459
|
+
interface VoiceConnectData {
|
|
2460
|
+
channel_id: string;
|
|
2461
|
+
endpoint: string;
|
|
2462
|
+
session_id: string;
|
|
2463
|
+
token: string;
|
|
2464
|
+
user_id: string;
|
|
2465
|
+
}
|
|
2466
|
+
interface VoiceResourceOptions {
|
|
2467
|
+
encoderArgs?: string[];
|
|
2468
|
+
format?: string;
|
|
2469
|
+
frameDuration?: number;
|
|
2470
|
+
frameSize?: number;
|
|
2471
|
+
inlineVolume?: boolean;
|
|
2472
|
+
inputArgs?: string[];
|
|
2473
|
+
pcmSize?: number;
|
|
2474
|
+
samplingRate?: number;
|
|
2475
|
+
voiceDataTimeout?: number;
|
|
2476
|
+
}
|
|
2477
|
+
interface VoiceServerUpdateData extends Omit<VoiceConnectData, "channel_id"> {
|
|
2478
|
+
guild_id: string;
|
|
2479
|
+
shard: Shard;
|
|
2480
|
+
}
|
|
2481
|
+
interface VoiceStateOptions {
|
|
2482
|
+
channelID: string;
|
|
2483
|
+
requestToSpeakTimestamp?: Date | null;
|
|
2484
|
+
suppress?: boolean;
|
|
2485
|
+
}
|
|
2486
|
+
interface VoiceStatus {
|
|
2487
|
+
status: string;
|
|
2488
|
+
}
|
|
2489
|
+
interface VoiceStreamCurrent {
|
|
2490
|
+
buffer: Buffer | null;
|
|
2491
|
+
bufferingTicks: number;
|
|
2492
|
+
options: VoiceResourceOptions;
|
|
2493
|
+
pausedTime?: number;
|
|
2494
|
+
pausedTimestamp?: number;
|
|
2495
|
+
playTime: number;
|
|
2496
|
+
startTime: number;
|
|
2497
|
+
timeout: NodeJS.Timeout | null;
|
|
2498
|
+
}
|
|
2499
|
+
|
|
2500
|
+
// Webhook
|
|
2501
|
+
interface Webhook {
|
|
2502
|
+
application_id: string | null;
|
|
2503
|
+
avatar: string | null;
|
|
2504
|
+
channel_id: string | null;
|
|
2505
|
+
guild_id: string | null;
|
|
2506
|
+
id: string;
|
|
2507
|
+
name: string;
|
|
2508
|
+
source_channel?: { id: string; name: string };
|
|
2509
|
+
source_guild: { icon: string | null; id: string; name: string };
|
|
2510
|
+
token?: string;
|
|
2511
|
+
type: WebhookTypes;
|
|
2512
|
+
url?: string;
|
|
2513
|
+
user?: PartialUser;
|
|
2514
|
+
}
|
|
2515
|
+
interface WebhookCreateOptions extends Omit<WebhookEditOptions, "channelID"> {
|
|
2516
|
+
name: string;
|
|
2517
|
+
}
|
|
2518
|
+
interface WebhookEditOptions {
|
|
2519
|
+
avatar?: string | null;
|
|
2520
|
+
channelID?: string;
|
|
2521
|
+
name?: string;
|
|
2522
|
+
}
|
|
2523
|
+
interface WebhookPayload {
|
|
2524
|
+
allowedMentions?: AllowedMentions;
|
|
2525
|
+
attachments?: PartialAttachment[];
|
|
2526
|
+
auth?: boolean;
|
|
2527
|
+
avatarURL?: string;
|
|
2528
|
+
components?: ActionRow[] | Component[];
|
|
2529
|
+
content?: string;
|
|
2530
|
+
/** @deprecated */
|
|
2531
|
+
embed?: EmbedOptions;
|
|
2532
|
+
embeds?: EmbedOptions[];
|
|
2533
|
+
file?: FileContent | FileContent[];
|
|
2534
|
+
flags?: number;
|
|
2535
|
+
poll?: PollCreateOptions;
|
|
2536
|
+
threadID?: string;
|
|
2537
|
+
tts?: boolean;
|
|
2538
|
+
username?: string;
|
|
2539
|
+
wait?: boolean;
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
// TODO: Does this have more stuff?
|
|
2543
|
+
interface BaseData {
|
|
2544
|
+
id: string;
|
|
2545
|
+
[key: string]: unknown;
|
|
2546
|
+
}
|
|
2547
|
+
interface OAuthApplicationInfo {
|
|
2548
|
+
approximate_guild_count?: number;
|
|
2549
|
+
approximate_user_authorization_count?: number;
|
|
2550
|
+
approximate_user_install_count?: number;
|
|
2551
|
+
bot?: PartialUser;
|
|
2552
|
+
bot_public: boolean;
|
|
2553
|
+
bot_require_code_grant: boolean;
|
|
2554
|
+
cover_image?: string;
|
|
2555
|
+
custom_install_url?: string;
|
|
2556
|
+
description: string;
|
|
2557
|
+
event_webhooks_status?: ApplicationEventWebhookStatus;
|
|
2558
|
+
event_webhooks_types?: string[];
|
|
2559
|
+
event_webhooks_url?: string | null;
|
|
2560
|
+
flags?: number;
|
|
2561
|
+
guild_id?: string;
|
|
2562
|
+
icon: string | null;
|
|
2563
|
+
id: string;
|
|
2564
|
+
install_params?: ApplicationInstallParams;
|
|
2565
|
+
integration_types_config?: Partial<Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>>;
|
|
2566
|
+
interactions_endpoint_url?: string | null;
|
|
2567
|
+
name: string;
|
|
2568
|
+
owner: PartialUser;
|
|
2569
|
+
primary_sku_id?: string;
|
|
2570
|
+
privacy_policy_url?: string;
|
|
2571
|
+
redirect_uris?: string[];
|
|
2572
|
+
role_connections_verification_url?: string | null;
|
|
2573
|
+
rpc_origins?: string[];
|
|
2574
|
+
slug?: string;
|
|
2575
|
+
tags?: string[];
|
|
2576
|
+
team: OAuthTeamInfo | null;
|
|
2577
|
+
terms_of_service_url?: string;
|
|
2578
|
+
verify_key: string;
|
|
2579
|
+
}
|
|
2580
|
+
interface OAuthTeamInfo {
|
|
2581
|
+
icon: string | null;
|
|
2582
|
+
id: string;
|
|
2583
|
+
members: OAuthTeamMember[];
|
|
2584
|
+
name: string;
|
|
2585
|
+
owner_user_id: string;
|
|
2586
|
+
}
|
|
2587
|
+
interface OAuthTeamMember {
|
|
2588
|
+
membership_state: MembershipStates;
|
|
2589
|
+
role: OAuthTeamMemberRoleTypes;
|
|
2590
|
+
team_id: string;
|
|
2591
|
+
user: PartialUser;
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
// Classes
|
|
2595
|
+
export class AutoModerationRule<T extends AutoModerationTriggerType = AutoModerationTriggerType> extends Base {
|
|
2596
|
+
actions: AutoModerationAction[];
|
|
2597
|
+
creator: PossiblyUncachedUser;
|
|
2598
|
+
enabled: boolean;
|
|
2599
|
+
eventType: AutoModerationEventType;
|
|
2600
|
+
exemptChannels: string[];
|
|
2601
|
+
exemptRoles: string[];
|
|
2602
|
+
guild: PossiblyUncachedGuild;
|
|
2603
|
+
name: string;
|
|
2604
|
+
triggerMetadata: AutoModerationTriggerMetadata<T>;
|
|
2605
|
+
triggerType: T;
|
|
2606
|
+
constructor(data: BaseData, client: Client);
|
|
2607
|
+
delete(reason?: string): Promise<void>;
|
|
2608
|
+
edit(options: AutoModerationEditOptions<T>): Promise<AutoModerationRule<T>>;
|
|
2609
|
+
}
|
|
2610
|
+
/** Generic T is `true` if a Guild scoped command, and `false` if not */
|
|
2611
|
+
export class ApplicationCommand<T extends boolean, U = ApplicationCommandTypes> extends Base {
|
|
2612
|
+
applicationID: string;
|
|
2613
|
+
contexts?: InteractionContextTypes[] | null;
|
|
2614
|
+
defaultMemberPermissions: Permission;
|
|
2615
|
+
/** @deprecated */
|
|
2616
|
+
defaultPermission?: boolean | null;
|
|
2617
|
+
description: U extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? string : "";
|
|
2618
|
+
descriptionLocalizations?: U extends "CHAT_INPUT" ? Record<LocaleStrings, string> | null : null;
|
|
2619
|
+
/** @deprecated */
|
|
2620
|
+
dmPermission?: boolean;
|
|
2621
|
+
guild: T extends true ? PossiblyUncachedGuild : never;
|
|
2622
|
+
handler?: EntryPointCommandHandlerTypes;
|
|
2623
|
+
integrationTypes?: ApplicationIntegrationTypes[];
|
|
2624
|
+
name: string;
|
|
2625
|
+
nameLocalizations?: Record<LocaleStrings, string> | null;
|
|
2626
|
+
nsfw?: boolean;
|
|
2627
|
+
options?: ApplicationCommandOptions[];
|
|
2628
|
+
type?: U;
|
|
2629
|
+
version: string;
|
|
2630
|
+
delete(): Promise<void>;
|
|
2631
|
+
edit(options: ApplicationCommandEditOptions<T, U>): Promise<ApplicationCommand<T, U>>;
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
class Base implements SimpleJSON {
|
|
2635
|
+
createdAt: number;
|
|
2636
|
+
id: string;
|
|
2637
|
+
constructor(id: string);
|
|
2638
|
+
static getCreatedAt(id: string): number;
|
|
2639
|
+
static getDiscordEpoch(id: string): number;
|
|
2640
|
+
toString(): string;
|
|
2641
|
+
toJSON(props?: string[]): JSONCache;
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
export class BrowserWebSocket extends EventEmitter {
|
|
2645
|
+
readyState: number;
|
|
2646
|
+
constructor(url: string);
|
|
2647
|
+
close(code?: number, reason?: string): void;
|
|
2648
|
+
removeEventListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
2649
|
+
// @ts-ignore: DOM
|
|
2650
|
+
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
|
|
2651
|
+
terminate(): void;
|
|
2652
|
+
/* eslint-disable sort-class-members/sort-class-members */
|
|
2653
|
+
static CONNECTING: 0;
|
|
2654
|
+
static OPEN: 1;
|
|
2655
|
+
static CLOSING: 2;
|
|
2656
|
+
static CLOSED: 3;
|
|
2657
|
+
/* eslint-enable sort-class-members/sort-class-members */
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
export class BrowserWebSocketError extends Error {
|
|
2661
|
+
// @ts-ignore: DOM
|
|
2662
|
+
event: Event;
|
|
2663
|
+
// @ts-ignore: DOM
|
|
2664
|
+
constructor(message: string, event: Event);
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
export class Bucket {
|
|
2668
|
+
interval: number;
|
|
2669
|
+
lastReset: number;
|
|
2670
|
+
lastSend: number;
|
|
2671
|
+
tokenLimit: number;
|
|
2672
|
+
tokens: number;
|
|
2673
|
+
constructor(tokenLimit: number, interval: number, options: { latencyRef: { latency: number }; reservedTokens: number });
|
|
2674
|
+
check(): void;
|
|
2675
|
+
queue(func: () => void, priority?: boolean): void;
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
export class CategoryChannel extends GuildChannel implements Permissionable {
|
|
2679
|
+
channels: Collection<Exclude<AnyGuildChannel, CategoryChannel>>;
|
|
2680
|
+
permissionOverwrites: Collection<PermissionOverwrite>;
|
|
2681
|
+
position: number;
|
|
2682
|
+
type: Constants["ChannelTypes"]["GUILD_CATEGORY"];
|
|
2683
|
+
deletePermission(overwriteID: string, reason?: string): Promise<void>;
|
|
2684
|
+
edit(options: EditChannelOptionsBase, reason?: string): Promise<this>;
|
|
2685
|
+
editPermission(overwriteID: string, allow: PermissionValueTypes, deny: PermissionValueTypes, type: PermissionType, reason?: string): Promise<PermissionOverwrite>;
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
export class Channel extends Base {
|
|
2689
|
+
mention: string;
|
|
2690
|
+
type: ChannelTypes;
|
|
2691
|
+
constructor(data: BaseData, client: Client);
|
|
2692
|
+
static from(data: BaseData, client: Client): AnyChannel;
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
export class Client extends EventEmitter {
|
|
2696
|
+
application?: { id: string; flags: number };
|
|
2697
|
+
bot: boolean;
|
|
2698
|
+
channelGuildMap: Record<string, string>;
|
|
2699
|
+
dmChannelMap: Record<string, string>;
|
|
2700
|
+
dmChannels: Collection<DMChannel>;
|
|
2701
|
+
gatewayURL?: string;
|
|
2702
|
+
guilds: Collection<Guild>;
|
|
2703
|
+
guildShardMap: Record<string, number>;
|
|
2704
|
+
lastConnect: number;
|
|
2705
|
+
lastReconnectDelay: number;
|
|
2706
|
+
options: ClientOptions;
|
|
2707
|
+
presence: ClientPresence;
|
|
2708
|
+
/** @deprecated */
|
|
2709
|
+
privateChannelMap: Record<string, string>;
|
|
2710
|
+
/** @deprecated */
|
|
2711
|
+
privateChannels: Collection<DMChannel>;
|
|
2712
|
+
ready: boolean;
|
|
2713
|
+
reconnectAttempts: number;
|
|
2714
|
+
requestHandler: RequestHandler;
|
|
2715
|
+
shards: ShardManager;
|
|
2716
|
+
startTime: number;
|
|
2717
|
+
threadGuildMap: Record<string, string>;
|
|
2718
|
+
unavailableGuilds: Collection<UnavailableGuild>;
|
|
2719
|
+
uptime: number;
|
|
2720
|
+
user: ExtendedUser;
|
|
2721
|
+
users: Collection<User>;
|
|
2722
|
+
voiceConnections: VoiceConnectionManager;
|
|
2723
|
+
constructor(token: string, options?: ClientOptions);
|
|
2724
|
+
addGroupRecipient(groupID: string, userID: string): Promise<void>;
|
|
2725
|
+
addGuildDiscoverySubcategory(guildID: string, categoryID: string, reason?: string): Promise<DiscoverySubcategoryResponse>;
|
|
2726
|
+
addGuildMember(guildID: string, userID: string, accessToken: string, options?: AddGuildMemberOptions): Promise<void>;
|
|
2727
|
+
addGuildMemberRole(guildID: string, memberID: string, roleID: string, reason?: string): Promise<void>;
|
|
2728
|
+
addInviteTargetUser(inviteID: string, userID: string): Promise<void>;
|
|
2729
|
+
addLobbyMember(lobbyID: string, userID: string, options?: LobbyMemberOptions): Promise<LobbyMember>;
|
|
2730
|
+
addMessageReaction(channelID: string, messageID: string, reaction: string): Promise<void>;
|
|
2731
|
+
banGuildMember(guildID: string, userID: string, options?: BanMemberOptions): Promise<void>;
|
|
2732
|
+
/** @deprecated */
|
|
2733
|
+
banGuildMember(guildID: string, userID: string, deleteMessageDays?: number, reason?: string): Promise<void>;
|
|
2734
|
+
bulkAddInviteTargetUsers(inviteID: string, userIDs: string[]): Promise<void>;
|
|
2735
|
+
bulkBanGuildMembers(guildID: string, options: BulkBanMembersOptions): Promise<BulkBanMembersResponse>;
|
|
2736
|
+
bulkEditCommands(commands: ApplicationCommandBulkEditOptions<false>[]): Promise<ApplicationCommand<false>[]>;
|
|
2737
|
+
bulkEditGuildCommands(guildID: string, commands: ApplicationCommandBulkEditOptions<true>[]): Promise<ApplicationCommand<true>[]>;
|
|
2738
|
+
bulkEditLobbyMembers(lobbyID: string, members: BulkEditLobbyMemberOptions[]): Promise<LobbyMember[]>;
|
|
2739
|
+
bulkRemoveInviteTargetUsers(inviteID: string, userIDs: string[]): Promise<void>;
|
|
2740
|
+
closeVoiceConnection(guildID: string): void;
|
|
2741
|
+
connect(): Promise<void>;
|
|
2742
|
+
consumeEntitlement(entitlementID: string): Promise<void>;
|
|
2743
|
+
createAutoModerationRule(guildID: string, rule: AutoModerationCreateOptions): Promise<AutoModerationRule>;
|
|
2744
|
+
createChannel(guildID: string, name: string): Promise<TextChannel>;
|
|
2745
|
+
createChannel<T extends GuildChannelTypes>(guildID: string, name: string, type: T, options?: CreateChannelOptions): Promise<ChannelTypeConversion<T>>;
|
|
2746
|
+
/** @deprecated */
|
|
2747
|
+
createChannel<T extends GuildChannelTypes>(guildID: string, name: string, type: T, options?: CreateChannelOptions | string): Promise<ChannelTypeConversion<T>>;
|
|
2748
|
+
createChannelInvite(
|
|
2749
|
+
channelID: string,
|
|
2750
|
+
options?: CreateChannelInviteOptions,
|
|
2751
|
+
reason?: string
|
|
2752
|
+
): Promise<Invite<"withoutCount">>;
|
|
2753
|
+
createChannelWebhook(
|
|
2754
|
+
channelID: string,
|
|
2755
|
+
options: WebhookCreateOptions,
|
|
2756
|
+
reason?: string
|
|
2757
|
+
): Promise<Webhook>;
|
|
2758
|
+
createCommand<T extends ApplicationCommandTypes>(command: ApplicationCommandCreateOptions<false, T>): Promise<ApplicationCommand<false, T>>;
|
|
2759
|
+
createEmoji(options: ApplicationEmojiOptions): Promise<Emoji>;
|
|
2760
|
+
createGroupChannel(userIDs: string[]): Promise<GroupChannel>;
|
|
2761
|
+
createGuildCommand<T extends ApplicationCommandTypes>(guildID: string, command: ApplicationCommandCreateOptions<true, T>): Promise<ApplicationCommand<true, T>>;
|
|
2762
|
+
createGuildEmoji(guildID: string, options: EmojiOptions, reason?: string): Promise<Emoji>;
|
|
2763
|
+
createGuildScheduledEvent<T extends GuildScheduledEventEntityTypes>(guildID: string, event: GuildScheduledEventOptions<T>, reason?: string): Promise<GuildScheduledEvent<T>>;
|
|
2764
|
+
createGuildSoundboardSound(guildID: string, sound: GuildSoundboardSoundCreate, reason?: string): Promise<SoundboardSound>;
|
|
2765
|
+
createGuildSticker(guildID: string, options: CreateStickerOptions, reason?: string): Promise<Sticker>;
|
|
2766
|
+
createGuildTemplate(guildID: string, name: string, description?: string | null): Promise<GuildTemplate>;
|
|
2767
|
+
createInteractionResponse(interactionID: string, interactionToken: string, options: InteractionOptions & { withResponse: true }, file?: FileContent | FileContent[]): Promise<InteractionCallbackResponse>;
|
|
2768
|
+
createInteractionResponse(interactionID: string, interactionToken: string, options: InteractionOptions, file?: FileContent | FileContent[]): Promise<void>;
|
|
2769
|
+
createLobby(options?: LobbyOptions): Promise<Lobby>;
|
|
2770
|
+
createLobbyChannelInvite(lobbyID: string, userID: string): Promise<LobbyInvite>;
|
|
2771
|
+
createMessage(channelID: string, content: MessageContent, file?: FileContent | FileContent[]): Promise<Message>;
|
|
2772
|
+
createRole(guildID: string, options?: Role | RoleOptions, reason?: string): Promise<Role>;
|
|
2773
|
+
createStageInstance(channelID: string, options: StageInstanceOptions): Promise<StageInstance>;
|
|
2774
|
+
createTestEntitlement(options: CreateTestEntitlementOptions): Promise<Entitlement>;
|
|
2775
|
+
createThread(channelID: string, options: CreateForumThreadOptions, file?: FileContent | FileContent[]): Promise<PublicThreadChannel<true>>;
|
|
2776
|
+
createThread(channelID: string, options: CreateThreadWithoutMessageOptions, file?: FileContent | FileContent[]): Promise<NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel>;
|
|
2777
|
+
createThreadWithMessage(channelID: string, messageID: string, options: CreateThreadOptions): Promise<NewsThreadChannel | PublicThreadChannel>;
|
|
2778
|
+
/** @deprecated */
|
|
2779
|
+
createThreadWithoutMessage(channelID: string, options: CreateThreadWithoutMessageOptions): Promise<NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel>;
|
|
2780
|
+
crosspostMessage(channelID: string, messageID: string): Promise<Message>;
|
|
2781
|
+
deleteApplicationIdentity(userID: string, providerType: string, providerIssuedUserID: string, providerID?: string): Promise<void>;
|
|
2782
|
+
deleteAutoModerationRule(guildID: string, ruleID: string, reason?: string): Promise<void>;
|
|
2783
|
+
deleteChannel(channelID: string, reason?: string): Promise<void>;
|
|
2784
|
+
deleteChannelPermission(channelID: string, overwriteID: string, reason?: string): Promise<void>;
|
|
2785
|
+
deleteCommand(commandID: string): Promise<void>;
|
|
2786
|
+
deleteEmoji(emojiID: string): Promise<void>;
|
|
2787
|
+
deleteGuildCommand(guildID: string, commandID: string): Promise<void>;
|
|
2788
|
+
deleteGuildDiscoverySubcategory(guildID: string, categoryID: string, reason?: string): Promise<void>;
|
|
2789
|
+
deleteGuildEmoji(guildID: string, emojiID: string, reason?: string): Promise<void>;
|
|
2790
|
+
deleteGuildIntegration(guildID: string, integrationID: string): Promise<void>;
|
|
2791
|
+
deleteGuildScheduledEvent(guildID: string, eventID: string): Promise<void>;
|
|
2792
|
+
deleteGuildSoundboardSound(guildID: string, soundID: string, reason?: string): Promise<void>;
|
|
2793
|
+
deleteGuildSticker(guildID: string, stickerID: string, reason?: string): Promise<void>;
|
|
2794
|
+
deleteGuildTemplate(guildID: string, code: string): Promise<GuildTemplate>;
|
|
2795
|
+
deleteInvite(inviteID: string, reason?: string): Promise<void>;
|
|
2796
|
+
deleteLobby(lobbyID: string): Promise<void>;
|
|
2797
|
+
deleteMessage(channelID: string, messageID: string, reason?: string): Promise<void>;
|
|
2798
|
+
deleteMessages(channelID: string, messageIDs: string[], reason?: string): Promise<void>;
|
|
2799
|
+
deleteRole(guildID: string, roleID: string, reason?: string): Promise<void>;
|
|
2800
|
+
deleteStageInstance(channelID: string): Promise<void>;
|
|
2801
|
+
deleteTestEntitlement(entitlementID: string): Promise<void>;
|
|
2802
|
+
deleteWebhook(webhookID: string, token?: string, reason?: string): Promise<void>;
|
|
2803
|
+
deleteWebhookMessage(webhookID: string, token: string, messageID: string): Promise<void>;
|
|
2804
|
+
disconnect(options: { reconnect?: boolean | "auto" }): void;
|
|
2805
|
+
editAFK(afk: boolean): void;
|
|
2806
|
+
editApplicationIdentityProfile(userID: string, providerIssuedUserID: string, options: EditApplicationIdentityProfileOptions): Promise<ApplicationIdentityProfile | undefined>;
|
|
2807
|
+
editAutoModerationRule<T extends AutoModerationTriggerType>(guildID: string, ruleID: string, options: AutoModerationEditOptions<T>): Promise<AutoModerationRule>;
|
|
2808
|
+
editChannel(
|
|
2809
|
+
channelID: string,
|
|
2810
|
+
options: EditGuildChannelOptions | EditGroupChannelOptions,
|
|
2811
|
+
reason?: string
|
|
2812
|
+
): Promise<GroupChannel | AnyGuildChannel>;
|
|
2813
|
+
editChannelPermission(
|
|
2814
|
+
channelID: string,
|
|
2815
|
+
overwriteID: string,
|
|
2816
|
+
allow: bigint | number,
|
|
2817
|
+
deny: bigint | number,
|
|
2818
|
+
type: PermissionType,
|
|
2819
|
+
reason?: string
|
|
2820
|
+
): Promise<void>;
|
|
2821
|
+
editChannelPosition(channelID: string, position: number, options?: EditChannelPositionOptions): Promise<void>;
|
|
2822
|
+
editChannelPositions(guildID: string, channelPositions: ChannelPosition[]): Promise<void>;
|
|
2823
|
+
editCommand<T extends ApplicationCommandTypes>(commandID: string, command: ApplicationCommandEditOptions<false, T>): Promise<ApplicationCommand<false, T>>;
|
|
2824
|
+
editCommandPermissions(guildID: string, commandID: string, permissions: ApplicationCommandPermissions[], reason?: string): Promise<GuildApplicationCommandPermissions>;
|
|
2825
|
+
editCurrentApplication(options: EditApplicationOptions): Promise<OAuthApplicationInfo>;
|
|
2826
|
+
editEmoji(emojiID: string, options: EditApplicationEmojiOptions): Promise<Emoji>;
|
|
2827
|
+
editGuild(guildID: string, options: GuildOptions, reason?: string): Promise<Guild>;
|
|
2828
|
+
editGuildCommand<T extends ApplicationCommandTypes>(guildID: string, commandID: string, command: ApplicationCommandEditOptions<true, T>): Promise<ApplicationCommand<true, T>>;
|
|
2829
|
+
editGuildDiscovery(guildID: string, options?: DiscoveryOptions): Promise<DiscoveryMetadata>;
|
|
2830
|
+
editGuildEmoji(
|
|
2831
|
+
guildID: string,
|
|
2832
|
+
emojiID: string,
|
|
2833
|
+
options: { name?: string; roles?: string[] },
|
|
2834
|
+
reason?: string
|
|
2835
|
+
): Promise<Emoji>;
|
|
2836
|
+
editGuildIncidentActions(guildID: string, options: EditGuildIncidentDataOptions): Promise<GuildIncidentData>;
|
|
2837
|
+
editGuildMember(guildID: string, memberID: string, options: MemberOptions, reason?: string): Promise<Member>;
|
|
2838
|
+
editGuildOnboarding(guildID: string, options: GuildOnboardingOptions, reason?: string): Promise<GuildOnboarding>;
|
|
2839
|
+
editGuildScheduledEvent<T extends GuildScheduledEventEntityTypes>(guildID: string, eventID: string, event: GuildScheduledEventEditOptions<T>, reason?: string): Promise<GuildScheduledEvent<T>>;
|
|
2840
|
+
editGuildSoundboardSound(guildID: string, soundID: string, options: GuildSoundboardSoundEdit): Promise<SoundboardSound>;
|
|
2841
|
+
editGuildSticker(guildID: string, stickerID: string, options?: EditStickerOptions, reason?: string): Promise<Sticker>;
|
|
2842
|
+
editGuildTemplate(guildID: string, code: string, options: GuildTemplateOptions): Promise<GuildTemplate>;
|
|
2843
|
+
editGuildVanity(guildID: string, code: string | null): Promise<GuildVanity>;
|
|
2844
|
+
editGuildVoiceState(guildID: string, options: VoiceStateOptions, userID?: string): Promise<void>;
|
|
2845
|
+
editGuildWelcomeScreen(guildID: string, options: WelcomeScreenOptions): Promise<WelcomeScreen>;
|
|
2846
|
+
editGuildWidget(guildID: string, options: WidgetOptions): Promise<Widget>;
|
|
2847
|
+
editInviteTargetUsers(inviteID: string, targetUsers: string[] | Buffer): Promise<void>;
|
|
2848
|
+
editLobby(lobbyID: string, options: LobbyOptions): Promise<Lobby>;
|
|
2849
|
+
editLobbyMessageModerationMetadata(lobbyID: string, messageID: string, metadata: Record<string, string>): Promise<void>;
|
|
2850
|
+
editMessage(channelID: string, messageID: string, content: MessageContentEdit): Promise<Message>;
|
|
2851
|
+
/** @deprecated */
|
|
2852
|
+
editNickname(guildID: string, nick: string, reason?: string): Promise<void>;
|
|
2853
|
+
editRole(guildID: string, roleID: string, options: RoleOptions, reason?: string): Promise<Role>; // TODO not all options are available?
|
|
2854
|
+
editRoleConnectionMetadataRecords(data: ApplicationRoleConnectionMetadata[]): Promise<ApplicationRoleConnectionMetadata[]>;
|
|
2855
|
+
editRolePosition(guildID: string, roleID: string, position: number): Promise<void>;
|
|
2856
|
+
editSelf(options: EditSelfOptions): Promise<ExtendedUser>;
|
|
2857
|
+
editStageInstance(channelID: string, options: StageInstanceOptions): Promise<StageInstance>;
|
|
2858
|
+
editStatus(status: SelfStatus, activities?: ActivityPartial<ActivityType>[] | ActivityPartial<ActivityType>): void;
|
|
2859
|
+
editStatus(activities?: ActivityPartial<ActivityType>[] | ActivityPartial<ActivityType>): void;
|
|
2860
|
+
editWebhook(
|
|
2861
|
+
webhookID: string,
|
|
2862
|
+
options: WebhookEditOptions,
|
|
2863
|
+
token?: string,
|
|
2864
|
+
reason?: string
|
|
2865
|
+
): Promise<Webhook>;
|
|
2866
|
+
editWebhookMessage(
|
|
2867
|
+
webhookID: string,
|
|
2868
|
+
token: string,
|
|
2869
|
+
messageID: string,
|
|
2870
|
+
options: WebhookPayloadEdit
|
|
2871
|
+
): Promise<Message<AnyGuildTextableChannel>>;
|
|
2872
|
+
emit<K extends keyof ClientEvents>(event: K, ...args: ClientEvents[K]): boolean;
|
|
2873
|
+
emit(event: string, ...args: any[]): boolean;
|
|
2874
|
+
endPoll(channelID: string, messageID: string): Promise<Message<AnyGuildTextableChannel>>;
|
|
2875
|
+
executeGitHubWebhook(webhookID: string, token: string, event: string, payload: Record<string, unknown>, options?: { auth?: boolean; threadID?: string; wait?: boolean }): Promise<void>;
|
|
2876
|
+
executeSlackWebhook(webhookID: string, token: string, options: Record<string, unknown> & { auth?: boolean; threadID?: string }): Promise<void>;
|
|
2877
|
+
executeSlackWebhook(webhookID: string, token: string, options: Record<string, unknown> & { auth?: boolean; threadID?: string; wait: true }): Promise<Message<AnyGuildTextableChannel>>;
|
|
2878
|
+
executeWebhook(webhookID: string, token: string, options: WebhookPayload & { wait: true }): Promise<Message<AnyGuildTextableChannel>>;
|
|
2879
|
+
executeWebhook(webhookID: string, token: string, options: WebhookPayload): Promise<void>;
|
|
2880
|
+
followChannel(channelID: string, webhookChannelID: string, reason?: string): Promise<ChannelFollow>;
|
|
2881
|
+
getActiveGuildThreads(guildID: string): Promise<ListedGuildThreads>;
|
|
2882
|
+
getApplicationActivityInstance(instanceID: string): Promise<ApplicationActivityInstance>;
|
|
2883
|
+
getApplicationIdentityProfile(userID: string, providerIssuedUserID: string): Promise<ApplicationIdentityProfile>;
|
|
2884
|
+
getArchivedThreads(channelID: string, type: "private", options?: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PrivateThreadChannel>>;
|
|
2885
|
+
getArchivedThreads(channelID: string, type: "public", options?: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PublicThreadChannel<boolean>>>;
|
|
2886
|
+
getAutoModerationRule(guildID: string, ruleID: string): Promise<AutoModerationRule>;
|
|
2887
|
+
getAutoModerationRules(guildID: string): Promise<AutoModerationRule[]>;
|
|
2888
|
+
getBotGateway(): Promise<{ session_start_limit: { max_concurrency: number; remaining: number; reset_after: number; total: number }; shards: number; url: string }>;
|
|
2889
|
+
getChannel(channelID: string): Exclude<AnyChannel, GroupChannel>;
|
|
2890
|
+
getChannelInvites(channelID: string): Promise<Invite[]>;
|
|
2891
|
+
getChannelMemberPermissions(channelID: string, memberID: string, implicit?: boolean): Promise<Permission>;
|
|
2892
|
+
getChannelRolePermissions(channelID: string, roleID: string, implicit?: boolean): Promise<Permission>;
|
|
2893
|
+
getChannelWebhooks(channelID: string): Promise<Webhook[]>;
|
|
2894
|
+
getCommand(commandID: string): Promise<ApplicationCommand<false>>;
|
|
2895
|
+
getCommandPermissions(guildID: string, commandID: string): Promise<GuildApplicationCommandPermissions>;
|
|
2896
|
+
getCommands(withLocalizations?: boolean): Promise<ApplicationCommand<false>[]>;
|
|
2897
|
+
getCurrentApplication(): Promise<OAuthApplicationInfo>;
|
|
2898
|
+
getDiscoveryCategories(): Promise<DiscoveryCategory[]>;
|
|
2899
|
+
getDMChannel(userID: string): Promise<DMChannel>;
|
|
2900
|
+
getEmoji(emojiID: string): Promise<Emoji>;
|
|
2901
|
+
getEmojiGuild(emojiID: string): Promise<Guild>;
|
|
2902
|
+
getEmojis(): Promise<ApplicationEmojis>;
|
|
2903
|
+
getEntitlement(entitlementID: string): Promise<Entitlement>;
|
|
2904
|
+
getEntitlements(options?: GetEntitlementsOptions): Promise<Entitlement[]>;
|
|
2905
|
+
getExternalApplicationIdentities(providerType: string, providerIssuedUserID: string, providerID?: string): Promise<ApplicationIdentity[]>;
|
|
2906
|
+
getGateway(): Promise<{ url: string }>;
|
|
2907
|
+
getGuildAuditLog(guildID: string, options?: GetGuildAuditLogOptions): Promise<GuildAuditLog>;
|
|
2908
|
+
/** @deprecated */
|
|
2909
|
+
getGuildAuditLogs(guildID: string, limit?: number, before?: string, actionType?: number, userID?: string): Promise<GuildAuditLog>;
|
|
2910
|
+
getGuildBan(guildID: string, userID: string): Promise<GuildBan>;
|
|
2911
|
+
getGuildBans(guildID: string, options?: GetGuildBansOptions): Promise<GuildBan[]>;
|
|
2912
|
+
getGuildCommand(guildID: string, commandID: string): Promise<ApplicationCommand<true>>;
|
|
2913
|
+
getGuildCommandPermissions(guildID: string): Promise<GuildApplicationCommandPermissions[]>;
|
|
2914
|
+
getGuildCommands(guildID: string, withLocalizations?: boolean): Promise<ApplicationCommand<true>[]>;
|
|
2915
|
+
getGuildDiscovery(guildID: string): Promise<DiscoveryMetadata>;
|
|
2916
|
+
/** @deprecated */
|
|
2917
|
+
getGuildEmbed(guildID: string): Promise<Widget>;
|
|
2918
|
+
getGuildIntegrations(guildID: string): Promise<GuildIntegration[]>;
|
|
2919
|
+
getGuildInvites(guildID: string): Promise<Invite[]>;
|
|
2920
|
+
getGuildMemberPermissions(guildID: string, memberID: string): Promise<Permission>;
|
|
2921
|
+
getGuildOnboarding(guildID: string): Promise<GuildOnboarding>;
|
|
2922
|
+
getGuildPreview(guildID: string): Promise<GuildPreview>;
|
|
2923
|
+
getGuildRoleMemberCounts(guildID: string): Promise<Record<string, number>>;
|
|
2924
|
+
getGuildRolePermissions(guildID: string, roleID: string): Promise<Permission>;
|
|
2925
|
+
getGuildScheduledEvents(guildID: string, options?: GetGuildScheduledEventOptions): Promise<GuildScheduledEvent[]>;
|
|
2926
|
+
getGuildScheduledEventUsers(guildID: string, eventID: string, options?: GetGuildScheduledEventUsersOptions): Promise<GuildScheduledEventUser[]>;
|
|
2927
|
+
getGuildSoundboardSound(guildID: string, soundID: string): Promise<SoundboardSound>;
|
|
2928
|
+
getGuildSoundboardSounds(guildID: string): Promise<SoundboardSound[]>;
|
|
2929
|
+
getGuildTemplate(code: string): Promise<GuildTemplate>;
|
|
2930
|
+
getGuildTemplates(guildID: string): Promise<GuildTemplate[]>;
|
|
2931
|
+
getGuildVanity(guildID: string): Promise<GuildVanity>;
|
|
2932
|
+
getGuildVoiceState(guildID: string, userID: string): Promise<VoiceState>;
|
|
2933
|
+
getGuildWebhooks(guildID: string): Promise<Webhook[]>;
|
|
2934
|
+
getGuildWelcomeScreen(guildID: string): Promise<WelcomeScreen>;
|
|
2935
|
+
getGuildWidget(guildID: string): Promise<WidgetData>;
|
|
2936
|
+
getGuildWidgetImageURL(guildID: string, style?: GuildWidgetStyles): string;
|
|
2937
|
+
getGuildWidgetSettings(guildID: string): Promise<Widget>;
|
|
2938
|
+
/** @deprecated */
|
|
2939
|
+
getInvite(inviteID: string, withCounts?: false, withExpiration?: boolean, guildScheduledEventID?: string): Promise<Invite<"withoutCount">>;
|
|
2940
|
+
/** @deprecated */
|
|
2941
|
+
getInvite(inviteID: string, withCounts: true, withExpiration?: boolean, guildScheduledEventID?: string): Promise<Invite<"withCount">>;
|
|
2942
|
+
getInvite(inviteID: string, withCounts?: false, guildScheduledEventID?: string): Promise<Invite<"withoutCount">>;
|
|
2943
|
+
getInvite(inviteID: string, withCounts: true, guildScheduledEventID?: string): Promise<Invite<"withCount">>;
|
|
2944
|
+
getInviteTargetUsers(inviteID: string): Promise<string[]>;
|
|
2945
|
+
getInviteTargetUsersJobStatus(inviteID: string): Promise<InviteTargetUsersJob>;
|
|
2946
|
+
getJoinedPrivateArchivedThreads(channelID: string, options?: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PrivateThreadChannel>>;
|
|
2947
|
+
getLobby(lobbyID: string): Promise<Lobby>;
|
|
2948
|
+
getMessage(channelID: string, messageID: string): Promise<Message>;
|
|
2949
|
+
getMessageReaction(channelID: string, messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise<User[]>;
|
|
2950
|
+
/** @deprecated */
|
|
2951
|
+
getMessageReaction(channelID: string, messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise<User[]>;
|
|
2952
|
+
getMessages(channelID: string, options?: GetMessagesOptions): Promise<Message[]>;
|
|
2953
|
+
/** @deprecated */
|
|
2954
|
+
getMessages(channelID: string, limit?: number, before?: string, after?: string, around?: string): Promise<Message[]>;
|
|
2955
|
+
/** @deprecated */
|
|
2956
|
+
getNitroStickerPacks(): Promise<{ sticker_packs: StickerPack[] }>;
|
|
2957
|
+
getOAuthApplication(): Promise<OAuthApplicationInfo>;
|
|
2958
|
+
/** @deprecated */
|
|
2959
|
+
getPins(channelID: string): Promise<Message[]>;
|
|
2960
|
+
getPins(channelID: string, options?: GetPinsOptions): Promise<GetPinsResponse>;
|
|
2961
|
+
getPollAnswerVoters(channelID: string, messageID: string, answerID: string, options?: GetPollAnswerVotersOptions): Promise<User[]>;
|
|
2962
|
+
getPruneCount(guildID: string, options?: GetPruneOptions): Promise<number>;
|
|
2963
|
+
getRESTChannel(channelID: string): Promise<AnyChannel>;
|
|
2964
|
+
getRESTGuild(guildID: string, withCounts?: boolean): Promise<Guild>;
|
|
2965
|
+
getRESTGuildChannels(guildID: string): Promise<AnyGuildChannel[]>;
|
|
2966
|
+
getRESTGuildEmoji(guildID: string, emojiID: string): Promise<Emoji>;
|
|
2967
|
+
getRESTGuildEmojis(guildID: string): Promise<Emoji[]>;
|
|
2968
|
+
getRESTGuildMember(guildID: string, memberID: string): Promise<Member>;
|
|
2969
|
+
getRESTGuildMembers(guildID: string, options?: GetRESTGuildMembersOptions): Promise<Member[]>;
|
|
2970
|
+
/** @deprecated */
|
|
2971
|
+
getRESTGuildMembers(guildID: string, limit?: number, after?: string): Promise<Member[]>;
|
|
2972
|
+
getRESTGuildRole(guildID: string, roleID: string): Promise<Role>;
|
|
2973
|
+
getRESTGuildRoles(guildID: string): Promise<Role[]>;
|
|
2974
|
+
getRESTGuilds(options?: GetRESTGuildsOptions): Promise<Guild[]>;
|
|
2975
|
+
/** @deprecated */
|
|
2976
|
+
getRESTGuilds(limit?: number, before?: string, after?: string): Promise<Guild[]>;
|
|
2977
|
+
getRESTGuildScheduledEvent(guildID: string, eventID: string, options?: GetGuildScheduledEventOptions): Promise<GuildScheduledEvent>;
|
|
2978
|
+
getRESTGuildSticker(guildID: string, stickerID: string): Promise<Sticker>;
|
|
2979
|
+
getRESTGuildStickers(guildID: string): Promise<Sticker[]>;
|
|
2980
|
+
getRESTSticker(stickerID: string): Promise<Sticker>;
|
|
2981
|
+
getRESTUser(userID: string): Promise<User>;
|
|
2982
|
+
getRoleConnectionMetadataRecords(): Promise<ApplicationRoleConnectionMetadata[]>;
|
|
2983
|
+
getSelf(): Promise<ExtendedUser>;
|
|
2984
|
+
getSKUs(): Promise<SKU[]>;
|
|
2985
|
+
getSKUSubscription(skuID: string, subscriptionID: string): Promise<Subscription>;
|
|
2986
|
+
getSKUSubscriptions(skuID: string, options: GetSKUSubscriptionsOptions): Promise<Subscription[]>;
|
|
2987
|
+
getSoundboardSounds(): Promise<SoundboardSound<false>[]>;
|
|
2988
|
+
getStageInstance(channelID: string): Promise<StageInstance>;
|
|
2989
|
+
getStickerPack(packID: string): Promise<StickerPack>;
|
|
2990
|
+
getStickerPacks(): Promise<{ sticker_packs: StickerPack[] }>;
|
|
2991
|
+
getThreadMember(channelID: string, userID: string, withMember?: boolean): Promise<ThreadMember>;
|
|
2992
|
+
getThreadMembers(channelID: string, options?: GetThreadMembersOptions): Promise<ThreadMember[]>;
|
|
2993
|
+
getUserApplicationIdentities(userID: string): Promise<ApplicationIdentity[]>;
|
|
2994
|
+
getVoiceRegions(guildID?: string): Promise<VoiceRegion[]>;
|
|
2995
|
+
getWebhook(webhookID: string, token?: string): Promise<Webhook>;
|
|
2996
|
+
getWebhookMessage(webhookID: string, token: string, messageID: string): Promise<Message<AnyGuildTextableChannel>>;
|
|
2997
|
+
joinThread(channelID: string, userID?: string): Promise<void>;
|
|
2998
|
+
joinVoiceChannel(channelID: string, options?: JoinVoiceChannelOptions): Promise<VoiceConnection>;
|
|
2999
|
+
kickGuildMember(guildID: string, userID: string, reason?: string): Promise<void>;
|
|
3000
|
+
leaveGuild(guildID: string): Promise<void>;
|
|
3001
|
+
leaveThread(channelID: string, userID?: string): Promise<void>;
|
|
3002
|
+
leaveVoiceChannel(channelID: string): void;
|
|
3003
|
+
off<K extends keyof ClientEvents>(event: K, listener: (...args: ClientEvents[K]) => void): this;
|
|
3004
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
3005
|
+
once<K extends keyof ClientEvents>(event: K, listener: (...args: ClientEvents[K]) => void): this;
|
|
3006
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
3007
|
+
pinMessage(channelID: string, messageID: string): Promise<void>;
|
|
3008
|
+
pruneMembers(guildID: string, options?: PruneMemberOptions): Promise<number>;
|
|
3009
|
+
purgeChannel(channelID: string, options: PurgeChannelOptions): Promise<number>;
|
|
3010
|
+
/** @deprecated */
|
|
3011
|
+
purgeChannel(
|
|
3012
|
+
channelID: string,
|
|
3013
|
+
limit?: number,
|
|
3014
|
+
filter?: (m: Message<AnyGuildTextableChannel>) => boolean,
|
|
3015
|
+
before?: string,
|
|
3016
|
+
after?: string,
|
|
3017
|
+
reason?: string
|
|
3018
|
+
): Promise<number>;
|
|
3019
|
+
removeGroupRecipient(groupID: string, userID: string): Promise<void>;
|
|
3020
|
+
removeGuildMemberRole(guildID: string, memberID: string, roleID: string, reason?: string): Promise<void>;
|
|
3021
|
+
removeInviteTargetUser(inviteID: string, userID: string): Promise<void>;
|
|
3022
|
+
removeLobbyMember(lobbyID: string, userID: string): Promise<void>;
|
|
3023
|
+
removeMessageReaction(channelID: string, messageID: string, reaction: string, userID?: string): Promise<void>;
|
|
3024
|
+
removeMessageReactionEmoji(channelID: string, messageID: string, reaction: string): Promise<void>;
|
|
3025
|
+
removeMessageReactions(channelID: string, messageID: string): Promise<void>;
|
|
3026
|
+
searchGuildMembers(guildID: string, query: string, limit?: number): Promise<Member[]>;
|
|
3027
|
+
searchGuildMessages(guildID: string, options?: SearchGuildMessagesOptions): Promise<SearchGuildMessagesResult>;
|
|
3028
|
+
sendChannelTyping(channelID: string): Promise<void>;
|
|
3029
|
+
sendSoundboardSound(channelID: string, options: GuildSoundboardSoundSend): Promise<void>;
|
|
3030
|
+
setVoiceChannelStatus(channelID: string, status: string, reason?: string): Promise<void>;
|
|
3031
|
+
syncGuildIntegration(guildID: string, integrationID: string): Promise<void>;
|
|
3032
|
+
syncGuildTemplate(guildID: string, code: string): Promise<GuildTemplate>;
|
|
3033
|
+
unbanGuildMember(guildID: string, userID: string, reason?: string): Promise<void>;
|
|
3034
|
+
unpinMessage(channelID: string, messageID: string): Promise<void>;
|
|
3035
|
+
validateDiscoverySearchTerm(term: string): Promise<{ valid: boolean }>;
|
|
3036
|
+
on<K extends keyof ClientEvents>(event: K, listener: (...args: ClientEvents[K]) => void): this;
|
|
3037
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
3038
|
+
toString(): string;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
export class Collection<T extends { id: string | number }> extends Map<string | number, T> {
|
|
3042
|
+
baseObject: new (...args: any[]) => T;
|
|
3043
|
+
limit?: number;
|
|
3044
|
+
constructor(baseObject: new (...args: any[]) => T, limit?: number);
|
|
3045
|
+
update(obj: T, extra?: unknown, replace?: boolean): T;
|
|
3046
|
+
add(obj: T, extra?: unknown, replace?: boolean): T;
|
|
3047
|
+
every(func: (i: T) => boolean): boolean;
|
|
3048
|
+
filter(func: (i: T) => boolean): T[];
|
|
3049
|
+
find(func: (i: T) => boolean): T | undefined;
|
|
3050
|
+
map<R>(func: (i: T) => R): R[];
|
|
3051
|
+
random(): T | undefined;
|
|
3052
|
+
reduce<U>(func: (accumulator: U, val: T) => U, initialValue?: U): U;
|
|
3053
|
+
remove(obj: T | Uncached): T | null;
|
|
3054
|
+
some(func: (i: T) => boolean): boolean;
|
|
3055
|
+
}
|
|
3056
|
+
|
|
3057
|
+
export class Command implements CommandOptions, SimpleJSON {
|
|
3058
|
+
aliases: string[];
|
|
3059
|
+
argsRequired: boolean;
|
|
3060
|
+
caseInsensitive: boolean;
|
|
3061
|
+
cooldown: number;
|
|
3062
|
+
cooldownExclusions: CommandCooldownExclusions;
|
|
3063
|
+
cooldownMessage: MessageContent | false | GenericCheckFunction<MessageContent>;
|
|
3064
|
+
cooldownReturns: number;
|
|
3065
|
+
defaultSubcommandOptions: CommandOptions;
|
|
3066
|
+
deleteCommand: boolean;
|
|
3067
|
+
description: string;
|
|
3068
|
+
dmOnly: boolean;
|
|
3069
|
+
errorMessage: MessageContent | GenericCheckFunction<MessageContent>;
|
|
3070
|
+
fullDescription: string;
|
|
3071
|
+
fullLabel: string;
|
|
3072
|
+
guildOnly: boolean;
|
|
3073
|
+
hidden: boolean;
|
|
3074
|
+
hooks: Hooks;
|
|
3075
|
+
invalidUsageMessage: MessageContent | false | GenericCheckFunction<MessageContent>;
|
|
3076
|
+
label: string;
|
|
3077
|
+
parentCommand?: Command;
|
|
3078
|
+
permissionMessage: MessageContent | false | GenericCheckFunction<MessageContent>;
|
|
3079
|
+
reactionButtons: null | CommandReactionButtons[];
|
|
3080
|
+
reactionButtonTimeout: number;
|
|
3081
|
+
requirements: CommandRequirements;
|
|
3082
|
+
restartCooldown: boolean;
|
|
3083
|
+
subcommandAliases: Record<string, string>;
|
|
3084
|
+
subcommands: Record<string, Command>;
|
|
3085
|
+
usage: string;
|
|
3086
|
+
constructor(label: string, generate: CommandGenerator, options?: CommandOptions);
|
|
3087
|
+
cooldownCheck(msg: Message): boolean;
|
|
3088
|
+
cooldownExclusionCheck(msg: Message): boolean;
|
|
3089
|
+
executeCommand(msg: Message, args: string[]): Promise<GeneratorFunctionReturn>;
|
|
3090
|
+
permissionCheck(msg: Message): Promise<boolean>;
|
|
3091
|
+
process(args: string[], msg: Message): Promise<void | GeneratorFunctionReturn>;
|
|
3092
|
+
registerSubcommand(label: string, generator: CommandGenerator, options?: CommandOptions): Command;
|
|
3093
|
+
registerSubcommandAlias(alias: string, label: string): void;
|
|
3094
|
+
unregisterSubcommand(label: string): void;
|
|
3095
|
+
toString(): string;
|
|
3096
|
+
toJSON(props?: string[]): JSONCache;
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
export class CommandClient extends Client {
|
|
3100
|
+
activeMessages: Record<string, ActiveMessages>;
|
|
3101
|
+
commandAliases: Record<string, string>;
|
|
3102
|
+
commandOptions: CommandClientOptions;
|
|
3103
|
+
commands: Record<string, Command>;
|
|
3104
|
+
guildPrefixes: Record<string, string | string[]>;
|
|
3105
|
+
preReady?: true;
|
|
3106
|
+
constructor(token: string, options: ClientOptions, commandOptions?: CommandClientOptions);
|
|
3107
|
+
checkPrefix(msg: Message): string;
|
|
3108
|
+
onMessageCreate(msg: Message): Promise<void>;
|
|
3109
|
+
onMessageReactionEvent(msg: Message, emoji: Emoji, reactor: Member | Uncached | string): Promise<void>;
|
|
3110
|
+
registerCommand(label: string, generator: CommandGenerator, options?: CommandOptions): Command;
|
|
3111
|
+
registerCommandAlias(alias: string, label: string): void;
|
|
3112
|
+
registerGuildPrefix(guildID: string, prefix: string[] | string): void;
|
|
3113
|
+
resolveCommand(label: string): Command;
|
|
3114
|
+
unregisterCommand(label: string): void;
|
|
3115
|
+
unwatchMessage(id: string, channelID: string): void;
|
|
3116
|
+
toString(): string;
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
export class DiscordHTTPError extends Error {
|
|
3120
|
+
code: number;
|
|
3121
|
+
headers: IncomingHttpHeaders;
|
|
3122
|
+
name: "DiscordHTTPError";
|
|
3123
|
+
req: ClientRequest;
|
|
3124
|
+
res: IncomingMessage;
|
|
3125
|
+
response: HTTPResponse;
|
|
3126
|
+
constructor(req: ClientRequest, res: IncomingMessage, response: HTTPResponse, stack: string);
|
|
3127
|
+
flattenErrors(errors: HTTPResponse, keyPrefix?: string): string[];
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
export class DiscordRESTError extends Error {
|
|
3131
|
+
code: number;
|
|
3132
|
+
headers: IncomingHttpHeaders;
|
|
3133
|
+
name: string;
|
|
3134
|
+
req: ClientRequest;
|
|
3135
|
+
res: IncomingMessage;
|
|
3136
|
+
response: HTTPResponse;
|
|
3137
|
+
constructor(req: ClientRequest, res: IncomingMessage, response: HTTPResponse, stack: string);
|
|
3138
|
+
flattenErrors(errors: HTTPResponse, keyPrefix?: string): string[];
|
|
3139
|
+
}
|
|
3140
|
+
|
|
3141
|
+
export class DMChannel extends Channel implements Pinnable {
|
|
3142
|
+
lastMessageID: string | null;
|
|
3143
|
+
lastPinTimestamp: number | null;
|
|
3144
|
+
messages: Collection<Message<this>>;
|
|
3145
|
+
recipients: Collection<User>;
|
|
3146
|
+
type: Constants["ChannelTypes"]["DM"];
|
|
3147
|
+
constructor(data: BaseData, client: Client);
|
|
3148
|
+
addMessageReaction(messageID: string, reaction: string): Promise<void>;
|
|
3149
|
+
createMessage(content: MessageContent, file?: FileContent | FileContent[]): Promise<Message<this>>;
|
|
3150
|
+
delete(): Promise<DMChannel>;
|
|
3151
|
+
deleteMessage(messageID: string): Promise<void>;
|
|
3152
|
+
editMessage(messageID: string, content: MessageContentEdit): Promise<Message<this>>;
|
|
3153
|
+
getMessage(messageID: string): Promise<Message<this>>;
|
|
3154
|
+
getMessageReaction(messageID: string, reaction: string, options: GetMessageReactionOptions): Promise<User[]>;
|
|
3155
|
+
/** @deprecated */
|
|
3156
|
+
getMessageReaction(messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise<User[]>;
|
|
3157
|
+
getMessages(options: GetMessagesOptions): Promise<Message<this>[]>;
|
|
3158
|
+
/** @deprecated */
|
|
3159
|
+
getMessages(limit?: number, before?: string, after?: string, around?: string): Promise<Message<this>[]>;
|
|
3160
|
+
/** @deprecated */
|
|
3161
|
+
getPins(): Promise<Message<this>[]>;
|
|
3162
|
+
getPins(options?: GetPinsOptions): Promise<GetPinsResponse>;
|
|
3163
|
+
pinMessage(messageID: string): Promise<void>;
|
|
3164
|
+
removeMessageReaction(messageID: string, reaction: string): Promise<void>;
|
|
3165
|
+
/** @deprecated */
|
|
3166
|
+
removeMessageReaction(messageID: string, reaction: string, userID?: string): Promise<void>;
|
|
3167
|
+
sendTyping(): Promise<void>;
|
|
3168
|
+
unpinMessage(messageID: string): Promise<void>;
|
|
3169
|
+
unsendMessage(messageID: string): Promise<void>;
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
export class Entitlement extends Base {
|
|
3173
|
+
applicationID: string;
|
|
3174
|
+
consumed: boolean;
|
|
3175
|
+
deleted: boolean;
|
|
3176
|
+
endsAt: number | null;
|
|
3177
|
+
guildID: string | null;
|
|
3178
|
+
id: string;
|
|
3179
|
+
skuID: string;
|
|
3180
|
+
startsAt: number | null;
|
|
3181
|
+
type: EntitlementTypes;
|
|
3182
|
+
userID: string | null;
|
|
3183
|
+
constructor(data: BaseData, client: Client);
|
|
3184
|
+
consume(): Promise<void>;
|
|
3185
|
+
delete(): Promise<void>;
|
|
3186
|
+
}
|
|
3187
|
+
|
|
3188
|
+
export class ExtendedUser extends User {
|
|
3189
|
+
email: string;
|
|
3190
|
+
mfaEnabled: boolean;
|
|
3191
|
+
premiumType: PremiumTypes;
|
|
3192
|
+
verified: boolean;
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
export class ForumChannel extends MediaChannel {
|
|
3196
|
+
defaultForumLayout: ForumLayoutTypes;
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
export class GroupChannel extends Channel {
|
|
3200
|
+
applicationID: string;
|
|
3201
|
+
icon: string | null;
|
|
3202
|
+
iconURL: string | null;
|
|
3203
|
+
lastMessageID: string | null;
|
|
3204
|
+
lastPinTimestamp: number | null;
|
|
3205
|
+
managed: boolean;
|
|
3206
|
+
name: string;
|
|
3207
|
+
ownerID: string;
|
|
3208
|
+
recipients: Collection<User>;
|
|
3209
|
+
type: Constants["ChannelTypes"]["GROUP_DM"];
|
|
3210
|
+
addRecipient(userID: string, options: GroupRecipientOptions): Promise<void>;
|
|
3211
|
+
delete(): Promise<GroupChannel>;
|
|
3212
|
+
dynamicIconURL(format?: ImageFormat, size?: number): string | null;
|
|
3213
|
+
edit(options: EditGroupChannelOptions): Promise<GroupChannel>;
|
|
3214
|
+
removeRecipient(userID: string): Promise<void>;
|
|
3215
|
+
}
|
|
3216
|
+
|
|
3217
|
+
export class Guild extends Base {
|
|
3218
|
+
afkChannelID: string | null;
|
|
3219
|
+
afkTimeout: number;
|
|
3220
|
+
applicationID: string | null;
|
|
3221
|
+
approximateMemberCount?: number;
|
|
3222
|
+
approximatePresenceCount?: number;
|
|
3223
|
+
autoRemoved?: boolean;
|
|
3224
|
+
banner: string | null;
|
|
3225
|
+
bannerURL: string | null;
|
|
3226
|
+
channels: Collection<AnyGuildChannel>;
|
|
3227
|
+
createdAt: number;
|
|
3228
|
+
defaultNotifications: DefaultNotifications;
|
|
3229
|
+
description: string | null;
|
|
3230
|
+
discoverySplash: string | null;
|
|
3231
|
+
discoverySplashURL: string | null;
|
|
3232
|
+
emojiCount?: number;
|
|
3233
|
+
emojis: Emoji[];
|
|
3234
|
+
events: Collection<GuildScheduledEvent>;
|
|
3235
|
+
explicitContentFilter: ExplicitContentFilter;
|
|
3236
|
+
features: GuildFeatures[];
|
|
3237
|
+
icon: string | null;
|
|
3238
|
+
iconURL: string | null;
|
|
3239
|
+
id: string;
|
|
3240
|
+
incidentsData?: GuildIncidentData | null;
|
|
3241
|
+
joinedAt: number;
|
|
3242
|
+
large: boolean;
|
|
3243
|
+
maxMembers?: number;
|
|
3244
|
+
maxPresences?: number | null;
|
|
3245
|
+
maxStageVideoChannelUsers?: number;
|
|
3246
|
+
maxVideoChannelUsers?: number;
|
|
3247
|
+
memberCount: number;
|
|
3248
|
+
members: Collection<Member>;
|
|
3249
|
+
mfaLevel: MFALevel;
|
|
3250
|
+
name: string;
|
|
3251
|
+
/** @deprecated */
|
|
3252
|
+
nsfw: boolean;
|
|
3253
|
+
nsfwLevel: NSFWLevel;
|
|
3254
|
+
ownerID: string;
|
|
3255
|
+
preferredLocale: LocaleStrings;
|
|
3256
|
+
premiumProgressBarEnabled: boolean;
|
|
3257
|
+
premiumSubscriptionCount?: number;
|
|
3258
|
+
premiumTier: PremiumTier;
|
|
3259
|
+
primaryCategory?: DiscoveryCategory;
|
|
3260
|
+
primaryCategoryID?: number;
|
|
3261
|
+
publicUpdatesChannelID: string | null;
|
|
3262
|
+
roles: Collection<Role>;
|
|
3263
|
+
rulesChannelID: string | null;
|
|
3264
|
+
safetyAlertsChannelID: string | null;
|
|
3265
|
+
shard: Shard;
|
|
3266
|
+
soundboardSounds: Collection<SoundboardSound>;
|
|
3267
|
+
splash: string | null;
|
|
3268
|
+
splashURL: string | null;
|
|
3269
|
+
stageInstances: Collection<StageInstance>;
|
|
3270
|
+
stickers?: Sticker[];
|
|
3271
|
+
systemChannelFlags: number;
|
|
3272
|
+
systemChannelID: string | null;
|
|
3273
|
+
threads: Collection<ThreadChannel>;
|
|
3274
|
+
unavailable: boolean;
|
|
3275
|
+
vanityURL: string | null;
|
|
3276
|
+
verificationLevel: VerificationLevel;
|
|
3277
|
+
voiceStates: Collection<VoiceState>;
|
|
3278
|
+
welcomeScreen?: WelcomeScreen;
|
|
3279
|
+
widgetChannelID?: string | null;
|
|
3280
|
+
widgetEnabled?: boolean;
|
|
3281
|
+
constructor(data: BaseData, client: Client);
|
|
3282
|
+
addDiscoverySubcategory(categoryID: string, reason?: string): Promise<DiscoverySubcategoryResponse>;
|
|
3283
|
+
addMember(userID: string, accessToken: string, options?: AddGuildMemberOptions): Promise<void>;
|
|
3284
|
+
addMemberRole(memberID: string, roleID: string, reason?: string): Promise<void>;
|
|
3285
|
+
banMember(userID: string, options?: BanMemberOptions): Promise<void>;
|
|
3286
|
+
/** @deprecated */
|
|
3287
|
+
banMember(userID: string, deleteMessageDays?: number, reason?: string): Promise<void>;
|
|
3288
|
+
bulkBanMembers(options: BulkBanMembersOptions): Promise<BulkBanMembersResponse>;
|
|
3289
|
+
bulkEditCommands<T extends ApplicationCommandTypes>(commands: ApplicationCommandBulkEditOptions<true, T>[]): Promise<ApplicationCommand<true, T>[]>;
|
|
3290
|
+
createAutoModerationRule(rule: AutoModerationCreateOptions): Promise<AutoModerationRule>;
|
|
3291
|
+
createChannel(name: string): Promise<TextChannel>;
|
|
3292
|
+
createChannel<T extends GuildChannelTypes>(name: string, type: T, options?: CreateChannelOptions): Promise<ChannelTypeConversion<T>>;
|
|
3293
|
+
/** @deprecated */
|
|
3294
|
+
createChannel<T extends GuildChannelTypes>(name: string, type: T, options?: CreateChannelOptions | string): Promise<ChannelTypeConversion<T>>;
|
|
3295
|
+
createCommand<T extends ApplicationCommandTypes>(command: ApplicationCommandCreateOptions<true, T>): Promise<ApplicationCommand<true, T>>;
|
|
3296
|
+
createEmoji(options: { image: string; name: string; roles?: string[] }, reason?: string): Promise<Emoji>;
|
|
3297
|
+
createRole(options: RoleOptions, reason?: string): Promise<Role>;
|
|
3298
|
+
createRole(options: Role, reason?: string): Promise<Role>;
|
|
3299
|
+
createScheduledEvent<T extends GuildScheduledEventEntityTypes>(event: GuildScheduledEventOptions<T>, reason?: string): Promise<GuildScheduledEvent<T>>;
|
|
3300
|
+
createSoundboardSound(sound: GuildSoundboardSoundCreate, reason?: string): Promise<SoundboardSound>;
|
|
3301
|
+
createSticker(options: CreateStickerOptions, reason?: string): Promise<Sticker>;
|
|
3302
|
+
createTemplate(name: string, description?: string | null): Promise<GuildTemplate>;
|
|
3303
|
+
createTestEntitlement(skuID: string): Promise<Entitlement>;
|
|
3304
|
+
deleteAutoModerationRule(ruleID: string, reason?: string): Promise<void>;
|
|
3305
|
+
deleteCommand(commandID: string): Promise<void>;
|
|
3306
|
+
deleteDiscoverySubcategory(categoryID: string, reason?: string): Promise<void>;
|
|
3307
|
+
deleteEmoji(emojiID: string, reason?: string): Promise<void>;
|
|
3308
|
+
deleteIntegration(integrationID: string): Promise<void>;
|
|
3309
|
+
deleteRole(roleID: string): Promise<void>;
|
|
3310
|
+
deleteScheduledEvent(eventID: string): Promise<void>;
|
|
3311
|
+
deleteSoundboardSound(soundID: string, reason?: string): Promise<void>;
|
|
3312
|
+
deleteSticker(stickerID: string, reason?: string): Promise<void>;
|
|
3313
|
+
deleteTemplate(code: string): Promise<GuildTemplate>;
|
|
3314
|
+
dynamicBannerURL(format?: ImageFormat, size?: number): string | null;
|
|
3315
|
+
dynamicDiscoverySplashURL(format?: ImageFormat, size?: number): string | null;
|
|
3316
|
+
dynamicIconURL(format?: ImageFormat, size?: number): string | null;
|
|
3317
|
+
dynamicSplashURL(format?: ImageFormat, size?: number): string | null;
|
|
3318
|
+
edit(options: GuildOptions, reason?: string): Promise<Guild>;
|
|
3319
|
+
editAutoModerationRule<T extends AutoModerationTriggerType>(ruleID: string, options: AutoModerationEditOptions<T>): Promise<AutoModerationRule>;
|
|
3320
|
+
editChannelPositions(channelPositions: ChannelPosition[]): Promise<void>;
|
|
3321
|
+
editCommand<T extends ApplicationCommandTypes>(commandID: string, command: ApplicationCommandEditOptions<true, T>): Promise<ApplicationCommand<true, T>>;
|
|
3322
|
+
editCommandPermissions(permissions: ApplicationCommandPermissions[], reason?: string): Promise<GuildApplicationCommandPermissions[]>;
|
|
3323
|
+
editDiscovery(options?: DiscoveryOptions): Promise<DiscoveryMetadata>;
|
|
3324
|
+
editEmoji(emojiID: string, options: { name: string; roles?: string[] }, reason?: string): Promise<Emoji>;
|
|
3325
|
+
editIncidentActions(options: EditGuildIncidentDataOptions): Promise<GuildIncidentData>;
|
|
3326
|
+
editMember(memberID: string, options: MemberOptions, reason?: string): Promise<Member>;
|
|
3327
|
+
/** @deprecated */
|
|
3328
|
+
editNickname(nick: string): Promise<void>;
|
|
3329
|
+
editOnboarding(options: GuildOnboardingOptions, reason?: string): Promise<GuildOnboarding>;
|
|
3330
|
+
editRole(roleID: string, options: RoleOptions): Promise<Role>;
|
|
3331
|
+
editScheduledEvent<T extends GuildScheduledEventEntityTypes>(eventID: string, event: GuildScheduledEventEditOptions<T>, reason?: string): Promise<GuildScheduledEvent<T>>;
|
|
3332
|
+
editSticker(stickerID: string, options?: EditStickerOptions, reason?: string): Promise<Sticker>;
|
|
3333
|
+
editTemplate(code: string, options: GuildTemplateOptions): Promise<GuildTemplate>;
|
|
3334
|
+
editVanity(code: string | null): Promise<GuildVanity>;
|
|
3335
|
+
editVoiceState(options: VoiceStateOptions, userID?: string): Promise<void>;
|
|
3336
|
+
editWelcomeScreen(options: WelcomeScreenOptions): Promise<WelcomeScreen>;
|
|
3337
|
+
editWidget(options: WidgetOptions): Promise<Widget>;
|
|
3338
|
+
fetchAllMembers(timeout?: number): Promise<number>;
|
|
3339
|
+
fetchChannelInfo(options?: GuildChannelInfoOptions): Promise<ChannelInfo[]>;
|
|
3340
|
+
fetchMembers(options?: RequestGuildMembersOptions): Promise<Member[]>;
|
|
3341
|
+
fetchSoundboardSounds(options?: Omit<RequestGuildSoundboardSoundsOptions, "guildIDs">): Promise<SoundboardSound[]>;
|
|
3342
|
+
getActiveThreads(): Promise<ListedGuildThreads>;
|
|
3343
|
+
getAuditLog(options?: GetGuildAuditLogOptions): Promise<GuildAuditLog>;
|
|
3344
|
+
/** @deprecated */
|
|
3345
|
+
getAuditLogs(limit?: number, before?: string, actionType?: number, userID?: string): Promise<GuildAuditLog>;
|
|
3346
|
+
getAutoModerationRule(guildID: string, ruleID: string): Promise<AutoModerationRule>;
|
|
3347
|
+
getAutoModerationRules(guildID: string): Promise<AutoModerationRule[]>;
|
|
3348
|
+
getBan(userID: string): Promise<GuildBan>;
|
|
3349
|
+
getBans(options?: GetGuildBansOptions): Promise<GuildBan[]>;
|
|
3350
|
+
getCommand(commandID: string): Promise<ApplicationCommand<true>>;
|
|
3351
|
+
getCommandPermissions(): Promise<GuildApplicationCommandPermissions[]>;
|
|
3352
|
+
getCommands(withLocalizations?: boolean): Promise<ApplicationCommand<true>[]>;
|
|
3353
|
+
getDiscovery(): Promise<DiscoveryMetadata>;
|
|
3354
|
+
/** @deprecated */
|
|
3355
|
+
getEmbed(): Promise<Widget>;
|
|
3356
|
+
getEntitlements(options?: Omit<GetEntitlementsOptions, "guildID">): Promise<Entitlement[]>;
|
|
3357
|
+
getIntegrations(): Promise<GuildIntegration>;
|
|
3358
|
+
getInvites(): Promise<Invite[]>;
|
|
3359
|
+
getMemberPermissions(memberID: string): Promise<Permission>;
|
|
3360
|
+
getOnboarding(): Promise<GuildOnboarding>;
|
|
3361
|
+
getPruneCount(options?: GetPruneOptions): Promise<number>;
|
|
3362
|
+
getRESTChannels(): Promise<AnyGuildChannel[]>;
|
|
3363
|
+
getRESTEmoji(emojiID: string): Promise<Emoji>;
|
|
3364
|
+
getRESTEmojis(): Promise<Emoji[]>;
|
|
3365
|
+
getRESTMember(memberID: string): Promise<Member>;
|
|
3366
|
+
getRESTMembers(options?: GetRESTGuildMembersOptions): Promise<Member[]>;
|
|
3367
|
+
/** @deprecated */
|
|
3368
|
+
getRESTMembers(limit?: number, after?: string): Promise<Member[]>;
|
|
3369
|
+
getRESTRole(roleID: string): Promise<Role>;
|
|
3370
|
+
getRESTRoles(): Promise<Role[]>;
|
|
3371
|
+
getRESTScheduledEvent(eventID: string): Promise<GuildScheduledEvent>;
|
|
3372
|
+
getRESTSticker(stickerID: string): Promise<Sticker>;
|
|
3373
|
+
getRESTStickers(): Promise<Sticker[]>;
|
|
3374
|
+
getRoleMemberCounts(): Promise<Record<string, number>>;
|
|
3375
|
+
getRolePermissions(roleID: string): Promise<Permission>;
|
|
3376
|
+
getScheduledEvents(options?: GetGuildScheduledEventOptions): Promise<GuildScheduledEvent[]>;
|
|
3377
|
+
getScheduledEventUsers(eventID: string, options?: GetGuildScheduledEventUsersOptions): Promise<GuildScheduledEventUser[]>;
|
|
3378
|
+
getSoundboardSound(soundID: string): Promise<SoundboardSound>;
|
|
3379
|
+
getSoundboardSounds(): Promise<SoundboardSound[]>;
|
|
3380
|
+
getTemplates(): Promise<GuildTemplate[]>;
|
|
3381
|
+
getVanity(): Promise<GuildVanity>;
|
|
3382
|
+
getVoiceRegions(): Promise<VoiceRegion[]>;
|
|
3383
|
+
getVoiceState(userID: string): Promise<VoiceState>;
|
|
3384
|
+
getWebhooks(): Promise<Webhook[]>;
|
|
3385
|
+
getWelcomeScreen(): Promise<WelcomeScreen>;
|
|
3386
|
+
getWidget(): Promise<WidgetData>;
|
|
3387
|
+
getWidgetImageURL(style?: GuildWidgetStyles): string;
|
|
3388
|
+
getWidgetSettings(): Promise<Widget>;
|
|
3389
|
+
kickMember(userID: string, reason?: string): Promise<void>;
|
|
3390
|
+
leave(): Promise<void>;
|
|
3391
|
+
leaveVoiceChannel(): void;
|
|
3392
|
+
permissionsOf(memberID: string | Member | MemberRoles): Permission;
|
|
3393
|
+
pruneMembers(options?: PruneMemberOptions): Promise<number>;
|
|
3394
|
+
removeMemberRole(memberID: string, roleID: string, reason?: string): Promise<void>;
|
|
3395
|
+
searchMembers(query: string, limit?: number): Promise<Member[]>;
|
|
3396
|
+
searchMessages(options?: SearchGuildMessagesOptions): Promise<SearchGuildMessagesResult>;
|
|
3397
|
+
syncTemplate(code: string): Promise<GuildTemplate>;
|
|
3398
|
+
unbanMember(userID: string, reason?: string): Promise<void>;
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3401
|
+
export class GuildAuditLogEntry extends Base {
|
|
3402
|
+
actionType: number;
|
|
3403
|
+
after: Record<string, unknown> | null;
|
|
3404
|
+
autoModerationRuleName?: string;
|
|
3405
|
+
autoModerationRuleTriggerType?: AutoModerationTriggerType;
|
|
3406
|
+
before: Record<string, unknown> | null;
|
|
3407
|
+
channel?: AnyGuildChannel | Uncached;
|
|
3408
|
+
count?: number;
|
|
3409
|
+
deleteMemberDays?: number;
|
|
3410
|
+
guild: Guild | Uncached;
|
|
3411
|
+
id: string;
|
|
3412
|
+
member?: Member | Uncached;
|
|
3413
|
+
membersRemoved?: number;
|
|
3414
|
+
message?: Message<AnyGuildTextableChannel> | Uncached;
|
|
3415
|
+
reason: string | null;
|
|
3416
|
+
role?: Role | { id: string; name: string };
|
|
3417
|
+
status?: string;
|
|
3418
|
+
target?: Guild | AnyGuildChannel | Member | Role | Invite | Emoji | Sticker | Message<AnyGuildTextableChannel> | null;
|
|
3419
|
+
targetID: string;
|
|
3420
|
+
user: PossiblyUncachedUser;
|
|
3421
|
+
constructor(data: BaseData, guild: Guild);
|
|
3422
|
+
}
|
|
3423
|
+
|
|
3424
|
+
export class GuildChannel extends Channel {
|
|
3425
|
+
flags: number;
|
|
3426
|
+
guild: Guild;
|
|
3427
|
+
name: string;
|
|
3428
|
+
parentID: string | null;
|
|
3429
|
+
type: GuildChannelTypes;
|
|
3430
|
+
delete(reason?: string): Promise<AnyGuildChannel>;
|
|
3431
|
+
edit(options: EditGuildChannelOptions, reason?: string): Promise<this>;
|
|
3432
|
+
permissionsOf(memberID: string | Member | MemberRoles): Permission;
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
export class GuildIntegration extends Base {
|
|
3436
|
+
account: { id: string; name: string };
|
|
3437
|
+
application?: IntegrationApplication;
|
|
3438
|
+
createdAt: number;
|
|
3439
|
+
enabled: boolean;
|
|
3440
|
+
enableEmoticons?: boolean;
|
|
3441
|
+
expireBehavior?: GuildIntegrationExpireBehavior;
|
|
3442
|
+
expireGracePeriod?: number;
|
|
3443
|
+
id: string;
|
|
3444
|
+
name: string;
|
|
3445
|
+
revoked?: boolean;
|
|
3446
|
+
roleID?: string;
|
|
3447
|
+
subscriberCount?: number;
|
|
3448
|
+
syncedAt?: number;
|
|
3449
|
+
syncing?: boolean;
|
|
3450
|
+
type: GuildIntegrationTypes;
|
|
3451
|
+
user?: User;
|
|
3452
|
+
constructor(data: BaseData, guild: Guild);
|
|
3453
|
+
delete(): Promise<void>;
|
|
3454
|
+
}
|
|
3455
|
+
|
|
3456
|
+
export class GuildPreview extends Base {
|
|
3457
|
+
approximateMemberCount: number;
|
|
3458
|
+
approximatePresenceCount: number;
|
|
3459
|
+
description: string | null;
|
|
3460
|
+
discoverySplash: string | null;
|
|
3461
|
+
discoverySplashURL: string | null;
|
|
3462
|
+
emojis: Emoji[];
|
|
3463
|
+
features: GuildFeatures[];
|
|
3464
|
+
icon: string | null;
|
|
3465
|
+
iconURL: string | null;
|
|
3466
|
+
id: string;
|
|
3467
|
+
name: string;
|
|
3468
|
+
splash: string | null;
|
|
3469
|
+
splashURL: string | null;
|
|
3470
|
+
constructor(data: BaseData, client: Client);
|
|
3471
|
+
dynamicDiscoverySplashURL(format?: ImageFormat, size?: number): string | null;
|
|
3472
|
+
dynamicIconURL(format?: ImageFormat, size?: number): string | null;
|
|
3473
|
+
dynamicSplashURL(format?: ImageFormat, size?: number): string | null;
|
|
3474
|
+
}
|
|
3475
|
+
|
|
3476
|
+
export class GuildScheduledEvent<T extends GuildScheduledEventEntityTypes = GuildScheduledEventEntityTypes> extends Base {
|
|
3477
|
+
channelID: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? null : PossiblyUncachedSpeakableChannel;
|
|
3478
|
+
creator?: User;
|
|
3479
|
+
description?: string;
|
|
3480
|
+
entityID: string | null;
|
|
3481
|
+
entityMetadata: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? Required<GuildScheduledEventMetadata> : null;
|
|
3482
|
+
entityType: T;
|
|
3483
|
+
guild: PossiblyUncachedGuild;
|
|
3484
|
+
id: string;
|
|
3485
|
+
image?: string;
|
|
3486
|
+
name: string;
|
|
3487
|
+
privacyLevel: GuildScheduledEventPrivacyLevel;
|
|
3488
|
+
recurrenceRule: GuildScheduledEventRecurrenceRule | null;
|
|
3489
|
+
scheduledEndTime: T extends Constants["GuildScheduledEventEntityTypes"]["EXTERNAL"] ? number : number | null;
|
|
3490
|
+
scheduledStartTime: number;
|
|
3491
|
+
status: GuildScheduledEventStatus;
|
|
3492
|
+
userCount?: number;
|
|
3493
|
+
delete(): Promise<void>;
|
|
3494
|
+
edit<U extends GuildScheduledEventEntityTypes>(event: GuildScheduledEventEditOptions<U>, reason?: string): Promise<GuildScheduledEvent<U>>;
|
|
3495
|
+
getUsers(options?: GetGuildScheduledEventUsersOptions): Promise<GuildScheduledEventUser[]>;
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
export class GuildTemplate {
|
|
3499
|
+
code: string;
|
|
3500
|
+
createdAt: number;
|
|
3501
|
+
creator: User;
|
|
3502
|
+
description: string | null;
|
|
3503
|
+
isDirty: string | null;
|
|
3504
|
+
name: string;
|
|
3505
|
+
serializedSourceGuild: Guild;
|
|
3506
|
+
sourceGuild: Guild | Uncached;
|
|
3507
|
+
updatedAt: number;
|
|
3508
|
+
usageCount: number;
|
|
3509
|
+
constructor(data: BaseData, client: Client);
|
|
3510
|
+
delete(): Promise<GuildTemplate>;
|
|
3511
|
+
edit(options: GuildTemplateOptions): Promise<GuildTemplate>;
|
|
3512
|
+
sync(): Promise<GuildTemplate>;
|
|
3513
|
+
toJSON(props?: string[]): JSONCache;
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3516
|
+
export class GuildTextableChannel extends GuildChannel {
|
|
3517
|
+
lastMessageID: string | null;
|
|
3518
|
+
messages: Collection<Message<this>>;
|
|
3519
|
+
rateLimitPerUser: number;
|
|
3520
|
+
type: GuildTextChannelTypes | GuildVoiceChannelTypes | GuildThreadChannelTypes;
|
|
3521
|
+
constructor(data: BaseData, client: Client, messageLimit?: number);
|
|
3522
|
+
addMessageReaction(messageID: string, reaction: string): Promise<void>;
|
|
3523
|
+
createMessage(content: MessageContent, file?: FileContent | FileContent[]): Promise<Message<this>>;
|
|
3524
|
+
deleteMessage(messageID: string, reason?: string): Promise<void>;
|
|
3525
|
+
deleteMessages(messageIDs: string[], reason?: string): Promise<void>;
|
|
3526
|
+
edit(options: EditGuildTextableChannelOptions, reason?: string): Promise<this>;
|
|
3527
|
+
editMessage(messageID: string, content: MessageContentEdit): Promise<Message<this>>;
|
|
3528
|
+
endPoll(messageID: string): Promise<Message<this>>;
|
|
3529
|
+
getMessage(messageID: string): Promise<Message<this>>;
|
|
3530
|
+
getMessageReaction(messageID: string, reaction: string, options?: GetMessageReactionOptions): Promise<User[]>;
|
|
3531
|
+
/** @deprecated */
|
|
3532
|
+
getMessageReaction(messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise<User[]>;
|
|
3533
|
+
getMessages(options?: GetMessagesOptions): Promise<Message<this>[]>;
|
|
3534
|
+
/** @deprecated */
|
|
3535
|
+
getMessages(limit?: number, before?: string, after?: string, around?: string): Promise<Message<this>[]>;
|
|
3536
|
+
getPollAnswerVoters(messageID: string, answerID: string, options?: GetPollAnswerVotersOptions): Promise<User[]>;
|
|
3537
|
+
purge(options: PurgeChannelOptions): Promise<number>;
|
|
3538
|
+
/** @deprecated */
|
|
3539
|
+
purge(limit: number, filter?: (message: Message<this>) => boolean, before?: string, after?: string, reason?: string): Promise<number>;
|
|
3540
|
+
removeMessageReaction(messageID: string, reaction: string, userID?: string): Promise<void>;
|
|
3541
|
+
removeMessageReactionEmoji(messageID: string, reaction: string): Promise<void>;
|
|
3542
|
+
removeMessageReactions(messageID: string): Promise<void>;
|
|
3543
|
+
sendTyping(): Promise<void>;
|
|
3544
|
+
unsendMessage(messageID: string): Promise<void>;
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
export class MediaChannel extends GuildChannel implements Invitable, Permissionable {
|
|
3548
|
+
availableTags: ForumTag[];
|
|
3549
|
+
defaultAutoArchiveDuration: AutoArchiveDuration;
|
|
3550
|
+
defaultReactionEmoji: DefaultReactionEmoji;
|
|
3551
|
+
defaultSortOrder: SortOrderTypes;
|
|
3552
|
+
defaultThreadRateLimitPerUser: number;
|
|
3553
|
+
lastMessageID: string | null;
|
|
3554
|
+
nsfw: boolean;
|
|
3555
|
+
permissionOverwrites: Collection<PermissionOverwrite>;
|
|
3556
|
+
position: number;
|
|
3557
|
+
rateLimitPerUser: number;
|
|
3558
|
+
threads: PublicThreadChannel<true>[];
|
|
3559
|
+
topic?: string;
|
|
3560
|
+
createInvite(options?: CreateInviteOptions, reason?: string): Promise<Invite<"withMetadata", this>>;
|
|
3561
|
+
createThread(options: CreateForumThreadOptions, file?: FileContent | FileContent[]): Promise<PublicThreadChannel<true>>;
|
|
3562
|
+
createWebhook(options: WebhookCreateOptions, reason?: string): Promise<Webhook>;
|
|
3563
|
+
deletePermission(overwriteID: string, reason?: string): Promise<void>;
|
|
3564
|
+
edit(options: EditForumChannelOptions, reason?: string): Promise<this>;
|
|
3565
|
+
editPermission(overwriteID: string, allow: PermissionValueTypes, deny: PermissionValueTypes, type: PermissionType, reason?: string): Promise<PermissionOverwrite>;
|
|
3566
|
+
getArchivedThreads(options?: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PublicThreadChannel<true>>>;
|
|
3567
|
+
getInvites(): Promise<Invite<"withMetadata", this>[]>;
|
|
3568
|
+
getWebhooks(): Promise<Webhook[]>;
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3571
|
+
// Interactions
|
|
3572
|
+
export class AutocompleteInteraction<T extends PossiblyUncachedTextableChannel = TextableChannel> extends Interaction {
|
|
3573
|
+
appPermissions?: Permission;
|
|
3574
|
+
channel: T;
|
|
3575
|
+
data: AutocompleteInteractionData;
|
|
3576
|
+
guildID: T extends AnyGuildChannel ? string : undefined;
|
|
3577
|
+
member: T extends AnyGuildChannel ? Member : undefined;
|
|
3578
|
+
type: Constants["InteractionTypes"]["APPLICATION_COMMAND_AUTOCOMPLETE"];
|
|
3579
|
+
user: T extends AnyGuildChannel ? undefined : User;
|
|
3580
|
+
acknowledge(choices: ApplicationCommandOptionChoice[]): Promise<void>;
|
|
3581
|
+
result(choices: ApplicationCommandOptionChoice[]): Promise<void>;
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
export class Interaction extends Base {
|
|
3585
|
+
acknowledged: boolean;
|
|
3586
|
+
applicationID: string;
|
|
3587
|
+
appPermissions?: Permission;
|
|
3588
|
+
attachmentSizeLimit?: number;
|
|
3589
|
+
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
|
3590
|
+
context: InteractionContextTypes | null;
|
|
3591
|
+
entitlements: Entitlement[];
|
|
3592
|
+
guildLocale?: LocaleStrings;
|
|
3593
|
+
id: string;
|
|
3594
|
+
locale?: LocaleStrings;
|
|
3595
|
+
token: string;
|
|
3596
|
+
type: number;
|
|
3597
|
+
version: number;
|
|
3598
|
+
static from(data: BaseData): AnyInteraction;
|
|
3599
|
+
}
|
|
3600
|
+
|
|
3601
|
+
export class PingInteraction extends Interaction {
|
|
3602
|
+
type: Constants["InteractionTypes"]["PING"];
|
|
3603
|
+
acknowledge(): Promise<void>;
|
|
3604
|
+
pong(): Promise<void>;
|
|
3605
|
+
}
|
|
3606
|
+
|
|
3607
|
+
export class CommandInteraction<T extends PossiblyUncachedTextableChannel = TextableChannel> extends Interaction {
|
|
3608
|
+
appPermissions?: Permission;
|
|
3609
|
+
channel: T;
|
|
3610
|
+
data: CommandInteractionData;
|
|
3611
|
+
guildID: T extends AnyGuildChannel ? string : undefined;
|
|
3612
|
+
member: T extends AnyGuildChannel ? Member : undefined;
|
|
3613
|
+
type: Constants["InteractionTypes"]["APPLICATION_COMMAND"];
|
|
3614
|
+
user: T extends AnyGuildChannel ? undefined : User;
|
|
3615
|
+
acknowledge(flags?: number): Promise<void>;
|
|
3616
|
+
createFollowup(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise<Message>;
|
|
3617
|
+
createMessage(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise<void>;
|
|
3618
|
+
createModal(content: InteractionModal): Promise<void>;
|
|
3619
|
+
defer(flags?: number): Promise<void>;
|
|
3620
|
+
deleteMessage(messageID: string): Promise<void>;
|
|
3621
|
+
deleteOriginalMessage(): Promise<void>;
|
|
3622
|
+
editMessage(messageID: string, content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise<Message<T>>;
|
|
3623
|
+
editOriginalMessage(content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise<Message<T>>;
|
|
3624
|
+
getOriginalMessage(): Promise<Message<T>>;
|
|
3625
|
+
launchActivity(): Promise<InteractionCallbackResponse>;
|
|
3626
|
+
}
|
|
3627
|
+
|
|
3628
|
+
export class ComponentInteraction<T extends PossiblyUncachedTextableChannel = TextableChannel> extends Interaction {
|
|
3629
|
+
appPermissions?: Permission;
|
|
3630
|
+
channel: T;
|
|
3631
|
+
data: ComponentInteractionButtonData | ComponentInteractionSelectMenuData;
|
|
3632
|
+
guildID: T extends AnyGuildChannel ? string : undefined;
|
|
3633
|
+
member: T extends AnyGuildChannel ? Member : undefined;
|
|
3634
|
+
message: Message<T>;
|
|
3635
|
+
type: Constants["InteractionTypes"]["MESSAGE_COMPONENT"];
|
|
3636
|
+
user: T extends AnyGuildChannel ? undefined : User;
|
|
3637
|
+
acknowledge(): Promise<void>;
|
|
3638
|
+
createFollowup(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise<Message>;
|
|
3639
|
+
createMessage(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise<void>;
|
|
3640
|
+
createModal(content: InteractionModal): Promise<void>;
|
|
3641
|
+
defer(flags?: number): Promise<void>;
|
|
3642
|
+
deferUpdate(): Promise<void>;
|
|
3643
|
+
deleteMessage(messageID: string): Promise<void>;
|
|
3644
|
+
deleteOriginalMessage(): Promise<void>;
|
|
3645
|
+
editMessage(messageID: string, content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise<Message<T>>;
|
|
3646
|
+
editOriginalMessage(content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise<Message<T>>;
|
|
3647
|
+
editParent(content: Omit<InteractionContentEdit, "poll">, file?: FileContent | FileContent[]): Promise<void>;
|
|
3648
|
+
getOriginalMessage(): Promise<Message<T>>;
|
|
3649
|
+
launchActivity(): Promise<InteractionCallbackResponse>;
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3652
|
+
export class UnknownInteraction<T extends PossiblyUncachedTextableChannel = TextableChannel> extends Interaction {
|
|
3653
|
+
appPermissions?: Permission;
|
|
3654
|
+
channel?: T;
|
|
3655
|
+
data?: unknown;
|
|
3656
|
+
guildID: T extends AnyGuildChannel ? string : undefined;
|
|
3657
|
+
member: T extends AnyGuildChannel ? Member : undefined;
|
|
3658
|
+
message?: Message<T>;
|
|
3659
|
+
type: number;
|
|
3660
|
+
user: T extends AnyGuildChannel ? undefined : User;
|
|
3661
|
+
acknowledge(data: InteractionOptions): Promise<void>;
|
|
3662
|
+
createFollowup(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise<Message>;
|
|
3663
|
+
createMessage(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise<void>;
|
|
3664
|
+
defer(flags?: number): Promise<void>;
|
|
3665
|
+
deferUpdate(): Promise<void>;
|
|
3666
|
+
deleteMessage(messageID: string): Promise<void>;
|
|
3667
|
+
deleteOriginalMessage(): Promise<void>;
|
|
3668
|
+
editMessage(messageID: string, content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise<Message<T>>;
|
|
3669
|
+
editOriginalMessage(content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise<Message<T>>;
|
|
3670
|
+
editParent(content: Omit<InteractionContentEdit, "poll">, file?: FileContent | FileContent[]): Promise<void>;
|
|
3671
|
+
getOriginalMessage(): Promise<Message<T>>;
|
|
3672
|
+
launchActivity(): Promise<InteractionCallbackResponse>;
|
|
3673
|
+
pong(): Promise<void>;
|
|
3674
|
+
result(choices: ApplicationCommandOptionChoice[]): Promise<void>;
|
|
3675
|
+
}
|
|
3676
|
+
|
|
3677
|
+
// If CT (count) is "withMetadata", it will not have count properties
|
|
3678
|
+
export class Invite<CT extends "withMetadata" | "withCount" | "withoutCount" = "withMetadata", CH extends InviteChannel = InviteChannel> extends Base {
|
|
3679
|
+
channel: CH;
|
|
3680
|
+
code: string;
|
|
3681
|
+
// @ts-ignore: Property is only not null when invite metadata is supplied
|
|
3682
|
+
createdAt: CT extends "withMetadata" ? number : null;
|
|
3683
|
+
expiresAt?: CT extends "withCount" ? number | null : null;
|
|
3684
|
+
flags?: number;
|
|
3685
|
+
guild: CT extends "withMetadata"
|
|
3686
|
+
? Guild // Invite with Metadata always has guild prop
|
|
3687
|
+
: CH extends Extract<InviteChannel, GroupChannel> // Invite without Metadata
|
|
3688
|
+
? never // If the channel is GroupChannel, there is no guild
|
|
3689
|
+
: CH extends Exclude<InviteChannel, InvitePartialChannel> // Invite without Metadata and not GroupChanel
|
|
3690
|
+
? Guild // If the invite channel is not partial
|
|
3691
|
+
: Guild | Uncached | undefined; // If the invite channel is partial
|
|
3692
|
+
|
|
3693
|
+
guildScheduledEvent?: GuildScheduledEvent;
|
|
3694
|
+
inviter?: User;
|
|
3695
|
+
maxAge: CT extends "withMetadata" ? number : null;
|
|
3696
|
+
maxUses: CT extends "withMetadata" ? number : null;
|
|
3697
|
+
memberCount: CT extends "withMetadata" | "withoutCount" ? null : number;
|
|
3698
|
+
presenceCount: CT extends "withMetadata" | "withoutCount" ? null : number;
|
|
3699
|
+
roles?: Role[];
|
|
3700
|
+
/** @deprecated */
|
|
3701
|
+
stageInstance: CH extends StageChannel ? InviteStageInstance : null;
|
|
3702
|
+
temporary: CT extends "withMetadata" ? boolean : null;
|
|
3703
|
+
type: InviteTypes;
|
|
3704
|
+
uses: CT extends "withMetadata" ? number : null;
|
|
3705
|
+
constructor(data: BaseData, client: Client);
|
|
3706
|
+
delete(reason?: string): Promise<void>;
|
|
3707
|
+
}
|
|
3708
|
+
|
|
3709
|
+
export class Lobby extends Base {
|
|
3710
|
+
applicationID: string;
|
|
3711
|
+
id: string;
|
|
3712
|
+
linkedChannel: AnyGuildChannel | null;
|
|
3713
|
+
members: Collection<LobbyMember>;
|
|
3714
|
+
metadata: Record<string, string> | null;
|
|
3715
|
+
constructor(data: BaseData, client: Client);
|
|
3716
|
+
addMember(userID: string, options?: LobbyMemberOptions): Promise<LobbyMember>;
|
|
3717
|
+
bulkEditMembers(members: BulkEditLobbyMemberOptions[]): Promise<LobbyMember[]>;
|
|
3718
|
+
createChannelInvite(userID: string): Promise<LobbyInvite>;
|
|
3719
|
+
delete(): Promise<void>;
|
|
3720
|
+
edit(options: LobbyOptions): Promise<Lobby>;
|
|
3721
|
+
editMessageModerationMetadata(messageID: string, metadata: Record<string, string>): Promise<void>;
|
|
3722
|
+
removeMember(userID: string): Promise<void>;
|
|
3723
|
+
}
|
|
3724
|
+
|
|
3725
|
+
export class LobbyMember extends Base {
|
|
3726
|
+
additionalName: string | null;
|
|
3727
|
+
flags: number;
|
|
3728
|
+
id: string;
|
|
3729
|
+
lobbyID: string;
|
|
3730
|
+
metadata: Record<string, string> | null;
|
|
3731
|
+
constructor(data: BaseData, client: Client, lobbyID: string);
|
|
3732
|
+
createChannelInvite(): Promise<LobbyInvite>;
|
|
3733
|
+
edit(options: LobbyMemberOptions): Promise<LobbyMember>;
|
|
3734
|
+
remove(): Promise<void>;
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3737
|
+
export class Member extends Base implements Presence {
|
|
3738
|
+
accentColor?: number | null;
|
|
3739
|
+
activities?: Activity[];
|
|
3740
|
+
animatedNameplateURL: string | null;
|
|
3741
|
+
avatar: string | null;
|
|
3742
|
+
avatarDecorationData?: AvatarDecorationData | null;
|
|
3743
|
+
avatarDecorationURL: string | null;
|
|
3744
|
+
avatarURL: string;
|
|
3745
|
+
banner?: string | null;
|
|
3746
|
+
bannerURL: string | null;
|
|
3747
|
+
bot: boolean;
|
|
3748
|
+
clientStatus?: ClientStatus;
|
|
3749
|
+
collectibles?: UserCollectibles | null;
|
|
3750
|
+
communicationDisabledUntil?: number | null;
|
|
3751
|
+
createdAt: number;
|
|
3752
|
+
defaultAvatar: string;
|
|
3753
|
+
defaultAvatarURL: string;
|
|
3754
|
+
discriminator: string;
|
|
3755
|
+
flags: number;
|
|
3756
|
+
game: Activity | null;
|
|
3757
|
+
globalName: string | null;
|
|
3758
|
+
guild: Guild;
|
|
3759
|
+
id: string;
|
|
3760
|
+
joinedAt: number | null;
|
|
3761
|
+
mention: string;
|
|
3762
|
+
nick: string | null;
|
|
3763
|
+
pending?: boolean;
|
|
3764
|
+
/** @deprecated */
|
|
3765
|
+
permission: Permission;
|
|
3766
|
+
permissions: Permission;
|
|
3767
|
+
premiumSince?: number | null;
|
|
3768
|
+
roles: string[];
|
|
3769
|
+
staticAvatarURL: string;
|
|
3770
|
+
staticNameplateURL: string | null;
|
|
3771
|
+
status?: UserStatus;
|
|
3772
|
+
user: User;
|
|
3773
|
+
username: string;
|
|
3774
|
+
voiceState: VoiceState;
|
|
3775
|
+
constructor(data: BaseData, guild?: Guild, client?: Client);
|
|
3776
|
+
addRole(roleID: string, reason?: string): Promise<void>;
|
|
3777
|
+
ban(options?: BanMemberOptions): Promise<void>;
|
|
3778
|
+
/** @deprecated */
|
|
3779
|
+
ban(deleteMessageDays?: number, reason?: string): Promise<void>;
|
|
3780
|
+
dynamicAvatarURL(format?: ImageFormat, size?: number): string;
|
|
3781
|
+
dynamicBannerURL(format?: ImageFormat, size?: number): string | null;
|
|
3782
|
+
edit(options: MemberOptions, reason?: string): Promise<void>;
|
|
3783
|
+
kick(reason?: string): Promise<void>;
|
|
3784
|
+
removeRole(roleID: string, reason?: string): Promise<void>;
|
|
3785
|
+
unban(reason?: string): Promise<void>;
|
|
3786
|
+
}
|
|
3787
|
+
|
|
3788
|
+
export class Message<T extends PossiblyUncachedTextableChannel = TextableChannel> extends Base {
|
|
3789
|
+
activity?: MessageActivity;
|
|
3790
|
+
application?: MessageApplication;
|
|
3791
|
+
applicationID?: string;
|
|
3792
|
+
attachments: Attachment[];
|
|
3793
|
+
author: User;
|
|
3794
|
+
call?: MessageCall;
|
|
3795
|
+
channel: T;
|
|
3796
|
+
channelMentions: string[];
|
|
3797
|
+
/** @deprecated */
|
|
3798
|
+
cleanContent: string;
|
|
3799
|
+
command?: Command;
|
|
3800
|
+
components?: ActionRow[];
|
|
3801
|
+
content: string;
|
|
3802
|
+
createdAt: number;
|
|
3803
|
+
editedTimestamp?: number;
|
|
3804
|
+
embeds: Embed[] | [PollEmbed];
|
|
3805
|
+
flags: number;
|
|
3806
|
+
guildID: T extends GuildTextableWithThreads ? string : undefined;
|
|
3807
|
+
id: string;
|
|
3808
|
+
/** @deprecated */
|
|
3809
|
+
interaction: MessageInteraction | null;
|
|
3810
|
+
interactionMetadata: MessageInteractionMetadata | null;
|
|
3811
|
+
jumpLink: string;
|
|
3812
|
+
member: T extends GuildTextableWithThreads ? Member : null;
|
|
3813
|
+
mentionEveryone: boolean;
|
|
3814
|
+
mentions: User[];
|
|
3815
|
+
messageReference: MessageReference | null;
|
|
3816
|
+
messageSnapshots?: MessageSnapshot[];
|
|
3817
|
+
nonce?: string | number;
|
|
3818
|
+
pinned: boolean;
|
|
3819
|
+
poll?: Poll;
|
|
3820
|
+
position?: number;
|
|
3821
|
+
prefix?: string;
|
|
3822
|
+
reactions: Record<string, Reaction>;
|
|
3823
|
+
referencedMessage?: Message | null;
|
|
3824
|
+
resolved?: InteractionResolvedData;
|
|
3825
|
+
roleMentions: string[];
|
|
3826
|
+
roleSubscriptionData?: RoleSubscriptionData;
|
|
3827
|
+
sharedClientTheme?: SharedClientTheme | null;
|
|
3828
|
+
stickerItems?: StickerItems[];
|
|
3829
|
+
/** @deprecated */
|
|
3830
|
+
stickers?: Sticker[];
|
|
3831
|
+
thread?: AnyThreadChannel;
|
|
3832
|
+
timestamp: number;
|
|
3833
|
+
tts: boolean;
|
|
3834
|
+
type: number;
|
|
3835
|
+
webhookID: T extends GuildTextableWithThreads ? string | undefined : undefined;
|
|
3836
|
+
constructor(data: BaseData, client: Client);
|
|
3837
|
+
addReaction(reaction: string): Promise<void>;
|
|
3838
|
+
createThreadWithMessage(options: CreateThreadOptions): Promise<NewsThreadChannel | PublicThreadChannel>;
|
|
3839
|
+
crosspost(): Promise<T extends NewsChannel ? Message<NewsChannel> : never>;
|
|
3840
|
+
delete(reason?: string): Promise<void>;
|
|
3841
|
+
deleteWebhook(token: string): Promise<void>;
|
|
3842
|
+
edit(content: MessageContentEdit): Promise<Message<T>>;
|
|
3843
|
+
editWebhook(token: string, options: WebhookPayloadEdit): Promise<Message<T>>;
|
|
3844
|
+
getReaction(reaction: string, options?: GetMessageReactionOptions): Promise<User[]>;
|
|
3845
|
+
/** @deprecated */
|
|
3846
|
+
getReaction(reaction: string, limit?: number, before?: string, after?: string): Promise<User[]>;
|
|
3847
|
+
pin(): Promise<void>;
|
|
3848
|
+
removeReaction(reaction: string, userID?: string): Promise<void>;
|
|
3849
|
+
removeReactionEmoji(reaction: string): Promise<void>;
|
|
3850
|
+
removeReactions(): Promise<void>;
|
|
3851
|
+
unpin(): Promise<void>;
|
|
3852
|
+
}
|
|
3853
|
+
|
|
3854
|
+
export class ModalSubmitInteraction<T extends PossiblyUncachedTextableChannel = TextableChannel> extends Interaction {
|
|
3855
|
+
channel: T;
|
|
3856
|
+
data: ModalSubmitInteractionData;
|
|
3857
|
+
guildID: T extends AnyGuildChannel ? string : undefined;
|
|
3858
|
+
member: T extends AnyGuildChannel ? Member : undefined;
|
|
3859
|
+
type: Constants["InteractionTypes"]["MODAL_SUBMIT"];
|
|
3860
|
+
user: T extends AnyGuildChannel ? undefined : User;
|
|
3861
|
+
acknowledge(): Promise<void>;
|
|
3862
|
+
createFollowup(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise<Message>;
|
|
3863
|
+
createMessage(content: string | InteractionContent, file?: FileContent | FileContent[]): Promise<void>;
|
|
3864
|
+
defer(flags?: number): Promise<void>;
|
|
3865
|
+
deferUpdate(): Promise<void>;
|
|
3866
|
+
deleteMessage(messageID: string): Promise<void>;
|
|
3867
|
+
deleteOriginalMessage(): Promise<void>;
|
|
3868
|
+
editMessage(messageID: string, content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise<Message>;
|
|
3869
|
+
editOriginalMessage(content: string | InteractionContentEdit, file?: FileContent | FileContent[]): Promise<Message>;
|
|
3870
|
+
editParent(content: Omit<InteractionContentEdit, "poll">, file?: FileContent | FileContent[]): Promise<void>;
|
|
3871
|
+
getOriginalMessage(): Promise<Message>;
|
|
3872
|
+
launchActivity(): Promise<InteractionCallbackResponse>;
|
|
3873
|
+
}
|
|
3874
|
+
|
|
3875
|
+
// News channel rate limit is always 0
|
|
3876
|
+
export class NewsChannel extends TextChannel {
|
|
3877
|
+
rateLimitPerUser: 0;
|
|
3878
|
+
type: Constants["ChannelTypes"]["GUILD_NEWS"];
|
|
3879
|
+
crosspostMessage(messageID: string): Promise<Message<this>>;
|
|
3880
|
+
edit(options: EditNewsChannelOptions, reason?: string): Promise<this>;
|
|
3881
|
+
follow(webhookChannelID: string, reason?: string): Promise<ChannelFollow>;
|
|
3882
|
+
}
|
|
3883
|
+
|
|
3884
|
+
export class NewsThreadChannel extends ThreadChannel {
|
|
3885
|
+
type: Constants["ChannelTypes"]["GUILD_NEWS_THREAD"];
|
|
3886
|
+
}
|
|
3887
|
+
|
|
3888
|
+
export class Permission extends Base {
|
|
3889
|
+
allow: bigint;
|
|
3890
|
+
deny: bigint;
|
|
3891
|
+
json: Record<keyof Constants["Permissions"], boolean>;
|
|
3892
|
+
constructor(allow: number | string | bigint, deny?: number | string | bigint);
|
|
3893
|
+
has(permission: keyof Constants["Permissions"] | bigint): boolean;
|
|
3894
|
+
}
|
|
3895
|
+
|
|
3896
|
+
export class PermissionOverwrite extends Permission {
|
|
3897
|
+
id: string;
|
|
3898
|
+
type: PermissionType;
|
|
3899
|
+
constructor(data: Overwrite);
|
|
3900
|
+
}
|
|
3901
|
+
|
|
3902
|
+
export class Piper extends EventEmitter {
|
|
3903
|
+
converterCommand: ConverterCommand;
|
|
3904
|
+
dataPacketCount: number;
|
|
3905
|
+
encoding: boolean;
|
|
3906
|
+
libopus: boolean;
|
|
3907
|
+
opus: OpusScript | null;
|
|
3908
|
+
opusFactory: () => OpusScript;
|
|
3909
|
+
volumeLevel: number;
|
|
3910
|
+
constructor(converterCommand: string, opusFactory: OpusScript);
|
|
3911
|
+
addDataPacket(packet: unknown): void;
|
|
3912
|
+
encode(source: string | Stream, options: VoiceResourceOptions): boolean;
|
|
3913
|
+
getDataPacket(): Buffer;
|
|
3914
|
+
reset(): void;
|
|
3915
|
+
resetPackets(): void;
|
|
3916
|
+
setVolume(volume: number): void;
|
|
3917
|
+
stop(e: Error, source: Duplex): void;
|
|
3918
|
+
}
|
|
3919
|
+
|
|
3920
|
+
export class PrivateThreadChannel extends ThreadChannel {
|
|
3921
|
+
threadMetadata: PrivateThreadMetadata;
|
|
3922
|
+
type: Constants["ChannelTypes"]["GUILD_PRIVATE_THREAD"];
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3925
|
+
/** Generic T is true if the PublicThreadChannel's parent channel is a Forum Channel */
|
|
3926
|
+
export class PublicThreadChannel<T = false> extends ThreadChannel {
|
|
3927
|
+
appliedTags: T extends true ? string[] : never;
|
|
3928
|
+
type: GuildPublicThreadChannelTypes;
|
|
3929
|
+
}
|
|
3930
|
+
|
|
3931
|
+
export class RequestHandler implements SimpleJSON {
|
|
3932
|
+
globalBlock: boolean;
|
|
3933
|
+
latencyRef: LatencyRef;
|
|
3934
|
+
options: RequestHandlerOptions;
|
|
3935
|
+
ratelimits: Record<string, SequentialBucket>;
|
|
3936
|
+
readyQueue: (() => void)[];
|
|
3937
|
+
userAgent: string;
|
|
3938
|
+
constructor(client: Client, options?: RequestHandlerOptions);
|
|
3939
|
+
/** @deprecated */
|
|
3940
|
+
constructor(client: Client, forceQueueing?: boolean);
|
|
3941
|
+
globalUnblock(): void;
|
|
3942
|
+
request(method: RequestMethod, url: string, auth?: boolean, body?: Record<string, unknown>, file?: FileContent, _route?: string, short?: boolean, options?: { headers?: Record<string, string>; rawBody?: boolean }): Promise<unknown>;
|
|
3943
|
+
routefy(url: string, method: RequestMethod): string;
|
|
3944
|
+
toString(): string;
|
|
3945
|
+
toJSON(props?: string[]): JSONCache;
|
|
3946
|
+
}
|
|
3947
|
+
|
|
3948
|
+
export class Role extends Base {
|
|
3949
|
+
color: number;
|
|
3950
|
+
colors: RoleColors;
|
|
3951
|
+
createdAt: number;
|
|
3952
|
+
flags: number;
|
|
3953
|
+
guild: Guild;
|
|
3954
|
+
hoist: boolean;
|
|
3955
|
+
icon: string | null;
|
|
3956
|
+
iconURL: string | null;
|
|
3957
|
+
id: string;
|
|
3958
|
+
json: Partial<Record<Exclude<keyof Constants["Permissions"], "all" | "allGuild" | "allText" | "allVoice">, boolean>>;
|
|
3959
|
+
managed: boolean;
|
|
3960
|
+
mention: string;
|
|
3961
|
+
mentionable: boolean;
|
|
3962
|
+
name: string;
|
|
3963
|
+
permissions: Permission;
|
|
3964
|
+
position: number;
|
|
3965
|
+
tags?: RoleTags;
|
|
3966
|
+
unicodeEmoji: string | null;
|
|
3967
|
+
constructor(data: BaseData, guild: Guild);
|
|
3968
|
+
delete(reason?: string): Promise<void>;
|
|
3969
|
+
edit(options: RoleOptions, reason?: string): Promise<Role>;
|
|
3970
|
+
editPosition(position: number): Promise<void>;
|
|
3971
|
+
}
|
|
3972
|
+
|
|
3973
|
+
export class SequentialBucket {
|
|
3974
|
+
latencyRef: LatencyRef;
|
|
3975
|
+
limit: number;
|
|
3976
|
+
processing: boolean;
|
|
3977
|
+
remaining: number;
|
|
3978
|
+
reset: number;
|
|
3979
|
+
constructor(limit: number, latencyRef?: LatencyRef);
|
|
3980
|
+
check(override?: boolean): void;
|
|
3981
|
+
queue(func: (cb: () => void) => void, short?: boolean): void;
|
|
3982
|
+
}
|
|
3983
|
+
|
|
3984
|
+
export class Shard extends EventEmitter implements SimpleJSON {
|
|
3985
|
+
client: Client;
|
|
3986
|
+
connectAttempts: number;
|
|
3987
|
+
connecting: boolean;
|
|
3988
|
+
connectTimeout: NodeJS.Timeout | null;
|
|
3989
|
+
discordServerTrace?: string[];
|
|
3990
|
+
getAllUsersCount: Record<string, boolean>;
|
|
3991
|
+
getAllUsersLength: number;
|
|
3992
|
+
getAllUsersQueue: string;
|
|
3993
|
+
globalBucket: Bucket;
|
|
3994
|
+
guildCreateTimeout: NodeJS.Timeout | null;
|
|
3995
|
+
heartbeatInterval: NodeJS.Timeout | null;
|
|
3996
|
+
id: number;
|
|
3997
|
+
lastHeartbeatAck: boolean;
|
|
3998
|
+
lastHeartbeatReceived: number | null;
|
|
3999
|
+
lastHeartbeatSent: number | null;
|
|
4000
|
+
latency: number;
|
|
4001
|
+
preReady: boolean;
|
|
4002
|
+
presence: ClientPresence;
|
|
4003
|
+
presenceUpdateBucket: Bucket;
|
|
4004
|
+
ready: boolean;
|
|
4005
|
+
reconnectInterval: number;
|
|
4006
|
+
requestChannelInfoPromise: Record<string, RequestChannelInfoPromise[]>;
|
|
4007
|
+
requestMembersPromise: Record<string, RequestMembersPromise>;
|
|
4008
|
+
requestSoundboardSoundsPromise: Record<string, RequestSoundboardSoundsPromise>;
|
|
4009
|
+
resumeURL: string | null;
|
|
4010
|
+
seq: number;
|
|
4011
|
+
sessionID: string | null;
|
|
4012
|
+
status: "connecting" | "disconnected" | "handshaking" | "identifying" | "ready" | "resuming";
|
|
4013
|
+
ws: WebSocket | BrowserWebSocket | null;
|
|
4014
|
+
constructor(id: number, client: Client);
|
|
4015
|
+
checkReady(): void;
|
|
4016
|
+
connect(): void;
|
|
4017
|
+
createGuild(_guild: Guild): Guild;
|
|
4018
|
+
disconnect(options?: { reconnect?: boolean | "auto" }, error?: Error): void;
|
|
4019
|
+
editAFK(afk: boolean): void;
|
|
4020
|
+
editStatus(status: SelfStatus, activities?: ActivityPartial<ActivityType>[] | ActivityPartial<ActivityType>): void;
|
|
4021
|
+
editStatus(activities?: ActivityPartial<ActivityType>[] | ActivityPartial<ActivityType>): void;
|
|
4022
|
+
// @ts-ignore: Method override
|
|
4023
|
+
emit(event: string, ...args: any[]): void;
|
|
4024
|
+
emit<K extends keyof ShardEvents>(event: K, ...args: ShardEvents[K]): boolean;
|
|
4025
|
+
emit(event: string, ...args: any[]): boolean;
|
|
4026
|
+
getGuildMembers(guildID: string, timeout: number): void;
|
|
4027
|
+
hardReset(): void;
|
|
4028
|
+
heartbeat(normal?: boolean): void;
|
|
4029
|
+
identify(): void;
|
|
4030
|
+
initializeWS(): void;
|
|
4031
|
+
off<K extends keyof ShardEvents>(event: K, listener: (...args: ShardEvents[K]) => void): this;
|
|
4032
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
4033
|
+
once<K extends keyof ShardEvents>(event: K, listener: (...args: ShardEvents[K]) => void): this;
|
|
4034
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
4035
|
+
onPacket(packet: RawPacket): void;
|
|
4036
|
+
requestChannelInfo(guildID: string, options?: GuildChannelInfoOptions): Promise<ChannelInfo[]>;
|
|
4037
|
+
requestGuildMembers(guildID: string, options?: RequestGuildMembersOptions): Promise<Member[]>;
|
|
4038
|
+
requestGuildSoundboardSounds(options: RequestGuildSoundboardSoundsOptions): Promise<Record<string, SoundboardSound[]>>;
|
|
4039
|
+
reset(): void;
|
|
4040
|
+
restartGuildCreateTimeout(): void;
|
|
4041
|
+
resume(): void;
|
|
4042
|
+
sendStatusUpdate(): void;
|
|
4043
|
+
sendWS(op: number, _data: Record<string, unknown>, priority?: boolean): void;
|
|
4044
|
+
wsEvent(packet: Required<RawPacket>): void;
|
|
4045
|
+
on<K extends keyof ShardEvents>(event: K, listener: (...args: ShardEvents[K]) => void): this;
|
|
4046
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
4047
|
+
toJSON(props?: string[]): JSONCache;
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
export class ShardManager extends Collection<Shard> implements SimpleJSON {
|
|
4051
|
+
buckets: Map<number, number>;
|
|
4052
|
+
connectQueue: Shard[];
|
|
4053
|
+
connectTimeout: NodeJS.Timer | null;
|
|
4054
|
+
constructor(client: Client, options: ShardManagerOptions);
|
|
4055
|
+
connect(shard: Shard): void;
|
|
4056
|
+
spawn(id: number): void;
|
|
4057
|
+
tryConnect(): void;
|
|
4058
|
+
toString(): string;
|
|
4059
|
+
toJSON(props?: string[]): JSONCache;
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
export class SharedStream extends EventEmitter {
|
|
4063
|
+
bitrate: number;
|
|
4064
|
+
channels: number;
|
|
4065
|
+
current?: VoiceStreamCurrent;
|
|
4066
|
+
ended: boolean;
|
|
4067
|
+
frameDuration: number;
|
|
4068
|
+
piper: Piper;
|
|
4069
|
+
playing: boolean;
|
|
4070
|
+
samplingRate: number;
|
|
4071
|
+
speaking: boolean;
|
|
4072
|
+
voiceConnections: Collection<VoiceConnection>;
|
|
4073
|
+
volume: number;
|
|
4074
|
+
add(connection: VoiceConnection): void;
|
|
4075
|
+
emit<K extends keyof StreamEvents>(event: K, ...args: StreamEvents[K]): boolean;
|
|
4076
|
+
emit(event: string, ...args: any[]): boolean;
|
|
4077
|
+
off<K extends keyof StreamEvents>(event: K, listener: (...args: StreamEvents[K]) => void): this;
|
|
4078
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
4079
|
+
once<K extends keyof StreamEvents>(event: K, listener: (...args: StreamEvents[K]) => void): this;
|
|
4080
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
4081
|
+
play(resource: ReadableStream | string, options?: VoiceResourceOptions): void;
|
|
4082
|
+
remove(connection: VoiceConnection): void;
|
|
4083
|
+
setSpeaking(value: boolean): void;
|
|
4084
|
+
setVolume(volume: number): void;
|
|
4085
|
+
stopPlaying(): void;
|
|
4086
|
+
on<K extends keyof StreamEvents>(event: K, listener: (...args: StreamEvents[K]) => void): this;
|
|
4087
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
4088
|
+
}
|
|
4089
|
+
|
|
4090
|
+
export class SKU extends Base {
|
|
4091
|
+
applicationID: string;
|
|
4092
|
+
flags: number;
|
|
4093
|
+
id: string;
|
|
4094
|
+
name: string;
|
|
4095
|
+
slug: string;
|
|
4096
|
+
type: SKUTypes;
|
|
4097
|
+
constructor(data: BaseData, client: Client);
|
|
4098
|
+
createTestEntitlement(ownerID: string, ownerType: EntitlementOwnerTypes): Promise<Entitlement>;
|
|
4099
|
+
getEntitlements(options?: Omit<GetEntitlementsOptions, "skuIDs">): Promise<Entitlement[]>;
|
|
4100
|
+
getSKUSubscription(subscriptionID: string): Promise<Subscription>;
|
|
4101
|
+
getSKUSubscriptions(options: GetSKUSubscriptionsOptions): Promise<Subscription[]>;
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
export class SoundboardSound<G = true> extends Base {
|
|
4105
|
+
available: G extends false ? true : boolean;
|
|
4106
|
+
emojiID: G extends false ? null : string | null;
|
|
4107
|
+
emojiName: G extends false ? string : string | null;
|
|
4108
|
+
guild: G extends false ? never : PossiblyUncachedGuild;
|
|
4109
|
+
name: string;
|
|
4110
|
+
user: G extends false ? never : User | undefined;
|
|
4111
|
+
volume: number;
|
|
4112
|
+
constructor(data: BaseData, client: Client);
|
|
4113
|
+
delete(reason?: string): Promise<void>;
|
|
4114
|
+
edit(options: GuildSoundboardSoundEdit): Promise<SoundboardSound>;
|
|
4115
|
+
send(channelID: string): Promise<void>;
|
|
4116
|
+
}
|
|
4117
|
+
|
|
4118
|
+
export class StageChannel extends VoiceChannel {
|
|
4119
|
+
type: Constants["ChannelTypes"]["GUILD_STAGE_VOICE"];
|
|
4120
|
+
createInstance(options: StageInstanceOptions): Promise<StageInstance>;
|
|
4121
|
+
deleteInstance(): Promise<void>;
|
|
4122
|
+
editInstance(options: StageInstanceOptions): Promise<StageInstance>;
|
|
4123
|
+
getInstance(): Promise<StageInstance>;
|
|
4124
|
+
}
|
|
4125
|
+
|
|
4126
|
+
export class StageInstance extends Base {
|
|
4127
|
+
channel: StageChannel | Uncached;
|
|
4128
|
+
client: Client;
|
|
4129
|
+
discoverableDisabled: boolean;
|
|
4130
|
+
guild: Guild | Uncached;
|
|
4131
|
+
privacyLevel: StageInstancePrivacyLevel;
|
|
4132
|
+
topic: string;
|
|
4133
|
+
constructor(data: BaseData, client: Client);
|
|
4134
|
+
update(data: BaseData): void;
|
|
4135
|
+
delete(): Promise<void>;
|
|
4136
|
+
edit(options: StageInstanceOptions): Promise<StageInstance>;
|
|
4137
|
+
}
|
|
4138
|
+
|
|
4139
|
+
export class Subscription extends Base {
|
|
4140
|
+
canceledAt: number | null;
|
|
4141
|
+
country?: string;
|
|
4142
|
+
currentPeriodEnd: number;
|
|
4143
|
+
currentPeriodStart: number;
|
|
4144
|
+
entitlementIDs: string[];
|
|
4145
|
+
id: string;
|
|
4146
|
+
renewalSKUIDs: string[] | null;
|
|
4147
|
+
skuIDs: string[];
|
|
4148
|
+
status: SubscriptionStatuses;
|
|
4149
|
+
userID: string;
|
|
4150
|
+
constructor(data: BaseData, client: Client);
|
|
4151
|
+
}
|
|
4152
|
+
|
|
4153
|
+
export class TextChannel extends GuildTextableChannel implements Invitable, Permissionable, Pinnable {
|
|
4154
|
+
defaultAutoArchiveDuration: AutoArchiveDuration;
|
|
4155
|
+
lastPinTimestamp: number | null;
|
|
4156
|
+
nsfw: boolean;
|
|
4157
|
+
permissionOverwrites: Collection<PermissionOverwrite>;
|
|
4158
|
+
position: number;
|
|
4159
|
+
topic: string | null;
|
|
4160
|
+
type: GuildTextChannelTypes;
|
|
4161
|
+
createInvite(options?: CreateChannelInviteOptions, reason?: string): Promise<Invite<"withMetadata", this>>;
|
|
4162
|
+
createThread(options: CreateThreadWithoutMessageOptions): Promise<AnyThreadChannel>;
|
|
4163
|
+
createThreadWithMessage(messageID: string, options: CreateThreadOptions): Promise<NewsThreadChannel | PublicThreadChannel>;
|
|
4164
|
+
/** @deprecated */
|
|
4165
|
+
createThreadWithoutMessage(options: CreateThreadWithoutMessageOptions): Promise<AnyThreadChannel>;
|
|
4166
|
+
createWebhook(options: WebhookCreateOptions, reason?: string | undefined): Promise<Webhook>;
|
|
4167
|
+
deletePermission(overwriteID: string, reason?: string): Promise<void>;
|
|
4168
|
+
edit(options: EditTextChannelOptions, reason?: string): Promise<this>;
|
|
4169
|
+
editPermission(overwriteID: string, allow: PermissionValueTypes, deny: PermissionValueTypes, type: PermissionType, reason?: string): Promise<PermissionOverwrite>;
|
|
4170
|
+
getArchivedThreads(type: "private", options?: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PrivateThreadChannel>>;
|
|
4171
|
+
getArchivedThreads(type: "public", options?: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PublicThreadChannel>>;
|
|
4172
|
+
getInvites(): Promise<Invite<"withMetadata", this>[]>;
|
|
4173
|
+
getJoinedPrivateArchivedThreads(options: GetArchivedThreadsOptions): Promise<ListedChannelThreads<PrivateThreadChannel>>;
|
|
4174
|
+
/** @deprecated */
|
|
4175
|
+
getPins(): Promise<Message<this>[]>;
|
|
4176
|
+
getPins(options?: GetPinsOptions): Promise<GetPinsResponse>;
|
|
4177
|
+
getWebhooks(): Promise<Webhook[]>;
|
|
4178
|
+
pinMessage(messageID: string): Promise<void>;
|
|
4179
|
+
unpinMessage(messageID: string): Promise<void>;
|
|
4180
|
+
}
|
|
4181
|
+
|
|
4182
|
+
export class ThreadChannel extends GuildTextableChannel implements Pinnable {
|
|
4183
|
+
lastPinTimestamp: number | null;
|
|
4184
|
+
member?: ThreadMember;
|
|
4185
|
+
memberCount: number;
|
|
4186
|
+
members: Collection<ThreadMember>;
|
|
4187
|
+
messageCount: number;
|
|
4188
|
+
ownerID: string;
|
|
4189
|
+
threadMetadata: ThreadMetadata;
|
|
4190
|
+
totalMessageSent: number;
|
|
4191
|
+
type: GuildThreadChannelTypes;
|
|
4192
|
+
constructor(data: BaseData, client: Client);
|
|
4193
|
+
edit(options: EditThreadChannelOptions, reason?: string): Promise<this>;
|
|
4194
|
+
getMember(userID: string, withMember?: boolean): Promise<ThreadMember>;
|
|
4195
|
+
getMembers(options?: GetThreadMembersOptions): Promise<ThreadMember[]>;
|
|
4196
|
+
/** @deprecated */
|
|
4197
|
+
getPins(): Promise<Message<this>[]>;
|
|
4198
|
+
getPins(options?: GetPinsOptions): Promise<GetPinsResponse>;
|
|
4199
|
+
join(userID?: string): Promise<void>;
|
|
4200
|
+
leave(userID?: string): Promise<void>;
|
|
4201
|
+
pinMessage(messageID: string): Promise<void>;
|
|
4202
|
+
unpinMessage(messageID: string): Promise<void>;
|
|
4203
|
+
}
|
|
4204
|
+
|
|
4205
|
+
export class ThreadMember extends Base {
|
|
4206
|
+
flags: number;
|
|
4207
|
+
guildMember?: Member;
|
|
4208
|
+
joinTimestamp: number;
|
|
4209
|
+
threadID: string;
|
|
4210
|
+
constructor(data: BaseData, client: Client);
|
|
4211
|
+
update(data: BaseData): void;
|
|
4212
|
+
leave(): Promise<void>;
|
|
4213
|
+
}
|
|
4214
|
+
|
|
4215
|
+
export class UnavailableGuild extends Base {
|
|
4216
|
+
createdAt: number;
|
|
4217
|
+
id: string;
|
|
4218
|
+
shard: Shard;
|
|
4219
|
+
unavailable: boolean;
|
|
4220
|
+
constructor(data: BaseData, client: Client);
|
|
4221
|
+
}
|
|
4222
|
+
|
|
4223
|
+
export class User extends Base {
|
|
4224
|
+
accentColor?: number | null;
|
|
4225
|
+
animatedNameplateURL: string | null;
|
|
4226
|
+
avatar: string | null;
|
|
4227
|
+
avatarDecorationData?: AvatarDecorationData | null;
|
|
4228
|
+
avatarDecorationURL: string | null;
|
|
4229
|
+
avatarURL: string;
|
|
4230
|
+
banner?: string | null;
|
|
4231
|
+
bannerURL: string | null;
|
|
4232
|
+
bot: boolean;
|
|
4233
|
+
collectibles?: UserCollectibles | null;
|
|
4234
|
+
createdAt: number;
|
|
4235
|
+
defaultAvatar: string;
|
|
4236
|
+
defaultAvatarURL: string;
|
|
4237
|
+
discriminator: string;
|
|
4238
|
+
globalName: string | null;
|
|
4239
|
+
guildTagBadgeURL: string | null;
|
|
4240
|
+
id: string;
|
|
4241
|
+
mention: string;
|
|
4242
|
+
primaryGuild?: PrimaryGuild | null;
|
|
4243
|
+
publicFlags?: number;
|
|
4244
|
+
staticAvatarURL: string;
|
|
4245
|
+
staticNameplateURL: string | null;
|
|
4246
|
+
system: boolean;
|
|
4247
|
+
username: string;
|
|
4248
|
+
constructor(data: BaseData, client: Client);
|
|
4249
|
+
createTestEntitlement(skuID: string): Promise<Entitlement>;
|
|
4250
|
+
deleteApplicationIdentity(providerType: string, providerIssuedUserID: string, providerID?: string): Promise<void>;
|
|
4251
|
+
dynamicAvatarURL(format?: ImageFormat, size?: number): string;
|
|
4252
|
+
dynamicBannerURL(format?: ImageFormat, size?: number): string | null;
|
|
4253
|
+
dynamicGuildTagBadgeURL(format?: ImageFormat, size?: number): string | null;
|
|
4254
|
+
editApplicationIdentityProfile(providerIssuedUserID: string, options: EditApplicationIdentityProfileOptions): Promise<ApplicationIdentityProfile | undefined>;
|
|
4255
|
+
getApplicationIdentities(): Promise<ApplicationIdentity[]>;
|
|
4256
|
+
getApplicationIdentityProfile(providerIssuedUserID: string): Promise<ApplicationIdentityProfile>;
|
|
4257
|
+
getDMChannel(): Promise<DMChannel>;
|
|
4258
|
+
getEntitlements(options?: Omit<GetEntitlementsOptions, "userID">): Promise<Entitlement[]>;
|
|
4259
|
+
}
|
|
4260
|
+
|
|
4261
|
+
export class VoiceChannel extends GuildTextableChannel implements Invitable, Permissionable {
|
|
4262
|
+
bitrate: number;
|
|
4263
|
+
nsfw: boolean;
|
|
4264
|
+
permissionOverwrites: Collection<PermissionOverwrite>;
|
|
4265
|
+
position: number;
|
|
4266
|
+
rtcRegion: string | null;
|
|
4267
|
+
status?: string;
|
|
4268
|
+
type: GuildVoiceChannelTypes;
|
|
4269
|
+
userLimit: number;
|
|
4270
|
+
videoQualityMode: VideoQualityMode;
|
|
4271
|
+
voiceMembers: Collection<Member>;
|
|
4272
|
+
voiceStartTime?: number | null;
|
|
4273
|
+
createInvite(options?: CreateInviteOptions, reason?: string): Promise<Invite<"withMetadata", this>>;
|
|
4274
|
+
createWebhook(options: WebhookCreateOptions, reason?: string | undefined): Promise<Webhook>;
|
|
4275
|
+
deletePermission(overwriteID: string, reason?: string): Promise<void>;
|
|
4276
|
+
editPermission(overwriteID: string, allow: PermissionValueTypes, deny: PermissionValueTypes, type: PermissionType, reason?: string): Promise<PermissionOverwrite>;
|
|
4277
|
+
getInvites(): Promise<Invite<"withMetadata", this>[]>;
|
|
4278
|
+
getWebhooks(): Promise<Webhook[]>;
|
|
4279
|
+
join(options?: JoinVoiceChannelOptions): Promise<VoiceConnection>;
|
|
4280
|
+
leave(): void;
|
|
4281
|
+
sendSoundboardSound(options: GuildSoundboardSoundSend): Promise<void>;
|
|
4282
|
+
setStatus(status: string, reason?: string): Promise<void>;
|
|
4283
|
+
}
|
|
4284
|
+
|
|
4285
|
+
export class VoiceConnection extends EventEmitter implements SimpleJSON {
|
|
4286
|
+
bitrate: number;
|
|
4287
|
+
channelID: string | null;
|
|
4288
|
+
channels: number;
|
|
4289
|
+
connecting: boolean;
|
|
4290
|
+
connectionTimeout: NodeJS.Timeout | null;
|
|
4291
|
+
current?: VoiceStreamCurrent | null;
|
|
4292
|
+
daveEnabled: boolean;
|
|
4293
|
+
daveProtocolVersion: number;
|
|
4294
|
+
daveSession: VoiceDaveSession | null;
|
|
4295
|
+
decryptionFailureTolerance: number;
|
|
4296
|
+
ended?: boolean;
|
|
4297
|
+
endpoint: URL;
|
|
4298
|
+
frameDuration: number;
|
|
4299
|
+
frameSize: number;
|
|
4300
|
+
heartbeatInterval: NodeJS.Timeout | null;
|
|
4301
|
+
id: string;
|
|
4302
|
+
mode?: string;
|
|
4303
|
+
modes?: string[];
|
|
4304
|
+
/** Optional dependencies OpusScript (opusscript) or OpusEncoder (@discordjs/opus) */
|
|
4305
|
+
opus: Record<string, unknown>;
|
|
4306
|
+
opusOnly: boolean;
|
|
4307
|
+
paused: boolean;
|
|
4308
|
+
pcmSize: number;
|
|
4309
|
+
piper: Piper;
|
|
4310
|
+
playing: boolean;
|
|
4311
|
+
ready: boolean;
|
|
4312
|
+
receiveStreamOpus?: VoiceDataStream | null;
|
|
4313
|
+
receiveStreamPCM?: VoiceDataStream | null;
|
|
4314
|
+
reconnecting: boolean;
|
|
4315
|
+
resuming: boolean;
|
|
4316
|
+
samplingRate: number;
|
|
4317
|
+
secret?: Buffer;
|
|
4318
|
+
sendHeader: Buffer;
|
|
4319
|
+
sequence: number;
|
|
4320
|
+
sessionID: string | null;
|
|
4321
|
+
shard: Shard | Record<string, never>;
|
|
4322
|
+
shared: boolean;
|
|
4323
|
+
speaking: boolean;
|
|
4324
|
+
ssrc?: number;
|
|
4325
|
+
ssrcUserMap: Record<number, string>;
|
|
4326
|
+
timestamp: number;
|
|
4327
|
+
token: string | null;
|
|
4328
|
+
udpIP?: string;
|
|
4329
|
+
udpPort?: number;
|
|
4330
|
+
udpSocket: DgramSocket | null;
|
|
4331
|
+
voicePrivacyCode: string | null;
|
|
4332
|
+
volume: number;
|
|
4333
|
+
ws: BrowserWebSocket | WebSocket | null;
|
|
4334
|
+
wsSequence: number;
|
|
4335
|
+
constructor(id: string, options?: VoiceConnectionOptions);
|
|
4336
|
+
connect(data: VoiceConnectData): NodeJS.Timer | void;
|
|
4337
|
+
disconnect(error?: Error, reconnecting?: boolean): void;
|
|
4338
|
+
emit<K extends keyof VoiceEvents>(event: K, ...args: VoiceEvents[K]): boolean;
|
|
4339
|
+
emit(event: string, ...args: any[]): boolean;
|
|
4340
|
+
getVerificationCode(userID: string): Promise<string>;
|
|
4341
|
+
heartbeat(): void;
|
|
4342
|
+
off<K extends keyof VoiceEvents>(event: K, listener: (...args: VoiceEvents[K]) => void): this;
|
|
4343
|
+
off(event: string, listener: (...args: any[]) => void): this;
|
|
4344
|
+
once<K extends keyof VoiceEvents>(event: K, listener: (...args: VoiceEvents[K]) => void): this;
|
|
4345
|
+
once(event: string, listener: (...args: any[]) => void): this;
|
|
4346
|
+
pause(): void;
|
|
4347
|
+
play(resource: ReadableStream | string, options?: VoiceResourceOptions): void;
|
|
4348
|
+
receive(type: "opus" | "pcm"): VoiceDataStream;
|
|
4349
|
+
registerReceiveEventHandler(): void;
|
|
4350
|
+
resume(): void;
|
|
4351
|
+
sendAudioFrame(frame: Buffer): void;
|
|
4352
|
+
sendUDPPacket(packet: Buffer): void;
|
|
4353
|
+
sendWS(op: number, data: Record<string, unknown>): void;
|
|
4354
|
+
sendWSBinary(op: number, data: Buffer): void;
|
|
4355
|
+
setSpeaking(value: boolean): void;
|
|
4356
|
+
setVolume(volume: number): void;
|
|
4357
|
+
stopPlaying(): void;
|
|
4358
|
+
switchChannel(channelID: string): void;
|
|
4359
|
+
updateVoiceState(selfMute: boolean, selfDeaf: boolean): void;
|
|
4360
|
+
on<K extends keyof VoiceEvents>(event: K, listener: (...args: VoiceEvents[K]) => void): this;
|
|
4361
|
+
on(event: string, listener: (...args: any[]) => void): this;
|
|
4362
|
+
toJSON(props?: string[]): JSONCache;
|
|
4363
|
+
}
|
|
4364
|
+
|
|
4365
|
+
export class VoiceConnectionManager<T extends VoiceConnection = VoiceConnection> extends Collection<T> implements SimpleJSON {
|
|
4366
|
+
constructor(vcObject: new () => T);
|
|
4367
|
+
join(guildID: string, channelID: string, options: VoiceResourceOptions): Promise<VoiceConnection>;
|
|
4368
|
+
leave(guildID: string): void;
|
|
4369
|
+
switch(guildID: string, channelID: string): void;
|
|
4370
|
+
voiceServerUpdate(data: VoiceServerUpdateData): void;
|
|
4371
|
+
toJSON(props?: string[]): JSONCache;
|
|
4372
|
+
}
|
|
4373
|
+
|
|
4374
|
+
export class VoiceDataStream extends EventEmitter {
|
|
4375
|
+
type: "opus" | "pcm";
|
|
4376
|
+
constructor(type: string);
|
|
4377
|
+
on(event: "data", listener: (data: Buffer, userID: string, timestamp: number, sequence: number) => void): this;
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
export class VoiceState extends Base {
|
|
4381
|
+
channelID: string | null;
|
|
4382
|
+
createdAt: number;
|
|
4383
|
+
deaf: boolean;
|
|
4384
|
+
id: string;
|
|
4385
|
+
mute: boolean;
|
|
4386
|
+
requestToSpeakTimestamp: number | null;
|
|
4387
|
+
selfDeaf: boolean;
|
|
4388
|
+
selfMute: boolean;
|
|
4389
|
+
selfStream: boolean;
|
|
4390
|
+
selfVideo: boolean;
|
|
4391
|
+
sessionID: string | null;
|
|
4392
|
+
suppress: boolean;
|
|
4393
|
+
constructor(data: BaseData);
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
|
|
4397
|
+
export = Eris;
|