@discordeno/bot 18.0.0-next.ad17926 → 19.0.0-next.9d5b8df

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/dist/bot.d.ts CHANGED
@@ -1,815 +1,96 @@
1
- import { calculateShardId, createGatewayManager, CreateShardManager } from '@discordeno/gateway';
2
- import { createRestManager, CreateRestManagerOptions } from '@discordeno/rest';
3
- import { AllowedMentions, BigString, DiscordActivity, DiscordAllowedMentions, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandOption, DiscordApplicationCommandOptionChoice, DiscordAttachment, DiscordAuditLogEntry, DiscordAutoModerationActionExecution, DiscordAutoModerationRule, DiscordChannel, DiscordComponent, DiscordCreateApplicationCommand, DiscordEmbed, DiscordEmoji, DiscordGatewayPayload, DiscordGetGatewayBot, DiscordGuild, DiscordGuildApplicationCommandPermissions, DiscordGuildWidget, DiscordGuildWidgetSettings, DiscordIntegrationCreateUpdate, DiscordInteraction, DiscordInteractionDataOption, DiscordInteractionResponse, DiscordInviteCreate, DiscordMember, DiscordMessage, DiscordPresenceUpdate, DiscordReady, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordTeam, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordVoiceRegion, DiscordVoiceState, DiscordWebhook, DiscordWelcomeScreen, Errors, GatewayDispatchEventNames, GatewayIntents, GetGatewayBot } from '@discordeno/types';
4
- import { bigintToSnowflake, calculateBits, calculatePermissions, Collection, delay, iconBigintToHash, iconHashToBigInt, snowflakeToBigint, urlToBase64, validateLength } from '@discordeno/utils';
5
- import * as handlers from './handlers/index.js';
6
- import * as helpers from './helpers/index.js';
7
- import { Activity, transformActivity } from './transformers/activity.js';
8
- import { Application, transformApplication } from './transformers/application.js';
9
- import { ApplicationCommand, transformApplicationCommand } from './transformers/applicationCommand.js';
10
- import { ApplicationCommandOption } from './transformers/applicationCommandOption.js';
11
- import { ApplicationCommandPermission, transformApplicationCommandPermission } from './transformers/applicationCommandPermission.js';
12
- import { Attachment, transformAttachment } from './transformers/attachment.js';
13
- import { AuditLogEntry, transformAuditLogEntry } from './transformers/auditLogEntry.js';
14
- import { Component } from './transformers/component.js';
15
- import { Embed, transformEmbed } from './transformers/embed.js';
16
- import { Emoji, transformEmoji } from './transformers/emoji.js';
17
- import { ApplicationCommandOptionChoice, AutoModerationActionExecution, AutoModerationRule, Channel, Guild, GuildWidget, GuildWidgetSettings, Integration, Interaction, InteractionDataOption, Invite, Member, Message, PresenceUpdate, Role, ScheduledEvent, StageInstance, Sticker, StickerPack, Team, Template, ThreadMember, transformApplicationCommandOptionChoice, transformAutoModerationActionExecution, transformAutoModerationRule, transformGuild, transformIntegration, transformInteraction, transformInvite, transformMessage, transformPresence, transformStageInstance, transformStickerPack, transformTemplate, transformVoiceRegion, transformWebhook, transformWelcomeScreen, transformWidget, transformWidgetSettings, User, VoiceRegions, VoiceState, Webhook, WelcomeScreen } from './transformers/index.js';
18
- import { CreateApplicationCommand, InteractionResponse } from './types.js';
19
- import { formatImageURL } from './utils/utils.js';
1
+ import type { CreateGatewayManagerOptions, GatewayManager, Shard } from '@discordeno/gateway';
2
+ import type { CreateRestManagerOptions, RestManager } from '@discordeno/rest';
3
+ import type { Camelize, DiscordAutoModerationActionExecution, DiscordAutoModerationRule, DiscordChannel, DiscordChannelPinsUpdate, DiscordGatewayPayload, DiscordGuild, DiscordGuildApplicationCommandPermissions, DiscordGuildBanAddRemove, DiscordGuildEmojisUpdate, DiscordGuildMemberAdd, DiscordGuildMemberRemove, DiscordGuildMembersChunk, DiscordGuildMemberUpdate, DiscordGuildRoleCreate, DiscordGuildRoleDelete, DiscordGuildRoleUpdate, DiscordGuildStickersUpdate, DiscordIntegrationCreateUpdate, DiscordIntegrationDelete, DiscordInteraction, DiscordInviteCreate, DiscordInviteDelete, DiscordMessage, DiscordMessageDelete, DiscordMessageDeleteBulk, DiscordMessageReactionAdd, DiscordMessageReactionRemove, DiscordMessageReactionRemoveAll, DiscordMessageReactionRemoveEmoji, DiscordPresenceUpdate, DiscordReady, DiscordScheduledEvent, DiscordScheduledEventUserAdd, DiscordScheduledEventUserRemove, DiscordStageInstance, DiscordThreadListSync, DiscordThreadMembersUpdate, DiscordThreadMemberUpdate, DiscordTypingStart, DiscordUnavailableGuild, DiscordUser, DiscordVoiceServerUpdate, DiscordVoiceState, DiscordWebhookUpdate } from '@discordeno/types';
4
+ /**
5
+ * Create a bot object that will maintain the rest and gateway connection.
6
+ *
7
+ * @param options Configurations options used to manage this bot.
8
+ * @returns Bot
9
+ */
20
10
  export declare function createBot(options: CreateBotOptions): Bot;
21
- export declare function createEventHandlers(events: Partial<EventHandlers>): EventHandlers;
22
- export declare function startBot(bot: Bot): Promise<void>;
23
- export declare function createUtils(options: Partial<HelperUtils>): {
24
- snowflakeToBigint: typeof snowflakeToBigint;
25
- bigintToSnowflake: typeof bigintToSnowflake;
26
- calculateShardId: typeof calculateShardId;
27
- delay: typeof delay;
28
- iconHashToBigInt: typeof iconHashToBigInt;
29
- iconBigintToHash: typeof iconBigintToHash;
30
- validateLength: typeof validateLength;
31
- urlToBase64: typeof urlToBase64;
32
- formatImageURL: typeof formatImageURL;
33
- calculateBits: typeof calculateBits;
34
- calculatePermissions: typeof calculatePermissions;
35
- };
36
- export interface HelperUtils {
37
- snowflakeToBigint: typeof snowflakeToBigint;
38
- bigintToSnowflake: typeof bigintToSnowflake;
39
- calculateShardId: typeof calculateShardId;
40
- delay: typeof delay;
41
- iconHashToBigInt: typeof iconHashToBigInt;
42
- iconBigintToHash: typeof iconBigintToHash;
43
- validateLength: typeof validateLength;
44
- urlToBase64: typeof urlToBase64;
45
- formatImageURL: typeof formatImageURL;
46
- calculateBits: typeof calculateBits;
47
- calculatePermissions: typeof calculatePermissions;
48
- }
49
- export declare function stopBot(bot: Bot): Promise<Bot>;
50
11
  export interface CreateBotOptions {
12
+ /** The bot's token. */
51
13
  token: string;
52
- botId?: bigint;
53
- applicationId?: bigint;
54
- secretKey?: string;
55
- events?: Partial<EventHandlers>;
56
- intents?: GatewayIntents;
57
- botGatewayData?: GetGatewayBot;
58
- rest?: Omit<CreateRestManagerOptions, 'token'>;
59
- handleDiscordPayload?: CreateShardManager['handleMessage'];
60
- utils?: Partial<ReturnType<typeof createUtils>>;
61
- transformers?: Partial<ReturnType<typeof createTransformers>>;
62
- helpers?: Partial<Helpers>;
14
+ /** Any options you wish to provide to the rest manager. */
15
+ rest?: CreateRestManagerOptions;
16
+ /** Any options you wish to provide to the gateway manager. */
17
+ gateway?: CreateGatewayManagerOptions;
18
+ /** The event handlers. */
19
+ events: Partial<EventHandlers>;
63
20
  }
64
- export type UnPromise<T extends Promise<unknown>> = T extends Promise<infer K> ? K : never;
65
21
  export interface Bot {
66
- id: bigint;
67
- applicationId: bigint;
68
- token: string;
69
- intents: GatewayIntents;
70
- urlWSS: string;
71
- botGatewayData?: GetGatewayBot;
72
- utils: ReturnType<typeof createUtils>;
73
- transformers: Transformers;
74
- helpers: ReturnType<typeof createHelpers>;
75
- rest: ReturnType<typeof createRestManager>;
76
- gateway: ReturnType<typeof createGatewayManager>;
77
- events: EventHandlers;
78
- handlers: ReturnType<typeof createBotGatewayHandlers>;
79
- activeGuildIds: Set<bigint>;
80
- constants: ReturnType<typeof createBotConstants>;
81
- cache: {
82
- unrepliedInteractions: Set<bigint>;
83
- fetchAllMembersProcessingRequests: Map<string, Function>;
84
- };
85
- enabledPlugins: Set<string>;
86
- handleDiscordPayload?: CreateShardManager['handleMessage'];
87
- }
88
- export declare const defaultHelpers: {
89
- followAnnouncementChannel(bot: Bot, sourceChannelId: BigString, targetChannelId: BigString): Promise<bigint>;
90
- createChannel(bot: Bot, guildId: BigString, options: helpers.CreateGuildChannel): Promise<Channel>;
91
- deleteChannel(bot: Bot, channelId: BigString, reason?: string | undefined): Promise<void>;
92
- deleteChannelPermissionOverride(bot: Bot, channelId: BigString, overwriteId: BigString, reason?: string | undefined): Promise<void>;
93
- editChannel(bot: Bot, channelId: BigString, options: helpers.ModifyChannel): Promise<Channel>;
94
- editChannelPermissionOverrides(bot: Bot, channelId: BigString, options: helpers.EditChannelPermissionOverridesOptions): Promise<void>;
95
- editChannelPositions(bot: Bot, guildId: BigString, channelPositions: helpers.ModifyGuildChannelPositions[]): Promise<void>;
96
- swapChannels: typeof helpers.editChannelPositions;
97
- createForumThread(bot: Bot, channelId: BigString, options: helpers.CreateForumPostWithMessage): Promise<Channel>;
98
- getChannel(bot: Bot, channelId: BigString): Promise<Channel>;
99
- getChannelInvites(bot: Bot, channelId: BigString): Promise<Collection<string, helpers.InviteMetadata>>;
100
- getChannels(bot: Bot, guildId: BigString): Promise<Collection<bigint, Channel>>;
101
- createStageInstance(bot: Bot, options: helpers.CreateStageInstance): Promise<StageInstance>;
102
- deleteStageInstance(bot: Bot, channelId: BigString, reason?: string | undefined): Promise<void>;
103
- editStageInstance(bot: Bot, channelId: BigString, data: helpers.EditStageInstanceOptions): Promise<StageInstance>;
104
- getStageInstance(bot: Bot, channelId: BigString): Promise<StageInstance>;
105
- addThreadMember(bot: Bot, channelId: BigString, userId: BigString): Promise<void>;
106
- getActiveThreads(bot: Bot, guildId: BigString): Promise<helpers.ActiveThreads>;
107
- getPrivateArchivedThreads(bot: Bot, channelId: BigString, options?: helpers.ListArchivedThreads | undefined): Promise<helpers.ArchivedThreads>;
108
- getPrivateJoinedArchivedThreads(bot: Bot, channelId: BigString, options?: helpers.ListArchivedThreads | undefined): Promise<helpers.ArchivedThreads>;
109
- getPublicArchivedThreads(bot: Bot, channelId: BigString, options?: helpers.ListArchivedThreads | undefined): Promise<helpers.ArchivedThreads>;
110
- getThreadMember(bot: Bot, channelId: BigString, userId: BigString): Promise<ThreadMember>;
111
- getThreadMembers(bot: Bot, channelId: BigString): Promise<Collection<bigint, ThreadMember>>;
112
- joinThread(bot: Bot, channelId: BigString): Promise<void>;
113
- leaveThread(bot: Bot, channelId: BigString): Promise<void>;
114
- removeThreadMember(bot: Bot, channelId: BigString, userId: BigString): Promise<void>;
115
- startThreadWithMessage(bot: Bot, channelId: BigString, messageId: BigString, options: helpers.StartThreadWithMessage): Promise<Channel>;
116
- startThreadWithoutMessage(bot: Bot, channelId: BigString, options: helpers.StartThreadWithoutMessage): Promise<Channel>;
117
- triggerTypingIndicator(bot: Bot, channelId: BigString): Promise<void>;
118
- startTyping: typeof helpers.triggerTypingIndicator;
119
- createEmoji(bot: Bot, guildId: BigString, options: helpers.CreateGuildEmoji): Promise<Emoji>;
120
- deleteEmoji(bot: Bot, guildId: BigString, id: BigString, reason?: string | undefined): Promise<void>;
121
- editEmoji(bot: Bot, guildId: BigString, id: BigString, options: helpers.ModifyGuildEmoji): Promise<Emoji>;
122
- getEmoji(bot: Bot, guildId: BigString, emojiId: BigString): Promise<Emoji>;
123
- getEmojis(bot: Bot, guildId: BigString): Promise<Collection<bigint, Emoji>>;
124
- getEmojiURL(_bot: Bot, emojiId: BigString, animated?: boolean): string;
125
- createAutomodRule(bot: Bot, guildId: BigString, options: helpers.CreateAutoModerationRuleOptions): Promise<AutoModerationRule>;
126
- deleteAutomodRule(bot: Bot, guildId: BigString, ruleId: BigString, reason?: string | undefined): Promise<void>;
127
- editAutomodRule(bot: Bot, guildId: BigString, ruleId: BigString, options: Partial<helpers.EditAutoModerationRuleOptions>): Promise<AutoModerationRule>;
128
- getAutomodRule(bot: Bot, guildId: BigString, ruleId: BigString): Promise<AutoModerationRule>;
129
- getAutomodRules(bot: Bot, guildId: BigString): Promise<Collection<bigint, AutoModerationRule>>;
130
- createGuild(bot: Bot, options: helpers.CreateGuild): Promise<Guild>;
131
- deleteGuild(bot: Bot, guildId: BigString): Promise<void>;
132
- editGuild(bot: Bot, guildId: BigString, options: helpers.ModifyGuild, shardId: number): Promise<Guild>;
133
- editGuildMfaLevel(bot: Bot, guildId: BigString, mfaLevel: import("@discordeno/gateway").MfaLevels, reason?: string | undefined): Promise<void>;
134
- editWelcomeScreen(bot: Bot, guildId: BigString, options: helpers.ModifyGuildWelcomeScreen): Promise<WelcomeScreen>;
135
- createScheduledEvent(bot: Bot, guildId: BigString, options: helpers.CreateScheduledEvent): Promise<ScheduledEvent>;
136
- deleteScheduledEvent(bot: Bot, guildId: BigString, eventId: BigString): Promise<void>;
137
- editScheduledEvent(bot: Bot, guildId: BigString, eventId: BigString, options: Partial<helpers.EditScheduledEvent>): Promise<ScheduledEvent>;
138
- getScheduledEvent(bot: Bot, guildId: BigString, eventId: BigString, options?: {
139
- withUserCount?: boolean | undefined;
140
- } | undefined): Promise<ScheduledEvent>;
141
- getScheduledEvents(bot: Bot, guildId: BigString, options?: helpers.GetScheduledEvents | undefined): Promise<Collection<bigint, ScheduledEvent>>;
142
- getScheduledEventUsers(bot: Bot, guildId: BigString, eventId: BigString, options?: (helpers.GetScheduledEventUsers & {
143
- withMember?: false | undefined;
144
- }) | undefined): Promise<Collection<bigint, User>>;
145
- getScheduledEventUsers(bot: Bot, guildId: BigString, eventId: BigString, options?: (helpers.GetScheduledEventUsers & {
146
- withMember: true;
147
- }) | undefined): Promise<Collection<bigint, {
148
- user: User;
149
- member: Member;
150
- }>>;
151
- getAuditLog(bot: Bot, guildId: BigString, options?: helpers.GetGuildAuditLog | undefined): Promise<helpers.AuditLog>;
152
- getBan(bot: Bot, guildId: BigString, userId: BigString): Promise<helpers.Ban>;
153
- getBans(bot: Bot, guildId: BigString, options?: helpers.GetBans | undefined): Promise<Collection<bigint, helpers.Ban>>;
154
- getGuild(bot: Bot, guildId: BigString, options?: {
155
- counts?: boolean | undefined;
156
- }): Promise<Guild>;
157
- getGuildBannerURL(bot: Bot, guildId: BigString, options: {
158
- banner?: string | bigint | undefined;
159
- size?: import("@discordeno/gateway").ImageSize | undefined;
160
- format?: import("@discordeno/gateway").ImageFormat | undefined;
161
- }): string | undefined;
162
- getGuildIconURL(bot: Bot, guildId: BigString, imageHash: BigString | undefined, options?: {
163
- size?: import("@discordeno/gateway").ImageSize | undefined;
164
- format?: import("@discordeno/gateway").ImageFormat | undefined;
165
- } | undefined): string | undefined;
166
- getGuildPreview(bot: Bot, guildId: BigString): Promise<helpers.GuildPreview>;
167
- getGuildSplashURL(bot: Bot, guildId: BigString, imageHash: BigString | undefined, options?: {
168
- size?: import("@discordeno/gateway").ImageSize | undefined;
169
- format?: import("@discordeno/gateway").ImageFormat | undefined;
170
- } | undefined): string | undefined;
171
- getPruneCount(bot: Bot, guildId: BigString, options?: helpers.GetGuildPruneCountQuery | undefined): Promise<number>;
172
- getVanityUrl(bot: Bot, guildId: BigString): Promise<helpers.VanityUrl>;
173
- getWelcomeScreen(bot: Bot, guildId: BigString): Promise<WelcomeScreen>;
174
- deleteIntegration(bot: Bot, guildId: BigString, integrationId: BigString): Promise<void>;
175
- getIntegrations(bot: Bot, guildId: BigString): Promise<Collection<bigint, Integration>>;
176
- createInvite(bot: Bot, channelId: BigString, options?: helpers.CreateChannelInvite): Promise<helpers.BaseInvite>;
177
- deleteInvite(bot: Bot, inviteCode: string, reason?: string | undefined): Promise<void>;
178
- getInvite(bot: Bot, inviteCode: string, options?: helpers.GetInvite | undefined): Promise<helpers.BaseInvite>;
179
- getInvites(bot: Bot, guildId: BigString): Promise<Collection<string, helpers.InviteMetadata>>;
180
- leaveGuild(bot: Bot, guildId: BigString): Promise<void>;
181
- connectToVoiceChannel(bot: Bot, guildId: BigString, channelId: BigString, options?: import("@discordeno/gateway").AtLeastOne<Omit<helpers.UpdateVoiceState, "guildId" | "channelId">, {
182
- selfMute: Pick<Omit<helpers.UpdateVoiceState, "guildId" | "channelId">, "selfMute">;
183
- selfDeaf: Pick<Omit<helpers.UpdateVoiceState, "guildId" | "channelId">, "selfDeaf">;
184
- }> | undefined): Promise<void>;
185
- editOwnVoiceState(bot: Bot, guildId: BigString, options: helpers.EditOwnVoiceState): Promise<void>;
186
- editUserVoiceState(bot: Bot, guildId: BigString, options: helpers.EditUserVoiceState): Promise<void>;
187
- updateBotVoiceState: typeof helpers.editOwnVoiceState;
188
- getAvailableVoiceRegions(bot: Bot): Promise<Collection<string, VoiceRegions>>;
189
- getVoiceRegions(bot: Bot, guildId: BigString): Promise<Collection<string, VoiceRegions>>;
190
- leaveVoiceChannel(bot: Bot, guildId: BigString): Promise<void>;
191
- editWidgetSettings(bot: Bot, guildId: BigString, enabled: boolean, channelId?: string | null | undefined): Promise<GuildWidgetSettings>;
192
- getWidget(bot: Bot, guildId: BigString): Promise<GuildWidget>;
193
- getWidgetImageURL(bot: Bot, guildId: BigString, options?: helpers.GetGuildWidgetImageQuery | undefined): string;
194
- getWidgetSettings(bot: Bot, guildId: BigString): Promise<GuildWidgetSettings>;
195
- createGlobalApplicationCommand(bot: Bot, command: CreateApplicationCommand): Promise<ApplicationCommand>;
196
- createGuildApplicationCommand(bot: Bot, command: CreateApplicationCommand, guildId: BigString): Promise<ApplicationCommand>;
197
- deleteGlobalApplicationCommand(bot: Bot, commandId: BigString): Promise<void>;
198
- deleteGuildApplicationCommand(bot: Bot, commandId: BigString, guildId: BigString): Promise<void>;
199
- editApplicationCommandPermissions(bot: Bot, guildId: BigString, commandId: BigString, bearerToken: string, options: helpers.ApplicationCommandPermissions[]): Promise<ApplicationCommandPermission>;
200
- editGlobalApplicationCommand(bot: Bot, commandId: BigString, options: CreateApplicationCommand): Promise<ApplicationCommand>;
201
- editGuildApplicationCommand(bot: Bot, commandId: BigString, guildId: BigString, options: CreateApplicationCommand): Promise<ApplicationCommand>;
202
- getApplicationCommandPermission(bot: Bot, guildId: BigString, commandId: BigString): Promise<ApplicationCommandPermission>;
203
- getApplicationCommandPermissions(bot: Bot, guildId: BigString): Promise<Collection<bigint, ApplicationCommandPermission>>;
204
- getGlobalApplicationCommand(bot: Bot, commandId: BigString): Promise<ApplicationCommand>;
205
- getGlobalApplicationCommands(bot: Bot): Promise<Collection<bigint, ApplicationCommand>>;
206
- getGuildApplicationCommand(bot: Bot, commandId: BigString, guildId: BigString): Promise<ApplicationCommand>;
207
- getGuildApplicationCommands(bot: Bot, guildId: BigString): Promise<Collection<bigint, ApplicationCommand>>;
208
- upsertGlobalApplicationCommands(bot: Bot, commands: CreateApplicationCommand[]): Promise<Collection<bigint, ApplicationCommand>>;
209
- upsertGuildApplicationCommands(bot: Bot, guildId: BigString, commands: CreateApplicationCommand[]): Promise<Collection<bigint, ApplicationCommand>>;
210
- deleteFollowupMessage(bot: Bot, token: string, messageId: BigString): Promise<void>;
211
- deleteOriginalInteractionResponse(bot: Bot, token: string): Promise<void>;
212
- editFollowupMessage(bot: Bot, token: string, messageId: BigString, options: import("./types.js").InteractionCallbackData): Promise<Message>;
213
- editOriginalInteractionResponse(bot: Bot, token: string, options: import("./types.js").InteractionCallbackData): Promise<Message | undefined>;
214
- getFollowupMessage(bot: Bot, token: string, messageId: BigString): Promise<Message>;
215
- getOriginalInteractionResponse(bot: Bot, token: string): Promise<Message>;
216
- sendFollowupMessage(bot: Bot, token: string, options: InteractionResponse): Promise<Message>;
217
- sendInteractionResponse(bot: Bot, interactionId: BigString, token: string, options: InteractionResponse): Promise<void>;
218
- banMember(bot: Bot, guildId: BigString, userId: BigString, options?: helpers.CreateGuildBan | undefined): Promise<void>;
219
- editBotMember(bot: Bot, guildId: BigString, options: helpers.EditBotMemberOptions): Promise<Member>;
220
- editMember(bot: Bot, guildId: BigString, userId: BigString, options: helpers.ModifyGuildMember): Promise<Member>;
221
- fetchMembers(bot: Bot, guildId: BigString, options?: Omit<helpers.RequestGuildMembers, "guildId"> | undefined): Promise<void>;
222
- getAvatarURL(bot: Bot, userId: BigString, discriminator: string, options?: {
223
- avatar: BigString | undefined;
224
- size?: import("@discordeno/gateway").ImageSize | undefined;
225
- format?: import("@discordeno/gateway").ImageFormat | undefined;
226
- } | undefined): string;
227
- getDmChannel(bot: Bot, userId: BigString): Promise<Channel>;
228
- getMember(bot: Bot, guildId: BigString, userId: BigString): Promise<Member>;
229
- getMembers(bot: Bot, guildId: BigString, options: helpers.ListGuildMembers): Promise<Collection<bigint, Member>>;
230
- kickMember(bot: Bot, guildId: BigString, userId: BigString, reason?: string | undefined): Promise<void>;
231
- pruneMembers(bot: Bot, guildId: BigString, options: helpers.BeginGuildPrune): Promise<number | undefined>;
232
- searchMembers(bot: Bot, guildId: BigString, query: string, options?: Omit<import("@discordeno/gateway").SearchMembers, "query"> | undefined): Promise<Collection<bigint, Member>>;
233
- unbanMember(bot: Bot, guildId: BigString, userId: BigString): Promise<void>;
234
- crosspostMessage(bot: Bot, channelId: BigString, messageId: BigString): Promise<Message>;
235
- publishMessage: typeof helpers.crosspostMessage;
236
- deleteMessage(bot: Bot, channelId: BigString, messageId: BigString, reason?: string | undefined, delayMilliseconds?: number): Promise<void>;
237
- deleteMessages(bot: Bot, channelId: BigString, messageIds: BigString[], reason?: string | undefined): Promise<void>;
238
- editMessage(bot: Bot, channelId: BigString, messageId: BigString, options: helpers.EditMessage): Promise<Message>;
239
- getMessage(bot: Bot, channelId: BigString, messageId: BigString): Promise<Message>;
240
- getMessages(bot: Bot, channelId: BigString, options?: helpers.GetMessagesOptions | undefined): Promise<Collection<bigint, Message>>;
241
- isGetMessagesAfter(options: helpers.GetMessagesOptions): options is helpers.GetMessagesAfter;
242
- isGetMessagesBefore(options: helpers.GetMessagesOptions): options is helpers.GetMessagesBefore;
243
- isGetMessagesAround(options: helpers.GetMessagesOptions): options is helpers.GetMessagesAround;
244
- isGetMessagesLimit(options: helpers.GetMessagesOptions): options is helpers.GetMessagesLimit;
245
- getPinnedMessages(bot: Bot, channelId: BigString): Promise<Collection<bigint, Message>>;
246
- pinMessage(bot: Bot, channelId: BigString, messageId: BigString, reason?: string | undefined): Promise<void>;
247
- addReaction(bot: Bot, channelId: BigString, messageId: BigString, reaction: string): Promise<void>;
248
- addReactions(bot: Bot, channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean): Promise<void>;
249
- deleteOwnReaction(bot: Bot, channelId: BigString, messageId: BigString, reaction: string): Promise<void>;
250
- deleteUserReaction(bot: Bot, channelId: BigString, messageId: BigString, userId: BigString, reaction: string): Promise<void>;
251
- deleteReactionsAll(bot: Bot, channelId: BigString, messageId: BigString): Promise<void>;
252
- deleteReactionsEmoji(bot: Bot, channelId: BigString, messageId: BigString, reaction: string): Promise<void>;
253
- getReactions(bot: Bot, channelId: BigString, messageId: BigString, reaction: string, options?: helpers.GetReactions | undefined): Promise<Collection<bigint, User>>;
254
- processReactionString(reaction: string): string;
255
- sendMessage(bot: Bot, channelId: BigString, options: helpers.CreateMessage): Promise<Message>;
256
- unpinMessage(bot: Bot, channelId: BigString, messageId: BigString, reason?: string | undefined): Promise<void>;
257
- editBotProfile(bot: Bot, options: {
258
- username?: string | undefined;
259
- botAvatarURL?: string | null | undefined;
260
- }): Promise<User>;
261
- editBotStatus(bot: Bot, data: helpers.StatusUpdate): Promise<void>;
262
- editShardStatus(bot: Bot, shardId: number, data: helpers.StatusUpdate): Promise<void>;
263
- getApplicationInfo(bot: Bot): Promise<Application>;
264
- getGatewayBot(bot: Bot): Promise<GetGatewayBot>;
265
- getNitroStickerPacks(bot: Bot): Promise<Collection<bigint, StickerPack>>;
266
- getUser(bot: Bot, userId: BigString): Promise<User>;
267
- addRole(bot: Bot, guildId: BigString, userId: BigString, roleId: BigString, reason?: string | undefined): Promise<void>;
268
- createRole(bot: Bot, guildId: BigString, options: helpers.CreateGuildRole, reason?: string | undefined): Promise<Role>;
269
- deleteRole(bot: Bot, guildId: BigString, roleId: BigString): Promise<void>;
270
- editRole(bot: Bot, guildId: BigString, roleId: BigString, options: helpers.EditGuildRole): Promise<Role>;
271
- modifyRolePositions(bot: Bot, guildId: BigString, options: helpers.ModifyRolePositions[]): Promise<Collection<bigint, Role>>;
272
- getRoles(bot: Bot, guildId: BigString): Promise<Collection<bigint, Role>>;
273
- removeRole(bot: Bot, guildId: BigString, userId: BigString, roleId: BigString, reason?: string | undefined): Promise<void>;
274
- createGuildSticker(bot: Bot, guildId: bigint, options: helpers.CreateGuildStickerOptions): Promise<Sticker>;
275
- deleteGuildSticker(bot: Bot, guildId: bigint, stickerId: bigint, reason?: string | undefined): Promise<void>;
276
- editGuildSticker(bot: Bot, guildId: bigint, stickerId: bigint, options: import("@discordeno/gateway").AtLeastOne<helpers.EditGuildStickerOptions, {
277
- name?: Pick<helpers.EditGuildStickerOptions, "name"> | undefined;
278
- description?: Pick<helpers.EditGuildStickerOptions, "description"> | undefined;
279
- tags?: Pick<helpers.EditGuildStickerOptions, "tags"> | undefined;
280
- reason?: Pick<helpers.EditGuildStickerOptions, "reason"> | undefined;
281
- }>): Promise<Sticker>;
282
- getGuildSticker(bot: Bot, guildId: bigint, stickerId: bigint): Promise<Sticker>;
283
- getGuildStickers(bot: Bot, guildId: bigint): Promise<Collection<bigint, Sticker>>;
284
- getSticker(bot: Bot, stickerId: bigint): Promise<Sticker>;
285
- createGuildFromTemplate(bot: Bot, templateCode: string, options: helpers.CreateGuildFromTemplate): Promise<Guild>;
286
- createGuildTemplate(bot: Bot, guildId: BigString, options: helpers.CreateTemplate): Promise<Template>;
287
- deleteGuildTemplate(bot: Bot, guildId: BigString, templateCode: string): Promise<void>;
288
- editGuildTemplate(bot: Bot, guildId: BigString, templateCode: string, options: helpers.ModifyGuildTemplate): Promise<Template>;
289
- getGuildTemplate(bot: Bot, templateCode: string): Promise<Template>;
290
- getGuildTemplates(bot: Bot, guildId: BigString): Promise<Collection<string, Template>>;
291
- syncGuildTemplate(bot: Bot, guildId: BigString, templateCode: string): Promise<Template>;
292
- createWebhook(bot: Bot, channelId: BigString, options: helpers.CreateWebhook): Promise<Webhook>;
293
- deleteWebhook(bot: Bot, webhookId: BigString, reason?: string | undefined): Promise<void>;
294
- deleteWebhookMessage(bot: Bot, webhookId: BigString, token: string, messageId: BigString, options?: helpers.DeleteWebhookMessageOptions | undefined): Promise<void>;
295
- deleteWebhookWithToken(bot: Bot, webhookId: BigString, token: string): Promise<void>;
296
- editOriginalWebhookMessage(bot: Bot, webhookId: BigString, token: string, options: import("./types.js").InteractionCallbackData & {
297
- threadId?: BigString | undefined;
298
- }): Promise<Message>;
299
- editWebhook(bot: Bot, webhookId: BigString, options: helpers.ModifyWebhook): Promise<Webhook>;
300
- editWebhookMessage(bot: Bot, webhookId: BigString, token: string, messageId: BigString, options: import("./types.js").InteractionCallbackData & {
301
- threadId?: BigString | undefined;
302
- }): Promise<Message>;
303
- editWebhookWithToken(bot: Bot, webhookId: BigString, token: string, options: Omit<helpers.ModifyWebhook, "channelId">): Promise<Webhook>;
304
- executeWebhook(bot: Bot, webhookId: BigString, token: string, options: helpers.ExecuteWebhook): Promise<Message | undefined>;
305
- sendWebhookMessage: typeof helpers.executeWebhook;
306
- getChannelWebhooks(bot: Bot, channelId: BigString): Promise<Collection<bigint, Webhook>>;
307
- getGuildWebhooks(bot: Bot, guildId: BigString): Promise<Collection<bigint, Webhook>>;
308
- getWebhook(bot: Bot, webhookId: BigString): Promise<Webhook>;
309
- getWebhookMessage(bot: Bot, webhookId: BigString, token: string, messageId: BigString, options?: helpers.GetWebhookMessageOptions | undefined): Promise<Message>;
310
- getWebhookWithToken(bot: Bot, webhookId: BigString, token: string): Promise<Webhook>;
311
- };
312
- export type DefaultHelpers = typeof defaultHelpers;
313
- export interface Helpers extends DefaultHelpers {
22
+ /** The rest manager. */
23
+ rest: RestManager;
24
+ /** The gateway manager. */
25
+ gateway: GatewayManager;
26
+ /** The event handlers. */
27
+ events: Partial<EventHandlers>;
28
+ /** Start the bot connection to the gateway. */
29
+ start: () => Promise<void>;
30
+ /** Shuts down all the bot connections to the gateway. */
31
+ shutdown: () => Promise<void>;
314
32
  }
315
- export declare function createHelpers(bot: Bot, customHelpers?: Partial<Helpers>): FinalHelpers;
316
- export declare function createBaseHelpers(options: Partial<Helpers>): DefaultHelpers & Partial<Helpers>;
317
- export interface Transformers {
318
- reverse: {
319
- allowedMentions: (bot: Bot, payload: AllowedMentions) => DiscordAllowedMentions;
320
- embed: (bot: Bot, payload: Embed) => DiscordEmbed;
321
- component: (bot: Bot, payload: Component) => DiscordComponent;
322
- activity: (bot: Bot, payload: Activity) => DiscordActivity;
323
- member: (bot: Bot, payload: Member) => DiscordMember;
324
- user: (bot: Bot, payload: User) => DiscordUser;
325
- team: (bot: Bot, payload: Team) => DiscordTeam;
326
- application: (bot: Bot, payload: Application) => DiscordApplication;
327
- snowflake: (snowflake: BigString) => string;
328
- createApplicationCommand: (bot: Bot, payload: CreateApplicationCommand) => DiscordCreateApplicationCommand;
329
- applicationCommand: (bot: Bot, payload: ApplicationCommand) => DiscordApplicationCommand;
330
- applicationCommandOption: (bot: Bot, payload: ApplicationCommandOption) => DiscordApplicationCommandOption;
331
- applicationCommandOptionChoice: (bot: Bot, payload: ApplicationCommandOptionChoice) => DiscordApplicationCommandOptionChoice;
332
- interactionResponse: (bot: Bot, payload: InteractionResponse) => DiscordInteractionResponse;
333
- attachment: (bot: Bot, payload: Attachment) => DiscordAttachment;
334
- };
335
- snowflake: (snowflake: BigString) => bigint;
336
- gatewayBot: (payload: DiscordGetGatewayBot) => GetGatewayBot;
337
- automodRule: (bot: Bot, payload: DiscordAutoModerationRule) => AutoModerationRule;
338
- automodActionExecution: (bot: Bot, payload: DiscordAutoModerationActionExecution) => AutoModerationActionExecution;
339
- channel: (bot: Bot, payload: {
340
- channel: DiscordChannel;
341
- } & {
342
- guildId?: bigint;
343
- }) => Channel;
344
- guild: (bot: Bot, payload: {
345
- guild: DiscordGuild;
346
- } & {
347
- shardId: number;
348
- }) => Guild;
349
- user: (bot: Bot, payload: DiscordUser) => User;
350
- member: (bot: Bot, payload: DiscordMember, guildId: bigint, userId: bigint) => Member;
351
- message: (bot: Bot, payload: DiscordMessage) => Message;
352
- role: (bot: Bot, payload: {
353
- role: DiscordRole;
354
- } & {
355
- guildId: bigint;
356
- }) => Role;
357
- voiceState: (bot: Bot, payload: {
358
- voiceState: DiscordVoiceState;
359
- } & {
360
- guildId: bigint;
361
- }) => VoiceState;
362
- interaction: (bot: Bot, payload: DiscordInteraction) => Interaction;
363
- interactionDataOptions: (bot: Bot, payload: DiscordInteractionDataOption) => InteractionDataOption;
364
- integration: (bot: Bot, payload: DiscordIntegrationCreateUpdate) => Integration;
365
- invite: (bot: Bot, invite: DiscordInviteCreate) => Invite;
366
- application: (bot: Bot, payload: DiscordApplication) => Application;
367
- team: (bot: Bot, payload: DiscordTeam) => Team;
368
- emoji: (bot: Bot, payload: DiscordEmoji) => Emoji;
369
- activity: (bot: Bot, payload: DiscordActivity) => Activity;
370
- presence: (bot: Bot, payload: DiscordPresenceUpdate) => PresenceUpdate;
371
- attachment: (bot: Bot, payload: DiscordAttachment) => Attachment;
372
- embed: (bot: Bot, payload: DiscordEmbed) => Embed;
373
- component: (bot: Bot, payload: DiscordComponent) => Component;
374
- webhook: (bot: Bot, payload: DiscordWebhook) => Webhook;
375
- auditLogEntry: (bot: Bot, payload: DiscordAuditLogEntry) => AuditLogEntry;
376
- applicationCommand: (bot: Bot, payload: DiscordApplicationCommand) => ApplicationCommand;
377
- applicationCommandOption: (bot: Bot, payload: DiscordApplicationCommandOption) => ApplicationCommandOption;
378
- applicationCommandPermission: (bot: Bot, payload: DiscordGuildApplicationCommandPermissions) => ApplicationCommandPermission;
379
- scheduledEvent: (bot: Bot, payload: DiscordScheduledEvent) => ScheduledEvent;
380
- threadMember: (bot: Bot, payload: DiscordThreadMember) => ThreadMember;
381
- welcomeScreen: (bot: Bot, payload: DiscordWelcomeScreen) => WelcomeScreen;
382
- voiceRegion: (bot: Bot, payload: DiscordVoiceRegion) => VoiceRegions;
383
- widget: (bot: Bot, payload: DiscordGuildWidget) => GuildWidget;
384
- widgetSettings: (bot: Bot, payload: DiscordGuildWidgetSettings) => GuildWidgetSettings;
385
- stageInstance: (bot: Bot, payload: DiscordStageInstance) => StageInstance;
386
- sticker: (bot: Bot, payload: DiscordSticker) => Sticker;
387
- stickerPack: (bot: Bot, payload: DiscordStickerPack) => StickerPack;
388
- applicationCommandOptionChoice: (bot: Bot, payload: DiscordApplicationCommandOptionChoice) => ApplicationCommandOptionChoice;
389
- template: (bot: Bot, payload: DiscordTemplate) => Template;
390
- }
391
- export declare function createTransformers(options: Partial<Transformers>): {
392
- reverse: {
393
- allowedMentions: (bot: Bot, payload: AllowedMentions) => DiscordAllowedMentions;
394
- embed: (bot: Bot, payload: Embed) => DiscordEmbed;
395
- component: (bot: Bot, payload: Component) => DiscordComponent;
396
- activity: (bot: Bot, payload: Activity) => DiscordActivity;
397
- member: (bot: Bot, payload: Member) => DiscordMember;
398
- user: (bot: Bot, payload: User) => DiscordUser;
399
- team: (bot: Bot, payload: Team) => DiscordTeam;
400
- application: (bot: Bot, payload: Application) => DiscordApplication;
401
- snowflake: typeof bigintToSnowflake;
402
- createApplicationCommand: (bot: Bot, payload: CreateApplicationCommand) => DiscordCreateApplicationCommand;
403
- applicationCommand: (bot: Bot, payload: ApplicationCommand) => DiscordApplicationCommand;
404
- applicationCommandOption: (bot: Bot, payload: ApplicationCommandOption) => DiscordApplicationCommandOption;
405
- applicationCommandOptionChoice: (bot: Bot, payload: ApplicationCommandOptionChoice) => DiscordApplicationCommandOptionChoice;
406
- interactionResponse: (bot: Bot, payload: InteractionResponse) => DiscordInteractionResponse;
407
- attachment: (bot: Bot, payload: Attachment) => DiscordAttachment;
408
- };
409
- automodRule: typeof transformAutoModerationRule;
410
- automodActionExecution: typeof transformAutoModerationActionExecution;
411
- activity: typeof transformActivity;
412
- application: typeof transformApplication;
413
- attachment: typeof transformAttachment;
414
- channel: (bot: Bot, payload: {
415
- channel: DiscordChannel;
416
- } & {
417
- guildId?: bigint | undefined;
418
- }) => Channel;
419
- component: (bot: Bot, payload: DiscordComponent) => Component;
420
- embed: typeof transformEmbed;
421
- emoji: typeof transformEmoji;
422
- guild: typeof transformGuild;
423
- integration: typeof transformIntegration;
424
- interaction: typeof transformInteraction;
425
- interactionDataOptions: (bot: Bot, payload: DiscordInteractionDataOption) => InteractionDataOption;
426
- invite: typeof transformInvite;
427
- member: (bot: Bot, payload: DiscordMember, guildId: bigint, userId: bigint) => Member;
428
- message: typeof transformMessage;
429
- presence: typeof transformPresence;
430
- role: (bot: Bot, payload: {
431
- role: DiscordRole;
432
- } & {
433
- guildId: bigint;
434
- }) => Role;
435
- user: (bot: Bot, payload: DiscordUser) => User;
436
- team: (bot: Bot, payload: DiscordTeam) => Team;
437
- voiceState: (bot: Bot, payload: {
438
- voiceState: DiscordVoiceState;
439
- } & {
440
- guildId: bigint;
441
- }) => VoiceState;
442
- snowflake: (snowflake: BigString) => bigint;
443
- webhook: typeof transformWebhook;
444
- auditLogEntry: typeof transformAuditLogEntry;
445
- applicationCommand: typeof transformApplicationCommand;
446
- applicationCommandOption: (bot: Bot, payload: DiscordApplicationCommandOption) => ApplicationCommandOption;
447
- applicationCommandPermission: typeof transformApplicationCommandPermission;
448
- scheduledEvent: (bot: Bot, payload: DiscordScheduledEvent) => ScheduledEvent;
449
- threadMember: (bot: Bot, payload: DiscordThreadMember) => ThreadMember;
450
- welcomeScreen: typeof transformWelcomeScreen;
451
- voiceRegion: typeof transformVoiceRegion;
452
- widget: typeof transformWidget;
453
- widgetSettings: typeof transformWidgetSettings;
454
- stageInstance: typeof transformStageInstance;
455
- sticker: (bot: Bot, payload: DiscordSticker) => Sticker;
456
- stickerPack: typeof transformStickerPack;
457
- gatewayBot: (payload: DiscordGetGatewayBot) => GetGatewayBot;
458
- applicationCommandOptionChoice: typeof transformApplicationCommandOptionChoice;
459
- template: typeof transformTemplate;
460
- };
461
33
  export interface EventHandlers {
462
- debug: (text: string, ...args: any[]) => unknown;
463
- automodRuleCreate: (bot: Bot, rule: AutoModerationRule) => unknown;
464
- automodRuleUpdate: (bot: Bot, rule: AutoModerationRule) => unknown;
465
- automodRuleDelete: (bot: Bot, rule: AutoModerationRule) => unknown;
466
- automodActionExecution: (bot: Bot, payload: AutoModerationActionExecution) => unknown;
467
- threadCreate: (bot: Bot, thread: Channel) => unknown;
468
- threadDelete: (bot: Bot, thread: Channel) => unknown;
469
- threadMemberUpdate: (bot: Bot, payload: {
470
- id: bigint;
471
- guildId: bigint;
472
- joinedAt: number;
473
- flags: number;
474
- }) => unknown;
475
- threadMembersUpdate: (bot: Bot, payload: {
476
- id: bigint;
477
- guildId: bigint;
478
- addedMembers?: ThreadMember[];
479
- removedMemberIds?: bigint[];
480
- }) => unknown;
481
- threadUpdate: (bot: Bot, thread: Channel) => unknown;
482
- scheduledEventCreate: (bot: Bot, event: ScheduledEvent) => unknown;
483
- scheduledEventUpdate: (bot: Bot, event: ScheduledEvent) => unknown;
484
- scheduledEventDelete: (bot: Bot, event: ScheduledEvent) => unknown;
485
- /** Sent when a user has subscribed to a guild scheduled event. EXPERIMENTAL! */
486
- scheduledEventUserAdd: (bot: Bot, payload: {
487
- guildScheduledEventId: bigint;
488
- guildId: bigint;
489
- userId: bigint;
490
- }) => unknown;
491
- /** Sent when a user has unsubscribed to a guild scheduled event. EXPERIMENTAL! */
492
- scheduledEventUserRemove: (bot: Bot, payload: {
493
- guildScheduledEventId: bigint;
494
- guildId: bigint;
495
- userId: bigint;
496
- }) => unknown;
497
- ready: (bot: Bot, payload: {
498
- shardId: number;
499
- v: number;
500
- user: User;
501
- guilds: bigint[];
502
- sessionId: string;
503
- shard?: number[];
504
- applicationId: bigint;
505
- }, rawPayload: DiscordReady) => unknown;
506
- interactionCreate: (bot: Bot, interaction: Interaction) => unknown;
507
- integrationCreate: (bot: Bot, integration: Integration) => unknown;
508
- integrationDelete: (bot: Bot, payload: {
509
- id: bigint;
510
- guildId: bigint;
511
- applicationId?: bigint;
512
- }) => unknown;
513
- integrationUpdate: (bot: Bot, payload: {
514
- guildId: bigint;
515
- }) => unknown;
516
- inviteCreate: (bot: Bot, invite: Invite) => unknown;
517
- inviteDelete: (bot: Bot, payload: {
518
- channelId: bigint;
519
- guildId?: bigint;
520
- code: string;
521
- }) => unknown;
522
- guildMemberAdd: (bot: Bot, member: Member, user: User) => unknown;
523
- guildMemberRemove: (bot: Bot, user: User, guildId: bigint) => unknown;
524
- guildMemberUpdate: (bot: Bot, member: Member, user: User) => unknown;
525
- messageCreate: (bot: Bot, message: Message) => unknown;
526
- messageDelete: (bot: Bot, payload: {
527
- id: bigint;
528
- channelId: bigint;
529
- guildId?: bigint;
530
- }, message?: Message) => unknown;
531
- messageDeleteBulk: (bot: Bot, payload: {
532
- ids: bigint[];
533
- channelId: bigint;
534
- guildId?: bigint;
535
- }) => unknown;
536
- messageUpdate: (bot: Bot, message: Message, oldMessage?: Message) => unknown;
537
- reactionAdd: (bot: Bot, payload: {
538
- userId: bigint;
539
- channelId: bigint;
540
- messageId: bigint;
541
- guildId?: bigint;
542
- member?: Member;
543
- user?: User;
544
- emoji: Emoji;
545
- }) => unknown;
546
- reactionRemove: (bot: Bot, payload: {
547
- userId: bigint;
548
- channelId: bigint;
549
- messageId: bigint;
550
- guildId?: bigint;
551
- emoji: Emoji;
552
- }) => unknown;
553
- reactionRemoveEmoji: (bot: Bot, payload: {
554
- channelId: bigint;
555
- messageId: bigint;
556
- guildId?: bigint;
557
- emoji: Emoji;
558
- }) => unknown;
559
- reactionRemoveAll: (bot: Bot, payload: {
560
- channelId: bigint;
561
- messageId: bigint;
562
- guildId?: bigint;
563
- }) => unknown;
564
- presenceUpdate: (bot: Bot, presence: PresenceUpdate, oldPresence?: PresenceUpdate) => unknown;
565
- voiceServerUpdate: (bot: Bot, payload: {
566
- token: string;
567
- endpoint?: string;
568
- guildId: bigint;
569
- }) => unknown;
570
- voiceStateUpdate: (bot: Bot, voiceState: VoiceState) => unknown;
571
- channelCreate: (bot: Bot, channel: Channel) => unknown;
572
- dispatchRequirements: (bot: Bot, data: DiscordGatewayPayload, shardId: number) => unknown;
573
- channelDelete: (bot: Bot, channel: Channel) => unknown;
574
- channelPinsUpdate: (bot: Bot, data: {
575
- guildId?: bigint;
576
- channelId: bigint;
577
- lastPinTimestamp?: number;
578
- }) => unknown;
579
- channelUpdate: (bot: Bot, channel: Channel) => unknown;
580
- stageInstanceCreate: (bot: Bot, data: {
581
- id: bigint;
582
- guildId: bigint;
583
- channelId: bigint;
584
- topic: string;
585
- }) => unknown;
586
- stageInstanceDelete: (bot: Bot, data: {
587
- id: bigint;
588
- guildId: bigint;
589
- channelId: bigint;
590
- topic: string;
591
- }) => unknown;
592
- stageInstanceUpdate: (bot: Bot, data: {
593
- id: bigint;
594
- guildId: bigint;
595
- channelId: bigint;
596
- topic: string;
597
- }) => unknown;
598
- guildEmojisUpdate: (bot: Bot, payload: {
599
- guildId: bigint;
600
- emojis: Collection<bigint, DiscordEmoji>;
601
- }) => unknown;
602
- guildBanAdd: (bot: Bot, user: User, guildId: bigint) => unknown;
603
- guildBanRemove: (bot: Bot, user: User, guildId: bigint) => unknown;
604
- guildCreate: (bot: Bot, guild: Guild) => unknown;
605
- guildDelete: (bot: Bot, id: bigint, shardId: number) => unknown;
606
- guildUpdate: (bot: Bot, guild: Guild) => unknown;
607
- raw: (bot: Bot, data: DiscordGatewayPayload, shardId: number) => unknown;
608
- roleCreate: (bot: Bot, role: Role) => unknown;
609
- roleDelete: (bot: Bot, payload: {
610
- guildId: bigint;
611
- roleId: bigint;
612
- }) => unknown;
613
- roleUpdate: (bot: Bot, role: Role) => unknown;
614
- webhooksUpdate: (bot: Bot, payload: {
615
- channelId: bigint;
616
- guildId: bigint;
617
- }) => unknown;
618
- botUpdate: (bot: Bot, user: User) => unknown;
619
- typingStart: (bot: Bot, payload: {
620
- guildId: bigint | undefined;
621
- channelId: bigint;
622
- userId: bigint;
623
- timestamp: number;
624
- member: Member | undefined;
625
- }) => unknown;
626
- }
627
- export declare function createBotConstants(): {
628
- DISCORDENO_VERSION: string;
629
- USER_AGENT: string;
630
- BASE_URL: string;
631
- CDN_URL: string;
632
- routes: {
633
- GATEWAY_BOT: () => string;
634
- AUTOMOD_RULES: (guildId: BigString) => string;
635
- AUTOMOD_RULE: (guildId: BigString, ruleId: BigString) => string;
636
- CHANNEL: (channelId: BigString) => string;
637
- CHANNEL_MESSAGE: (channelId: BigString, messageId: BigString) => string;
638
- CHANNEL_MESSAGES: (channelId: BigString, options?: helpers.GetMessagesOptions | undefined) => string;
639
- CHANNEL_PIN: (channelId: BigString, messageId: BigString) => string;
640
- CHANNEL_PINS: (channelId: BigString) => string;
641
- CHANNEL_BULK_DELETE: (channelId: BigString) => string;
642
- CHANNEL_INVITES: (channelId: BigString) => string;
643
- CHANNEL_WEBHOOKS: (channelId: BigString) => string;
644
- CHANNEL_MESSAGE_REACTION_ME: (channelId: BigString, messageId: BigString, emoji: string) => string;
645
- CHANNEL_MESSAGE_REACTION_USER: (channelId: BigString, messageId: BigString, emoji: string, userId: BigString) => string;
646
- CHANNEL_MESSAGE_REACTIONS: (channelId: BigString, messageId: BigString) => string;
647
- CHANNEL_MESSAGE_REACTION: (channelId: BigString, messageId: BigString, emoji: string, options?: helpers.GetReactions | undefined) => string;
648
- CHANNEL_FOLLOW: (channelId: BigString) => string;
649
- CHANNEL_MESSAGE_CROSSPOST: (channelId: BigString, messageId: BigString) => string;
650
- CHANNEL_OVERWRITE: (channelId: BigString, overwriteId: BigString) => string;
651
- CHANNEL_TYPING: (channelId: BigString) => string;
652
- THREAD_START_PUBLIC: (channelId: BigString, messageId: BigString) => string;
653
- THREAD_START_PRIVATE: (channelId: BigString) => string;
654
- THREAD_ACTIVE: (guildId: BigString) => string;
655
- THREAD_MEMBERS: (channelId: BigString) => string;
656
- THREAD_ME: (channelId: BigString) => string;
657
- THREAD_USER: (channelId: BigString, userId: BigString) => string;
658
- THREAD_ARCHIVED: (channelId: BigString) => string;
659
- THREAD_ARCHIVED_PUBLIC: (channelId: BigString, options?: helpers.ListArchivedThreads | undefined) => string;
660
- THREAD_ARCHIVED_PRIVATE: (channelId: BigString, options?: helpers.ListArchivedThreads | undefined) => string;
661
- THREAD_ARCHIVED_PRIVATE_JOINED: (channelId: BigString, options?: helpers.ListArchivedThreads | undefined) => string;
662
- FORUM_START: (channelId: BigString) => string;
663
- GUILD: (guildId: BigString, withCounts?: boolean | undefined) => string;
664
- GUILDS: () => string;
665
- GUILD_AUDIT_LOGS: (guildId: BigString, options?: helpers.GetGuildAuditLog | undefined) => string;
666
- GUILD_BAN: (guildId: BigString, userId: BigString) => string;
667
- GUILD_BANS: (guildId: BigString, options?: helpers.GetBans | undefined) => string;
668
- GUILD_BANNER: (guildId: BigString, icon: string) => string;
669
- GUILD_CHANNELS: (guildId: BigString) => string;
670
- GUILD_WIDGET: (guildId: BigString) => string;
671
- GUILD_WIDGET_JSON: (guildId: BigString) => string;
672
- GUILD_WIDGET_IMAGE: (guildId: BigString, style?: "shield" | "banner1" | "banner2" | "banner3" | "banner4" | undefined) => string;
673
- GUILD_EMOJI: (guildId: BigString, emojiId: BigString) => string;
674
- GUILD_EMOJIS: (guildId: BigString) => string;
675
- GUILD_ICON: (guildId: BigString, icon: string) => string;
676
- GUILD_INTEGRATION: (guildId: BigString, integrationId: BigString) => string;
677
- GUILD_INTEGRATION_SYNC: (guildId: BigString, integrationId: BigString) => string;
678
- GUILD_INTEGRATIONS: (guildId: BigString) => string;
679
- GUILD_INVITES: (guildId: BigString) => string;
680
- GUILD_LEAVE: (guildId: BigString) => string;
681
- GUILD_MEMBER: (guildId: BigString, userId: BigString) => string;
682
- GUILD_MEMBERS: (guildId: BigString, options?: helpers.ListGuildMembers | undefined) => string;
683
- GUILD_MEMBER_ROLE: (guildId: BigString, memberId: BigString, roleId: BigString) => string;
684
- GUILD_MEMBERS_SEARCH: (guildId: BigString, query: string, options?: {
685
- limit?: number | undefined;
686
- } | undefined) => string;
687
- GUILD_PRUNE: (guildId: BigString, options?: helpers.GetGuildPruneCountQuery | undefined) => string;
688
- GUILD_REGIONS: (guildId: BigString) => string;
689
- GUILD_ROLE: (guildId: BigString, roleId: BigString) => string;
690
- GUILD_ROLES: (guildId: BigString) => string;
691
- GUILD_SPLASH: (guildId: BigString, icon: string) => string;
692
- GUILD_VANITY_URL: (guildId: BigString) => string;
693
- GUILD_WEBHOOKS: (guildId: BigString) => string;
694
- TEMPLATE: (code: string) => string;
695
- GUILD_TEMPLATE: (guildId: BigString, code: string) => string;
696
- GUILD_TEMPLATES: (guildId: BigString) => string;
697
- GUILD_PREVIEW: (guildId: BigString) => string;
698
- UPDATE_VOICE_STATE: (guildId: BigString, userId?: BigString | undefined) => string;
699
- GUILD_WELCOME_SCREEN: (guildId: BigString) => string;
700
- GUILD_SCHEDULED_EVENTS: (guildId: BigString, withUserCount?: boolean | undefined) => string;
701
- GUILD_SCHEDULED_EVENT: (guildId: BigString, eventId: BigString, withUserCount?: boolean | undefined) => string;
702
- GUILD_SCHEDULED_EVENT_USERS: (guildId: BigString, eventId: BigString, options?: helpers.GetScheduledEventUsers | undefined) => string;
703
- GUILD_MFA_LEVEL: (guildId: BigString) => string;
704
- VOICE_REGIONS: () => string;
705
- INVITE: (inviteCode: string, options?: helpers.GetInvite | undefined) => string;
706
- WEBHOOK: (webhookId: BigString, token: string, options?: {
707
- wait?: boolean | undefined;
708
- threadId?: BigString | undefined;
709
- } | undefined) => string;
710
- WEBHOOK_ID: (webhookId: BigString) => string;
711
- WEBHOOK_MESSAGE: (webhookId: BigString, token: string, messageId: BigString, options?: {
712
- threadId?: BigString | undefined;
713
- } | undefined) => string;
714
- WEBHOOK_MESSAGE_ORIGINAL: (webhookId: BigString, token: string, options?: {
715
- threadId?: BigString | undefined;
716
- } | undefined) => string;
717
- WEBHOOK_SLACK: (webhookId: BigString, token: string) => string;
718
- WEBHOOK_GITHUB: (webhookId: BigString, token: string) => string;
719
- COMMANDS: (applicationId: BigString) => string;
720
- COMMANDS_GUILD: (applicationId: BigString, guildId: BigString) => string;
721
- COMMANDS_PERMISSIONS: (applicationId: BigString, guildId: BigString) => string;
722
- COMMANDS_PERMISSION: (applicationId: BigString, guildId: BigString, commandId: BigString) => string;
723
- COMMANDS_ID: (applicationId: BigString, commandId: BigString, withLocalizations?: boolean | undefined) => string;
724
- COMMANDS_GUILD_ID: (applicationId: BigString, guildId: BigString, commandId: BigString, withLocalizations?: boolean | undefined) => string;
725
- INTERACTION_ID_TOKEN: (interactionId: BigString, token: string) => string;
726
- INTERACTION_ORIGINAL_ID_TOKEN: (interactionId: BigString, token: string) => string;
727
- INTERACTION_ID_TOKEN_MESSAGE_ID: (applicationId: BigString, token: string, messageId: BigString) => string;
728
- USER: (userId: BigString) => string;
729
- USER_BOT: () => string;
730
- USER_GUILDS: () => string;
731
- USER_AVATAR: (userId: BigString, icon: string) => string;
732
- USER_DEFAULT_AVATAR: (icon: number) => string;
733
- USER_DM: () => string;
734
- USER_CONNECTIONS: () => string;
735
- USER_NICK: (guildId: BigString) => string;
736
- DISCOVERY_CATEGORIES: () => string;
737
- DISCOVERY_VALID_TERM: (term: string) => string;
738
- DISCOVERY_METADATA: (guildId: BigString) => string;
739
- DISCOVERY_SUBCATEGORY: (guildId: BigString, categoryId: number) => string;
740
- OAUTH2_APPLICATION: () => string;
741
- STAGE_INSTANCES: () => string;
742
- STAGE_INSTANCE: (channelId: BigString) => string;
743
- NITRO_STICKER_PACKS: () => string;
744
- STICKER: (stickerId: bigint) => string;
745
- GUILD_STICKERS: (guildId: bigint) => string;
746
- GUILD_STICKER: (guildId: bigint, stickerId: bigint) => string;
747
- };
748
- regexes: {
749
- SLASH_COMMANDS_NAME_REGEX: RegExp;
750
- CONTEXT_MENU_COMMANDS_NAME_REGEX: RegExp;
751
- CHANNEL_MENTION_REGEX: RegExp;
752
- DISCORD_SNOWFLAKE_REGEX: RegExp;
753
- };
754
- Errors: typeof Errors;
755
- };
756
- export interface BotGatewayHandlerOptions {
757
- READY: typeof handlers.handleReady;
758
- CHANNEL_CREATE: typeof handlers.handleChannelCreate;
759
- CHANNEL_DELETE: typeof handlers.handleChannelDelete;
760
- CHANNEL_PINS_UPDATE: typeof handlers.handleChannelPinsUpdate;
761
- CHANNEL_UPDATE: typeof handlers.handleChannelUpdate;
762
- THREAD_CREATE: typeof handlers.handleThreadCreate;
763
- THREAD_UPDATE: typeof handlers.handleThreadUpdate;
764
- THREAD_DELETE: typeof handlers.handleThreadDelete;
765
- THREAD_LIST_SYNC: typeof handlers.handleThreadListSync;
766
- THREAD_MEMBERS_UPDATE: typeof handlers.handleThreadMembersUpdate;
767
- STAGE_INSTANCE_CREATE: typeof handlers.handleStageInstanceCreate;
768
- STAGE_INSTANCE_UPDATE: typeof handlers.handleStageInstanceUpdate;
769
- STAGE_INSTANCE_DELETE: typeof handlers.handleStageInstanceDelete;
770
- GUILD_BAN_ADD: typeof handlers.handleGuildBanAdd;
771
- GUILD_BAN_REMOVE: typeof handlers.handleGuildBanRemove;
772
- GUILD_CREATE: typeof handlers.handleGuildCreate;
773
- GUILD_DELETE: typeof handlers.handleGuildDelete;
774
- GUILD_EMOJIS_UPDATE: typeof handlers.handleGuildEmojisUpdate;
775
- GUILD_INTEGRATIONS_UPDATE: typeof handlers.handleGuildIntegrationsUpdate;
776
- GUILD_MEMBER_ADD: typeof handlers.handleGuildMemberAdd;
777
- GUILD_MEMBER_REMOVE: typeof handlers.handleGuildMemberRemove;
778
- GUILD_MEMBER_UPDATE: typeof handlers.handleGuildMemberUpdate;
779
- GUILD_MEMBERS_CHUNK: typeof handlers.handleGuildMembersChunk;
780
- GUILD_ROLE_CREATE: typeof handlers.handleGuildRoleCreate;
781
- GUILD_ROLE_DELETE: typeof handlers.handleGuildRoleDelete;
782
- GUILD_ROLE_UPDATE: typeof handlers.handleGuildRoleUpdate;
783
- GUILD_SCHEDULED_EVENT_CREATE: typeof handlers.handleGuildScheduledEventCreate;
784
- GUILD_SCHEDULED_EVENT_DELETE: typeof handlers.handleGuildScheduledEventDelete;
785
- GUILD_SCHEDULED_EVENT_UPDATE: typeof handlers.handleGuildScheduledEventUpdate;
786
- GUILD_SCHEDULED_EVENT_USER_ADD: typeof handlers.handleGuildScheduledEventUserAdd;
787
- GUILD_SCHEDULED_EVENT_USER_REMOVE: typeof handlers.handleGuildScheduledEventUserRemove;
788
- GUILD_UPDATE: typeof handlers.handleGuildUpdate;
789
- INTERACTION_CREATE: typeof handlers.handleInteractionCreate;
790
- INVITE_CREATE: typeof handlers.handleInviteCreate;
791
- INVITE_DELETE: typeof handlers.handleInviteCreate;
792
- MESSAGE_CREATE: typeof handlers.handleMessageCreate;
793
- MESSAGE_DELETE_BULK: typeof handlers.handleMessageDeleteBulk;
794
- MESSAGE_DELETE: typeof handlers.handleMessageDelete;
795
- MESSAGE_REACTION_ADD: typeof handlers.handleMessageReactionAdd;
796
- MESSAGE_REACTION_REMOVE_ALL: typeof handlers.handleMessageReactionRemoveAll;
797
- MESSAGE_REACTION_REMOVE_EMOJI: typeof handlers.handleMessageReactionRemoveEmoji;
798
- MESSAGE_REACTION_REMOVE: typeof handlers.handleMessageReactionRemove;
799
- MESSAGE_UPDATE: typeof handlers.handleMessageUpdate;
800
- PRESENCE_UPDATE: typeof handlers.handlePresenceUpdate;
801
- TYPING_START: typeof handlers.handleTypingStart;
802
- USER_UPDATE: typeof handlers.handleUserUpdate;
803
- VOICE_SERVER_UPDATE: typeof handlers.handleVoiceServerUpdate;
804
- VOICE_STATE_UPDATE: typeof handlers.handleVoiceStateUpdate;
805
- WEBHOOKS_UPDATE: typeof handlers.handleWebhooksUpdate;
806
- INTEGRATION_CREATE: typeof handlers.handleIntegrationCreate;
807
- INTEGRATION_UPDATE: typeof handlers.handleIntegrationUpdate;
808
- INTEGRATION_DELETE: typeof handlers.handleIntegrationDelete;
34
+ dispatchRequirements: (payload: Camelize<DiscordGatewayPayload>, shard: Shard) => unknown;
35
+ raw: (payload: Camelize<DiscordGatewayPayload>, shard: Shard) => unknown;
36
+ ready: (payload: Camelize<DiscordReady>, shard: Shard) => unknown;
37
+ applicationCommandPermissionsUpdate: (payload: Camelize<DiscordGuildApplicationCommandPermissions>, shard: Shard) => unknown;
38
+ autoModerationRuleCreate: (payload: Camelize<DiscordAutoModerationRule>, shard: Shard) => unknown;
39
+ autoModerationRuleUpdate: (payload: Camelize<DiscordAutoModerationRule>, shard: Shard) => unknown;
40
+ autoModerationRuleDelete: (payload: Camelize<DiscordAutoModerationRule>, shard: Shard) => unknown;
41
+ autoModerationActionExecution: (payload: Camelize<DiscordAutoModerationActionExecution>, shard: Shard) => unknown;
42
+ channelCreate: (payload: Camelize<DiscordChannel>, shard: Shard) => unknown;
43
+ channelUpdate: (payload: Camelize<DiscordChannel>, shard: Shard) => unknown;
44
+ channelDelete: (payload: Camelize<DiscordChannel>, shard: Shard) => unknown;
45
+ channelPinsUpdate: (payload: Camelize<DiscordChannelPinsUpdate>, shard: Shard) => unknown;
46
+ threadCreate: (payload: Camelize<DiscordChannel>, shard: Shard) => unknown;
47
+ threadUpdate: (payload: Camelize<DiscordChannel>, shard: Shard) => unknown;
48
+ threadDelete: (payload: Camelize<DiscordChannel>, shard: Shard) => unknown;
49
+ threadListSync: (payload: Camelize<DiscordThreadListSync>, shard: Shard) => unknown;
50
+ threadMemberUpdate: (payload: Camelize<DiscordThreadMemberUpdate>, shard: Shard) => unknown;
51
+ threadMembersUpdate: (payload: Camelize<DiscordThreadMembersUpdate>, shard: Shard) => unknown;
52
+ guildCreate: (payload: Camelize<DiscordGuild>, shard: Shard) => unknown;
53
+ guildUpdate: (payload: Camelize<DiscordGuild>, shard: Shard) => unknown;
54
+ guildDelete: (payload: Camelize<DiscordUnavailableGuild>, shard: Shard) => unknown;
55
+ guildBanAdd: (payload: Camelize<DiscordGuildBanAddRemove>, shard: Shard) => unknown;
56
+ guildBanRemove: (payload: Camelize<DiscordGuildBanAddRemove>, shard: Shard) => unknown;
57
+ guildEmojisUpdate: (payload: Camelize<DiscordGuildEmojisUpdate>, shard: Shard) => unknown;
58
+ guildStickersUpdate: (payload: Camelize<DiscordGuildStickersUpdate>, shard: Shard) => unknown;
59
+ guildIntegrationsUpdate: (payload: Camelize<DiscordIntegrationCreateUpdate>, shard: Shard) => unknown;
60
+ guildMemberAdd: (payload: Camelize<DiscordGuildMemberAdd>, shard: Shard) => unknown;
61
+ guildMemberRemove: (payload: Camelize<DiscordGuildMemberRemove>, shard: Shard) => unknown;
62
+ guildMemberUpdate: (payload: Camelize<DiscordGuildMemberUpdate>, shard: Shard) => unknown;
63
+ guildMembersChunk: (payload: Camelize<DiscordGuildMembersChunk>, shard: Shard) => unknown;
64
+ guildRoleCreate: (payload: Camelize<DiscordGuildRoleCreate>, shard: Shard) => unknown;
65
+ guildRoleUpdate: (payload: Camelize<DiscordGuildRoleUpdate>, shard: Shard) => unknown;
66
+ guildRoleDelete: (payload: Camelize<DiscordGuildRoleDelete>, shard: Shard) => unknown;
67
+ guildScheduledEventCreate: (payload: Camelize<DiscordScheduledEvent>, shard: Shard) => unknown;
68
+ guildScheduledEventUpdate: (payload: Camelize<DiscordScheduledEvent>, shard: Shard) => unknown;
69
+ guildScheduledEventDelete: (payload: Camelize<DiscordScheduledEvent>, shard: Shard) => unknown;
70
+ guildScheduledEventUserAdd: (payload: Camelize<DiscordScheduledEventUserAdd>, shard: Shard) => unknown;
71
+ guildScheduledEventUserRemove: (payload: Camelize<DiscordScheduledEventUserRemove>, shard: Shard) => unknown;
72
+ integrationCreate: (payload: Camelize<DiscordIntegrationCreateUpdate>, shard: Shard) => unknown;
73
+ integrationUpdate: (payload: Camelize<DiscordIntegrationCreateUpdate>, shard: Shard) => unknown;
74
+ integrationDelete: (payload: Camelize<DiscordIntegrationDelete>, shard: Shard) => unknown;
75
+ interactionCreate: (payload: Camelize<DiscordInteraction>, shard: Shard) => unknown;
76
+ inviteCreate: (payload: Camelize<DiscordInviteCreate>, shard: Shard) => unknown;
77
+ inviteDelete: (payload: Camelize<DiscordInviteDelete>, shard: Shard) => unknown;
78
+ messageCreate: (payload: Camelize<DiscordMessage>, shard: Shard) => unknown;
79
+ messageUpdate: (payload: Camelize<DiscordMessage>, shard: Shard) => unknown;
80
+ messageDelete: (payload: Camelize<DiscordMessageDelete>, shard: Shard) => unknown;
81
+ messageDeleteBulk: (payload: Camelize<DiscordMessageDeleteBulk>, shard: Shard) => unknown;
82
+ messageReactionAdd: (payload: Camelize<DiscordMessageReactionAdd>, shard: Shard) => unknown;
83
+ messageReactionRemove: (payload: Camelize<DiscordMessageReactionRemove>, shard: Shard) => unknown;
84
+ messageReactionRemoveAll: (payload: Camelize<DiscordMessageReactionRemoveAll>, shard: Shard) => unknown;
85
+ messageReactionRemoveEmoji: (payload: Camelize<DiscordMessageReactionRemoveEmoji>, shard: Shard) => unknown;
86
+ presenceUpdate: (payload: Camelize<DiscordPresenceUpdate>, shard: Shard) => unknown;
87
+ stageInstanceCreate: (payload: Camelize<DiscordStageInstance>, shard: Shard) => unknown;
88
+ stageInstanceUpdate: (payload: Camelize<DiscordStageInstance>, shard: Shard) => unknown;
89
+ stageInstanceDelete: (payload: Camelize<DiscordStageInstance>, shard: Shard) => unknown;
90
+ typingStart: (payload: Camelize<DiscordTypingStart>, shard: Shard) => unknown;
91
+ userUpdate: (payload: Camelize<DiscordUser>, shard: Shard) => unknown;
92
+ voiceStateUpdate: (payload: Camelize<DiscordVoiceState>, shard: Shard) => unknown;
93
+ voiceServerUpdate: (payload: Camelize<DiscordVoiceServerUpdate>, shard: Shard) => unknown;
94
+ webhooksUpdate: (payload: Camelize<DiscordWebhookUpdate>, shard: Shard) => unknown;
809
95
  }
810
- export declare function createBotGatewayHandlers(options: Partial<BotGatewayHandlerOptions>): Record<GatewayDispatchEventNames, (bot: Bot, data: DiscordGatewayPayload, shardId: number) => any>;
811
- export type RemoveFirstFromTuple<T extends any[]> = T['length'] extends 0 ? [] : ((...b: T) => void) extends (a: any, ...b: infer I) => void ? I : [];
812
- export type FinalHelpers = {
813
- [K in keyof Helpers]: (...args: RemoveFirstFromTuple<Parameters<Helpers[K]>>) => ReturnType<Helpers[K]>;
814
- };
815
96
  //# sourceMappingURL=bot.d.ts.map