bakit 3.1.0 → 3.2.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/dist/index.d.cts CHANGED
@@ -5,8 +5,11 @@ import * as _bakit_utils0 from "@bakit/utils";
5
5
  import { AbstractConstructor, Awaitable, Awaitable as Awaitable$1, Constructor, FunctionLike, Promisify, PromisifyValue, RejectFn, ResolveFn, capitalize, instanceToObject, isCommonJS, isESM, isPlainObject, isPromiseLike, promisify, sleep } from "@bakit/utils";
6
6
  import EventEmitter from "node:events";
7
7
  import * as discord_api_types_v100 from "discord-api-types/v10";
8
- import { APIAllowedMentions, APIChannel, APIChannelBase, APIDMChannel, APIEmbed, APIGuild, APIGuildVoiceChannel, APIMessage, APIMessageReference, APITextBasedChannel, APIUser, ChannelType, GatewayChannelCreateDispatchData, GatewayChannelUpdateDispatchData, GatewayDispatchPayload, GatewayGuildCreateDispatchData, GatewayGuildUpdateDispatchData, GatewayIntentBits, GatewayIntentBits as Intent, GatewayMessageCreateDispatchData, GatewayMessageUpdateDispatchData, GatewayReadyDispatchData, GatewayReceivePayload } from "discord-api-types/v10";
8
+ import { APIAllowedMentions, APIChannel, APIChannelBase, APIDMChannel, APIEmbed, APIGuild, APIGuildCategoryChannel, APIGuildForumChannel, APIGuildForumTag, APIGuildStageVoiceChannel, APIGuildTextChannel, APIGuildVoiceChannel, APIMessage, APIMessageReference, APINewsChannel, APIThreadChannel, APIUser, ChannelType, ForumLayoutType, GatewayChannelCreateDispatchData, GatewayChannelUpdateDispatchData, GatewayDispatchPayload, GatewayGuildCreateDispatchData, GatewayGuildUpdateDispatchData, GatewayIntentBits, GatewayIntentBits as Intent, GatewayMessageCreateDispatchData, GatewayMessageUpdateDispatchData, GatewayReadyDispatchData, GatewayReceivePayload, GatewayTypingStartDispatchData, GuildTextChannelType, RESTPostAPIGuildChannelJSONBody, SortOrderType, ThreadAutoArchiveDuration } from "discord-api-types/v10";
9
+ import * as _discordjs_collection0 from "@discordjs/collection";
9
10
  import { Collection } from "@discordjs/collection";
11
+ import * as discord_api_types_globals0 from "discord-api-types/globals";
12
+ import { Snowflake } from "discord-api-types/globals";
10
13
 
11
14
  //#region src/lib/structures/BaseStructure.d.ts
12
15
  declare class BaseStructure {
@@ -15,75 +18,283 @@ declare class BaseStructure {
15
18
  toJSON(): {};
16
19
  }
17
20
  //#endregion
18
- //#region src/lib/structures/Guild.d.ts
19
- type GuildPayload = APIGuild | GatewayGuildUpdateDispatchData | GatewayGuildCreateDispatchData;
20
- declare class Guild extends BaseStructure {
21
- #private;
22
- data: GuildPayload;
23
- readonly channels: Collection<string, Channel>;
24
- constructor(client: Client, data: GuildPayload);
21
+ //#region src/lib/structures/channel/GuildCategory.d.ts
22
+ declare const GuildCategory_base: {
23
+ new (client: Client, data: APIGuildCategoryChannel): BaseChannel<APIGuildCategoryChannel, discord_api_types_v100.ChannelType.GuildCategory>;
24
+ } & (abstract new (...args: any[]) => {
25
+ get parentId(): string | undefined;
26
+ get parent(): /*elided*/any | undefined;
27
+ get guildId(): string;
28
+ get guild(): Guild;
29
+ data: discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
30
+ get partial(): boolean;
25
31
  get id(): string;
26
- get name(): string;
27
- get icon(): string | null;
28
- get banner(): string | null;
29
- get owner(): string;
30
- get mfaLevel(): discord_api_types_v100.GuildMFALevel;
31
- get verificationLevel(): discord_api_types_v100.GuildVerificationLevel;
32
- _patch(data: Partial<GuildPayload>): void;
32
+ get type(): discord_api_types_v100.GuildChannelType;
33
+ toString(): string;
34
+ toJSON(): discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
35
+ isTextBased(): this is TextBasedChannel;
36
+ isVoiceBased(): this is VoiceBasedChannel;
37
+ isDM(): this is DMChannel;
38
+ isThread(): this is ThreadBasedChannel;
39
+ isPublicThread(): this is ThreadBasedChannel;
40
+ isPrivateThread(): this is ThreadBasedChannel;
41
+ isAnnouncementThread(): this is ThreadBasedChannel;
42
+ isCategory(): this is GuildCategory;
43
+ inGuild(): this is GuildChannel;
44
+ fetch(): Promise< /*elided*/any>;
45
+ _patch(data: Partial<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>): void;
46
+ client: Client<true>;
47
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>>;
48
+ declare class GuildCategory extends GuildCategory_base {
49
+ constructor(client: Client, data: APIGuildCategoryChannel);
50
+ get children(): _discordjs_collection0.Collection<string, Channel>;
33
51
  }
34
52
  //#endregion
35
- //#region src/lib/structures/channel/GuildTextChannel.d.ts
36
- declare const GuildTextChannel_base: (abstract new (client: Client, data: APITextBasedChannel<ChannelType.GuildText>) => BaseChannel<APITextBasedChannel<ChannelType.GuildText>>) & (abstract new (...args: any[]) => {
53
+ //#region src/lib/managers/client/ClientChannelManager.d.ts
54
+ interface MessageCreateOptions {
55
+ content?: string;
56
+ tts?: boolean;
57
+ embeds?: APIEmbed[];
58
+ allowedMentions?: APIAllowedMentions;
59
+ messageReference?: APIMessageReference;
60
+ flags?: number;
61
+ }
62
+ type MessageReplyOptions = Omit<MessageCreateOptions, "messageReference">;
63
+ type MessageEditOptions = Omit<MessageCreateOptions, "messageReference">;
64
+ declare class ClientChannelManager {
65
+ readonly client: Client;
66
+ constructor(client: Client);
67
+ fetch<C extends Channel>(id: Snowflake, force?: boolean): Promise<C | undefined>;
68
+ delete(id: Snowflake, force?: boolean): Promise<Channel | undefined>;
69
+ create(guildId: Snowflake, payload: RESTPostAPIGuildChannelJSONBody): Promise<BaseChannel<discord_api_types_v100.APIGroupDMChannel | discord_api_types_v100.APIGuildCategoryChannel | discord_api_types_v100.APIGuildMediaChannel | discord_api_types_v100.APIChannelBase<ChannelType> | (discord_api_types_v100.APIGuildCategoryChannel & {
70
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
71
+ guild_id: Snowflake;
72
+ }) | (discord_api_types_v100.APIGuildMediaChannel & {
73
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
74
+ guild_id: Snowflake;
75
+ }), ChannelType>>;
76
+ crosspost(channelId: Snowflake, messageId: Snowflake): Promise<Message<true>>;
77
+ createMessage(channelId: Snowflake, options: MessageCreateOptions | string): Promise<Message<boolean>>;
78
+ editMessage(channelId: Snowflake, messageId: Snowflake, options: MessageEditOptions | string): Promise<Message<boolean>>;
79
+ deleteMessage(channelId: Snowflake, messageId: Snowflake, force?: boolean): Promise<Message<boolean> | undefined>;
80
+ replyMessage(channelId: Snowflake, messageId: Snowflake, options: MessageReplyOptions | string): Promise<Message<boolean>>;
81
+ resolve(data: BaseChannelPayload): BaseChannel<discord_api_types_v100.APIGroupDMChannel | discord_api_types_v100.APIGuildCategoryChannel | discord_api_types_v100.APIGuildMediaChannel | discord_api_types_v100.APIChannelBase<ChannelType> | (discord_api_types_v100.APIGuildCategoryChannel & {
82
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
83
+ guild_id: Snowflake;
84
+ }) | (discord_api_types_v100.APIGuildMediaChannel & {
85
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
86
+ guild_id: Snowflake;
87
+ }), ChannelType>;
88
+ static create(client: Client, data: BaseChannelPayload): BaseChannel<discord_api_types_v100.APIGroupDMChannel | discord_api_types_v100.APIGuildCategoryChannel | discord_api_types_v100.APIGuildMediaChannel | discord_api_types_v100.APIChannelBase<ChannelType> | (discord_api_types_v100.APIGuildCategoryChannel & {
89
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
90
+ guild_id: Snowflake;
91
+ }) | (discord_api_types_v100.APIGuildMediaChannel & {
92
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
93
+ guild_id: Snowflake;
94
+ }), ChannelType>;
95
+ joinThread(threadId: Snowflake): Promise<unknown>;
96
+ static createMessagePayload(options: MessageCreateOptions): {
97
+ content: string | undefined;
98
+ tts: boolean | undefined;
99
+ embeds: APIEmbed[] | undefined;
100
+ allowed_mentions: APIAllowedMentions | undefined;
101
+ message_reference: APIMessageReference | undefined;
102
+ flags: number | undefined;
103
+ };
104
+ }
105
+ //#endregion
106
+ //#region src/lib/structures/channel/ThreadChannel.d.ts
107
+ interface PublicThread extends ThreadChannel {
108
+ readonly type: ChannelType.PublicThread;
109
+ }
110
+ interface PrivateThread extends ThreadChannel {
111
+ readonly type: ChannelType.PrivateThread;
112
+ }
113
+ interface AnnouncementThread extends ThreadChannel {
114
+ readonly type: ChannelType.AnnouncementThread;
115
+ }
116
+ type ThreadBasedChannel = PublicThread | PrivateThread | AnnouncementThread;
117
+ declare const ThreadChannel_base: {
118
+ new (client: Client, data: APIThreadChannel<discord_api_types_v100.ThreadChannelType>): BaseChannel<APIThreadChannel<discord_api_types_v100.ThreadChannelType>, discord_api_types_v100.ThreadChannelType>;
119
+ } & (abstract new (...args: any[]) => {
120
+ get parentId(): string | undefined;
121
+ get parent(): /*elided*/any | undefined;
37
122
  get guildId(): string;
38
123
  get guild(): Guild;
39
124
  data: discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
125
+ get partial(): boolean;
40
126
  get id(): string;
41
- get type(): ChannelType;
127
+ get type(): discord_api_types_v100.GuildChannelType;
42
128
  toString(): string;
43
129
  toJSON(): discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
44
130
  isTextBased(): this is TextBasedChannel;
45
131
  isVoiceBased(): this is VoiceBasedChannel;
46
132
  isDM(): this is DMChannel;
133
+ isThread(): this is ThreadBasedChannel;
134
+ isPublicThread(): this is ThreadBasedChannel;
135
+ isPrivateThread(): this is ThreadBasedChannel;
136
+ isAnnouncementThread(): this is ThreadBasedChannel;
137
+ isCategory(): this is GuildCategory;
47
138
  inGuild(): this is GuildChannel;
48
139
  fetch(): Promise< /*elided*/any>;
49
140
  _patch(data: Partial<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>): void;
50
141
  client: Client<true>;
51
- }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>> & (abstract new (...args: any[]) => {
142
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>> & (abstract new (...args: any[]) => {
143
+ get lastMessageId(): string | undefined;
144
+ get rateLimitPerUser(): number | undefined;
52
145
  send(options: MessageCreateOptions | string): Promise<Message<boolean>>;
53
- data: APITextBasedChannel<ChannelType>;
146
+ data: discord_api_types_v100.APITextBasedChannel<ChannelType>;
147
+ get partial(): boolean;
54
148
  get id(): string;
55
149
  get type(): ChannelType;
56
150
  toString(): string;
57
- toJSON(): APITextBasedChannel<ChannelType>;
151
+ toJSON(): discord_api_types_v100.APITextBasedChannel<ChannelType>;
152
+ isTextBased(): this is TextBasedChannel;
153
+ isVoiceBased(): this is VoiceBasedChannel;
154
+ isDM(): this is DMChannel;
155
+ isThread(): this is ThreadBasedChannel;
156
+ isPublicThread(): this is ThreadBasedChannel;
157
+ isPrivateThread(): this is ThreadBasedChannel;
158
+ isAnnouncementThread(): this is ThreadBasedChannel;
159
+ isCategory(): this is GuildCategory;
160
+ inGuild(): this is GuildChannel;
161
+ fetch(): Promise< /*elided*/any>;
162
+ _patch(data: Partial<discord_api_types_v100.APITextBasedChannel<ChannelType>>): void;
163
+ client: Client<true>;
164
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APITextBasedChannel<ChannelType>, ChannelType>>;
165
+ declare class ThreadChannel extends ThreadChannel_base {
166
+ get ownerId(): string | undefined;
167
+ get archived(): boolean;
168
+ get locked(): boolean;
169
+ get autoArchiveDuration(): discord_api_types_v100.ThreadAutoArchiveDuration | undefined;
170
+ get archiveTimestamp(): string | undefined;
171
+ get invitable(): boolean | undefined;
172
+ get memberCount(): number | undefined;
173
+ get messageCount(): number | undefined;
174
+ get totalMessageSent(): number | undefined;
175
+ }
176
+ //#endregion
177
+ //#region src/lib/structures/channel/DMChannel.d.ts
178
+ declare const DMChannel_base: {
179
+ new (client: Client, data: APIDMChannel): BaseChannel<APIDMChannel, discord_api_types_v100.ChannelType.DM>;
180
+ } & (abstract new (...args: any[]) => {
181
+ get lastMessageId(): string | undefined;
182
+ get rateLimitPerUser(): number | undefined;
183
+ send(options: MessageCreateOptions | string): Promise<Message<boolean>>;
184
+ data: discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
185
+ get partial(): boolean;
186
+ get id(): string;
187
+ get type(): discord_api_types_v100.ChannelType;
188
+ toString(): string;
189
+ toJSON(): discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
190
+ isTextBased(): this is TextBasedChannel;
191
+ isVoiceBased(): this is VoiceBasedChannel;
192
+ isDM(): this is DMChannel;
193
+ isThread(): this is ThreadBasedChannel;
194
+ isPublicThread(): this is ThreadBasedChannel;
195
+ isPrivateThread(): this is ThreadBasedChannel;
196
+ isAnnouncementThread(): this is ThreadBasedChannel;
197
+ isCategory(): this is GuildCategory;
198
+ inGuild(): this is GuildChannel;
199
+ fetch(): Promise< /*elided*/any>;
200
+ _patch(data: Partial<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>>): void;
201
+ client: Client<true>;
202
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>, discord_api_types_v100.ChannelType>>;
203
+ declare class DMChannel extends DMChannel_base {
204
+ #private;
205
+ constructor(client: Client, data: APIDMChannel);
206
+ get recipients(): Collection<string, User>;
207
+ get recipientId(): string;
208
+ get recipient(): User;
209
+ fetch(): Promise<this>;
210
+ send(options: MessageCreateOptions | string): Promise<Message<false>>;
211
+ fetchRecipients(force?: boolean): Promise<Collection<string, User> | undefined>;
212
+ _patch(data: Partial<APIDMChannel>): void;
213
+ }
214
+ //#endregion
215
+ //#region src/lib/structures/channel/GuildTextChannel.d.ts
216
+ declare const GuildTextChannel_base: {
217
+ new (client: Client, data: APIGuildTextChannel<GuildTextChannelType>): BaseChannel<APIGuildTextChannel<GuildTextChannelType>, GuildTextChannelType>;
218
+ } & (abstract new (...args: any[]) => {
219
+ get parentId(): string | undefined;
220
+ get parent(): /*elided*/any | undefined;
221
+ get guildId(): string;
222
+ get guild(): Guild;
223
+ data: discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
224
+ get partial(): boolean;
225
+ get id(): string;
226
+ get type(): discord_api_types_v100.GuildChannelType;
227
+ toString(): string;
228
+ toJSON(): discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
58
229
  isTextBased(): this is TextBasedChannel;
59
230
  isVoiceBased(): this is VoiceBasedChannel;
60
231
  isDM(): this is DMChannel;
232
+ isThread(): this is ThreadBasedChannel;
233
+ isPublicThread(): this is ThreadBasedChannel;
234
+ isPrivateThread(): this is ThreadBasedChannel;
235
+ isAnnouncementThread(): this is ThreadBasedChannel;
236
+ isCategory(): this is GuildCategory;
61
237
  inGuild(): this is GuildChannel;
62
238
  fetch(): Promise< /*elided*/any>;
63
- _patch(data: Partial<APITextBasedChannel<ChannelType>>): void;
239
+ _patch(data: Partial<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>): void;
64
240
  client: Client<true>;
65
- }) & _bakit_utils0.AbstractConstructor<BaseChannel<APITextBasedChannel<ChannelType>>>;
241
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>> & (abstract new (...args: any[]) => {
242
+ get lastMessageId(): string | undefined;
243
+ get rateLimitPerUser(): number | undefined;
244
+ send(options: MessageCreateOptions | string): Promise<Message<boolean>>;
245
+ data: discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
246
+ get partial(): boolean;
247
+ get id(): string;
248
+ get type(): discord_api_types_v100.ChannelType;
249
+ toString(): string;
250
+ toJSON(): discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
251
+ isTextBased(): this is TextBasedChannel;
252
+ isVoiceBased(): this is VoiceBasedChannel;
253
+ isDM(): this is DMChannel;
254
+ isThread(): this is ThreadBasedChannel;
255
+ isPublicThread(): this is ThreadBasedChannel;
256
+ isPrivateThread(): this is ThreadBasedChannel;
257
+ isAnnouncementThread(): this is ThreadBasedChannel;
258
+ isCategory(): this is GuildCategory;
259
+ inGuild(): this is GuildChannel;
260
+ fetch(): Promise< /*elided*/any>;
261
+ _patch(data: Partial<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>>): void;
262
+ client: Client<true>;
263
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>, discord_api_types_v100.ChannelType>>;
66
264
  declare class GuildTextChannel extends GuildTextChannel_base {}
67
265
  //#endregion
68
266
  //#region src/lib/structures/channel/GuildVoiceChannel.d.ts
69
- declare const GuildVoiceChannel_base: (abstract new (client: Client, data: APIGuildVoiceChannel) => BaseChannel<APIGuildVoiceChannel>) & (abstract new (...args: any[]) => {
267
+ declare const GuildVoiceChannel_base: {
268
+ new (client: Client, data: APIGuildVoiceChannel): BaseChannel<APIGuildVoiceChannel, discord_api_types_v100.ChannelType.GuildVoice>;
269
+ } & (abstract new (...args: any[]) => {
270
+ get parentId(): string | undefined;
271
+ get parent(): /*elided*/any | undefined;
70
272
  get guildId(): string;
71
273
  get guild(): Guild;
72
274
  data: discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
275
+ get partial(): boolean;
73
276
  get id(): string;
74
- get type(): discord_api_types_v100.ChannelType;
277
+ get type(): discord_api_types_v100.GuildChannelType;
75
278
  toString(): string;
76
279
  toJSON(): discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
77
280
  isTextBased(): this is TextBasedChannel;
78
281
  isVoiceBased(): this is VoiceBasedChannel;
79
282
  isDM(): this is DMChannel;
283
+ isThread(): this is ThreadBasedChannel;
284
+ isPublicThread(): this is ThreadBasedChannel;
285
+ isPrivateThread(): this is ThreadBasedChannel;
286
+ isAnnouncementThread(): this is ThreadBasedChannel;
287
+ isCategory(): this is GuildCategory;
80
288
  inGuild(): this is GuildChannel;
81
289
  fetch(): Promise< /*elided*/any>;
82
290
  _patch(data: Partial<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>): void;
83
291
  client: Client<true>;
84
- }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>> & (abstract new (...args: any[]) => {
292
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>> & (abstract new (...args: any[]) => {
293
+ get lastMessageId(): string | undefined;
294
+ get rateLimitPerUser(): number | undefined;
85
295
  send(options: MessageCreateOptions | string): Promise<Message<boolean>>;
86
296
  data: discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
297
+ get partial(): boolean;
87
298
  get id(): string;
88
299
  get type(): discord_api_types_v100.ChannelType;
89
300
  toString(): string;
@@ -91,106 +302,296 @@ declare const GuildVoiceChannel_base: (abstract new (client: Client, data: APIGu
91
302
  isTextBased(): this is TextBasedChannel;
92
303
  isVoiceBased(): this is VoiceBasedChannel;
93
304
  isDM(): this is DMChannel;
305
+ isThread(): this is ThreadBasedChannel;
306
+ isPublicThread(): this is ThreadBasedChannel;
307
+ isPrivateThread(): this is ThreadBasedChannel;
308
+ isAnnouncementThread(): this is ThreadBasedChannel;
309
+ isCategory(): this is GuildCategory;
94
310
  inGuild(): this is GuildChannel;
95
311
  fetch(): Promise< /*elided*/any>;
96
312
  _patch(data: Partial<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>>): void;
97
313
  client: Client<true>;
98
- }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>>> & (abstract new (...args: any[]) => {
314
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>, discord_api_types_v100.ChannelType>> & (abstract new (...args: any[]) => {
99
315
  data: discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>;
316
+ get partial(): boolean;
100
317
  get id(): string;
101
- get type(): discord_api_types_v100.ChannelType;
318
+ get type(): discord_api_types_v100.GuildChannelType;
102
319
  toString(): string;
103
320
  toJSON(): discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>;
104
321
  isTextBased(): this is TextBasedChannel;
105
322
  isVoiceBased(): this is VoiceBasedChannel;
106
323
  isDM(): this is DMChannel;
324
+ isThread(): this is ThreadBasedChannel;
325
+ isPublicThread(): this is ThreadBasedChannel;
326
+ isPrivateThread(): this is ThreadBasedChannel;
327
+ isAnnouncementThread(): this is ThreadBasedChannel;
328
+ isCategory(): this is GuildCategory;
107
329
  inGuild(): this is GuildChannel;
108
330
  fetch(): Promise< /*elided*/any>;
109
331
  _patch(data: Partial<discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>>): void;
110
332
  client: Client<true>;
111
- }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>>>;
333
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>>;
112
334
  declare class GuildVoiceChannel extends GuildVoiceChannel_base {}
113
335
  //#endregion
336
+ //#region src/lib/structures/channel/GuildAnnouncementChannel.d.ts
337
+ declare const GuildAnnouncementChannel_base: {
338
+ new (client: Client, data: APINewsChannel): BaseChannel<APINewsChannel, discord_api_types_v100.ChannelType.GuildAnnouncement>;
339
+ } & (abstract new (...args: any[]) => {
340
+ get parentId(): string | undefined;
341
+ get parent(): /*elided*/any | undefined;
342
+ get guildId(): string;
343
+ get guild(): Guild;
344
+ data: discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
345
+ get partial(): boolean;
346
+ get id(): string;
347
+ get type(): discord_api_types_v100.GuildChannelType;
348
+ toString(): string;
349
+ toJSON(): discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
350
+ isTextBased(): this is TextBasedChannel;
351
+ isVoiceBased(): this is VoiceBasedChannel;
352
+ isDM(): this is DMChannel;
353
+ isThread(): this is ThreadBasedChannel;
354
+ isPublicThread(): this is ThreadBasedChannel;
355
+ isPrivateThread(): this is ThreadBasedChannel;
356
+ isAnnouncementThread(): this is ThreadBasedChannel;
357
+ isCategory(): this is GuildCategory;
358
+ inGuild(): this is GuildChannel;
359
+ fetch(): Promise< /*elided*/any>;
360
+ _patch(data: Partial<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>): void;
361
+ client: Client<true>;
362
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>> & (abstract new (...args: any[]) => {
363
+ get lastMessageId(): string | undefined;
364
+ get rateLimitPerUser(): number | undefined;
365
+ send(options: MessageCreateOptions | string): Promise<Message<boolean>>;
366
+ data: discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
367
+ get partial(): boolean;
368
+ get id(): string;
369
+ get type(): discord_api_types_v100.ChannelType;
370
+ toString(): string;
371
+ toJSON(): discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
372
+ isTextBased(): this is TextBasedChannel;
373
+ isVoiceBased(): this is VoiceBasedChannel;
374
+ isDM(): this is DMChannel;
375
+ isThread(): this is ThreadBasedChannel;
376
+ isPublicThread(): this is ThreadBasedChannel;
377
+ isPrivateThread(): this is ThreadBasedChannel;
378
+ isAnnouncementThread(): this is ThreadBasedChannel;
379
+ isCategory(): this is GuildCategory;
380
+ inGuild(): this is GuildChannel;
381
+ fetch(): Promise< /*elided*/any>;
382
+ _patch(data: Partial<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>>): void;
383
+ client: Client<true>;
384
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>, discord_api_types_v100.ChannelType>>;
385
+ declare class GuildAnnouncementChannel extends GuildAnnouncementChannel_base {
386
+ crosspost(messageId: string): Promise<Message<true>>;
387
+ }
388
+ //#endregion
389
+ //#region src/lib/structures/channel/GuildStageVoiceChannel.d.ts
390
+ declare const GuildStageVoiceChannel_base: {
391
+ new (client: Client, data: APIGuildStageVoiceChannel): BaseChannel<APIGuildStageVoiceChannel, discord_api_types_v100.ChannelType.GuildStageVoice>;
392
+ } & (abstract new (...args: any[]) => {
393
+ get parentId(): string | undefined;
394
+ get parent(): /*elided*/any | undefined;
395
+ get guildId(): string;
396
+ get guild(): Guild;
397
+ data: discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
398
+ get partial(): boolean;
399
+ get id(): string;
400
+ get type(): discord_api_types_v100.GuildChannelType;
401
+ toString(): string;
402
+ toJSON(): discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
403
+ isTextBased(): this is TextBasedChannel;
404
+ isVoiceBased(): this is VoiceBasedChannel;
405
+ isDM(): this is DMChannel;
406
+ isThread(): this is ThreadBasedChannel;
407
+ isPublicThread(): this is ThreadBasedChannel;
408
+ isPrivateThread(): this is ThreadBasedChannel;
409
+ isAnnouncementThread(): this is ThreadBasedChannel;
410
+ isCategory(): this is GuildCategory;
411
+ inGuild(): this is GuildChannel;
412
+ fetch(): Promise< /*elided*/any>;
413
+ _patch(data: Partial<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>): void;
414
+ client: Client<true>;
415
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>> & (abstract new (...args: any[]) => {
416
+ get lastMessageId(): string | undefined;
417
+ get rateLimitPerUser(): number | undefined;
418
+ send(options: MessageCreateOptions | string): Promise<Message<boolean>>;
419
+ data: discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
420
+ get partial(): boolean;
421
+ get id(): string;
422
+ get type(): discord_api_types_v100.ChannelType;
423
+ toString(): string;
424
+ toJSON(): discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
425
+ isTextBased(): this is TextBasedChannel;
426
+ isVoiceBased(): this is VoiceBasedChannel;
427
+ isDM(): this is DMChannel;
428
+ isThread(): this is ThreadBasedChannel;
429
+ isPublicThread(): this is ThreadBasedChannel;
430
+ isPrivateThread(): this is ThreadBasedChannel;
431
+ isAnnouncementThread(): this is ThreadBasedChannel;
432
+ isCategory(): this is GuildCategory;
433
+ inGuild(): this is GuildChannel;
434
+ fetch(): Promise< /*elided*/any>;
435
+ _patch(data: Partial<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>>): void;
436
+ client: Client<true>;
437
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>, discord_api_types_v100.ChannelType>> & (abstract new (...args: any[]) => {
438
+ data: discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>;
439
+ get partial(): boolean;
440
+ get id(): string;
441
+ get type(): discord_api_types_v100.GuildChannelType;
442
+ toString(): string;
443
+ toJSON(): discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>;
444
+ isTextBased(): this is TextBasedChannel;
445
+ isVoiceBased(): this is VoiceBasedChannel;
446
+ isDM(): this is DMChannel;
447
+ isThread(): this is ThreadBasedChannel;
448
+ isPublicThread(): this is ThreadBasedChannel;
449
+ isPrivateThread(): this is ThreadBasedChannel;
450
+ isAnnouncementThread(): this is ThreadBasedChannel;
451
+ isCategory(): this is GuildCategory;
452
+ inGuild(): this is GuildChannel;
453
+ fetch(): Promise< /*elided*/any>;
454
+ _patch(data: Partial<discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>>): void;
455
+ client: Client<true>;
456
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIVoiceChannelBase<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>>;
457
+ declare class GuildStageVoiceChannel extends GuildStageVoiceChannel_base {}
458
+ //#endregion
114
459
  //#region src/lib/structures/channel/BaseChannel.d.ts
115
460
  type BaseChannelPayload = APIChannelBase<ChannelType> | GatewayChannelCreateDispatchData | GatewayChannelUpdateDispatchData | APIChannel;
116
- type TextBasedChannel = GuildTextChannel | GuildVoiceChannel | DMChannel;
117
- type VoiceBasedChannel = GuildVoiceChannel;
118
- type GuildChannel = GuildTextChannel | GuildVoiceChannel;
461
+ type TextBasedChannel = GuildTextChannel | GuildVoiceChannel | GuildStageVoiceChannel | DMChannel | GuildAnnouncementChannel | ThreadBasedChannel;
462
+ type VoiceBasedChannel = GuildVoiceChannel | GuildStageVoiceChannel;
463
+ type GuildChannel = GuildTextChannel | GuildVoiceChannel | GuildAnnouncementChannel | GuildCategory;
119
464
  type Channel = TextBasedChannel | VoiceBasedChannel | GuildChannel | BaseChannel<BaseChannelPayload>;
120
- declare abstract class BaseChannel<D extends BaseChannelPayload> extends BaseStructure {
465
+ declare class BaseChannel<D extends BaseChannelPayload, Type extends ChannelType = D["type"]> extends BaseStructure {
121
466
  data: D;
122
467
  constructor(client: Client, data: D);
468
+ get partial(): boolean;
123
469
  get id(): string;
124
- get type(): ChannelType;
470
+ get type(): Type;
125
471
  toString(): string;
126
472
  toJSON(): D;
127
473
  isTextBased(): this is TextBasedChannel;
128
474
  isVoiceBased(): this is VoiceBasedChannel;
129
475
  isDM(): this is DMChannel;
476
+ isThread(): this is ThreadBasedChannel;
477
+ isPublicThread(): this is ThreadBasedChannel;
478
+ isPrivateThread(): this is ThreadBasedChannel;
479
+ isAnnouncementThread(): this is ThreadBasedChannel;
480
+ isCategory(): this is GuildCategory;
130
481
  inGuild(): this is GuildChannel;
131
482
  fetch(): Promise<this>;
132
483
  _patch(data: Partial<D>): void;
133
484
  }
134
485
  //#endregion
135
- //#region src/lib/client/ClientHelper.d.ts
136
- interface MessageCreateOptions {
137
- content?: string;
138
- tts?: boolean;
139
- embeds?: APIEmbed[];
140
- allowedMentions?: APIAllowedMentions;
141
- messageReference?: APIMessageReference;
142
- flags?: number;
486
+ //#region src/lib/structures/Guild.d.ts
487
+ type GuildPayload = APIGuild | GatewayGuildUpdateDispatchData | GatewayGuildCreateDispatchData;
488
+ declare class Guild extends BaseStructure {
489
+ #private;
490
+ data: GuildPayload;
491
+ readonly channels: Collection<string, Channel>;
492
+ constructor(client: Client, data: GuildPayload);
493
+ get id(): string;
494
+ get name(): string;
495
+ get icon(): string | null;
496
+ get banner(): string | null;
497
+ get owner(): string;
498
+ get mfaLevel(): discord_api_types_v100.GuildMFALevel;
499
+ get verificationLevel(): discord_api_types_v100.GuildVerificationLevel;
500
+ _patch(data: Partial<GuildPayload>): void;
143
501
  }
144
- type MessageReplyOptions = Omit<MessageCreateOptions, "messageReference">;
145
- type MessageEditOptions = Omit<MessageCreateOptions, "messageReference">;
146
- declare class ClientHelper {
147
- readonly client: Client;
148
- constructor(client: Client);
149
- fetchUser(userId: string, force?: boolean): Promise<User>;
150
- createDM(userId: string, force?: boolean): Promise<DMChannel>;
151
- fetchMessage(channelId: string, messageId: string, force?: boolean): Promise<Message<boolean>>;
152
- deleteMessage(channelId: string, messageId: string): Promise<void>;
153
- createMessage(channelId: string, options: MessageCreateOptions | string): Promise<Message<boolean>>;
154
- editMessage(channelId: string, messageId: string, options: MessageEditOptions | string): Promise<Message<boolean>>;
155
- replyMessage(channelId: string, messageId: string, options: MessageReplyOptions): Promise<Message<boolean>>;
156
- fetchGuild(guildId: string, force?: boolean): Promise<Guild>;
157
- fetchChannel<C extends Channel>(channelId: string, force?: boolean): Promise<C>;
158
- static toAPICreateMessagePayload(options: MessageCreateOptions): {
159
- content: string | undefined;
160
- tts: boolean | undefined;
161
- embeds: APIEmbed[] | undefined;
162
- allowed_mentions: APIAllowedMentions | undefined;
163
- message_reference: APIMessageReference | undefined;
164
- flags: number | undefined;
165
- };
502
+ //#endregion
503
+ //#region src/lib/structures/Typing.d.ts
504
+ type TypingPayload = GatewayTypingStartDispatchData;
505
+ declare class Typing extends BaseStructure {
506
+ data: TypingPayload;
507
+ constructor(client: Client, data: TypingPayload);
508
+ get channelId(): string;
509
+ get guildId(): string | undefined;
510
+ get userId(): string;
511
+ get timestamp(): number;
512
+ get member(): discord_api_types_v100.APIGuildMember | undefined;
513
+ get channel(): BaseChannel<discord_api_types_v100.APIAnnouncementThreadChannel | discord_api_types_v100.APIDMChannel | discord_api_types_v100.APIGroupDMChannel | discord_api_types_v100.APIGuildCategoryChannel | discord_api_types_v100.APIGuildForumChannel | discord_api_types_v100.APIGuildMediaChannel | discord_api_types_v100.APIGuildStageVoiceChannel | discord_api_types_v100.APIGuildVoiceChannel | discord_api_types_v100.APINewsChannel | discord_api_types_v100.APIPrivateThreadChannel | discord_api_types_v100.APIPublicThreadChannel | discord_api_types_v100.APITextChannel | discord_api_types_v100.APIChannelBase<discord_api_types_v100.ChannelType> | (discord_api_types_v100.APIGuildCategoryChannel & {
514
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
515
+ guild_id: discord_api_types_globals0.Snowflake;
516
+ }) | (discord_api_types_v100.APIGuildForumChannel & {
517
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
518
+ guild_id: discord_api_types_globals0.Snowflake;
519
+ }) | (discord_api_types_v100.APIGuildMediaChannel & {
520
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
521
+ guild_id: discord_api_types_globals0.Snowflake;
522
+ }) | (discord_api_types_v100.APIGuildStageVoiceChannel & {
523
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
524
+ guild_id: discord_api_types_globals0.Snowflake;
525
+ }) | (discord_api_types_v100.APIGuildVoiceChannel & {
526
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
527
+ guild_id: discord_api_types_globals0.Snowflake;
528
+ }) | (discord_api_types_v100.APINewsChannel & {
529
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
530
+ guild_id: discord_api_types_globals0.Snowflake;
531
+ }) | (discord_api_types_v100.APITextChannel & {
532
+ type: Exclude<discord_api_types_v100.GuildChannelType, discord_api_types_v100.ThreadChannelType>;
533
+ guild_id: discord_api_types_globals0.Snowflake;
534
+ }), discord_api_types_v100.ChannelType> | undefined;
535
+ get guild(): Guild | undefined;
166
536
  }
167
537
  //#endregion
168
- //#region src/lib/structures/channel/DMChannel.d.ts
169
- declare const DMChannel_base: (abstract new (client: Client, data: APIDMChannel) => BaseChannel<APIDMChannel>) & (abstract new (...args: any[]) => {
170
- send(options: MessageCreateOptions | string): Promise<Message<boolean>>;
171
- data: discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
538
+ //#region src/lib/structures/Tag.d.ts
539
+ declare class Tag extends BaseStructure {
540
+ data: APIGuildForumTag;
541
+ constructor(client: Client, data: APIGuildForumTag);
172
542
  get id(): string;
173
- get type(): discord_api_types_v100.ChannelType;
543
+ get name(): string;
544
+ get moderated(): boolean;
545
+ get emojiId(): string | undefined;
546
+ get emojiName(): string | undefined;
547
+ _patch(data: Partial<APIGuildForumTag>): void;
548
+ }
549
+ //#endregion
550
+ //#region src/lib/structures/channel/GuildForumChannel.d.ts
551
+ interface CreateForumPostOptions {
552
+ name: string;
553
+ message: MessageCreateOptions | string;
554
+ autoArchiveDuration?: ThreadAutoArchiveDuration;
555
+ rateLimitPerUser?: number;
556
+ appliedTags?: string[];
557
+ }
558
+ declare const GuildForumChannel_base: {
559
+ new (client: Client, data: APIGuildForumChannel): BaseChannel<APIGuildForumChannel, discord_api_types_v100.ChannelType.GuildForum>;
560
+ } & (abstract new (...args: any[]) => {
561
+ get parentId(): string | undefined;
562
+ get parent(): /*elided*/any | undefined;
563
+ get guildId(): string;
564
+ get guild(): Guild;
565
+ data: discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
566
+ get partial(): boolean;
567
+ get id(): string;
568
+ get type(): discord_api_types_v100.GuildChannelType;
174
569
  toString(): string;
175
- toJSON(): discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>;
570
+ toJSON(): discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>;
176
571
  isTextBased(): this is TextBasedChannel;
177
572
  isVoiceBased(): this is VoiceBasedChannel;
178
573
  isDM(): this is DMChannel;
574
+ isThread(): this is ThreadBasedChannel;
575
+ isPublicThread(): this is ThreadBasedChannel;
576
+ isPrivateThread(): this is ThreadBasedChannel;
577
+ isAnnouncementThread(): this is ThreadBasedChannel;
578
+ isCategory(): this is GuildCategory;
179
579
  inGuild(): this is GuildChannel;
180
580
  fetch(): Promise< /*elided*/any>;
181
- _patch(data: Partial<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>>): void;
581
+ _patch(data: Partial<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>>): void;
182
582
  client: Client<true>;
183
- }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APITextBasedChannel<discord_api_types_v100.ChannelType>>>;
184
- declare class DMChannel extends DMChannel_base {
583
+ }) & _bakit_utils0.AbstractConstructor<BaseChannel<discord_api_types_v100.APIGuildChannel<discord_api_types_v100.GuildChannelType>, discord_api_types_v100.GuildChannelType>>;
584
+ declare class GuildForumChannel extends GuildForumChannel_base {
185
585
  #private;
186
- constructor(client: Client, data: APIDMChannel);
187
- get recipients(): Collection<string, User>;
188
- get recipientId(): string;
189
- get recipient(): User;
190
- fetch(): Promise<this>;
191
- send(options: MessageCreateOptions | string): Promise<Message<false>>;
192
- fetchRecipients(force?: boolean): Promise<Collection<string, User> | undefined>;
193
- _patch(data: Partial<APIDMChannel>): void;
586
+ constructor(client: Client, data: APIGuildForumChannel);
587
+ get topic(): string | undefined;
588
+ get defaultAutoArchiveDuration(): ThreadAutoArchiveDuration | undefined;
589
+ get defaultSortOrder(): SortOrderType | null | undefined;
590
+ get defaultForumLayout(): ForumLayoutType | undefined;
591
+ get defaultThreadRateLimitPerUser(): number | undefined;
592
+ get nsfw(): boolean;
593
+ get tags(): Collection<string, Tag>;
594
+ _patch(data: Partial<APIGuildForumChannel>): void;
194
595
  }
195
596
  //#endregion
196
597
  //#region src/lib/structures/User.d.ts
@@ -236,58 +637,6 @@ declare class User extends BaseStructure {
236
637
  toString(): string;
237
638
  }
238
639
  //#endregion
239
- //#region src/lib/structures/Message.d.ts
240
- type MessagePayload = APIMessage | GatewayMessageCreateDispatchData | GatewayMessageUpdateDispatchData;
241
- declare class Message<InGuild extends boolean = boolean> extends BaseStructure {
242
- #private;
243
- data: MessagePayload;
244
- constructor(client: Client, data: MessagePayload);
245
- get partial(): boolean;
246
- get content(): string;
247
- get id(): string;
248
- get channelId(): string;
249
- get channel(): InGuild extends true ? TextBasedChannel & GuildChannel : TextBasedChannel;
250
- get guildId(): InGuild extends true ? string : undefined;
251
- get guild(): InGuild extends true ? Guild : undefined;
252
- /**
253
- * The author of this message.
254
- *
255
- * **Note:** This property returns the cached `User` synchronously.
256
- * It may be stale if the users cache has short lifetime or uses an asynchronous remote store.
257
- * To ensure the author is up-to-date, use the `fetchAuthor()` method instead.
258
- */
259
- get author(): User;
260
- get createdAt(): Date;
261
- get editedAt(): Date | undefined;
262
- get createdTimestamp(): number;
263
- get editedTimestamp(): number | undefined;
264
- get url(): string;
265
- inGuild(): this is Message<true>;
266
- fetch(): Promise<Message>;
267
- /**
268
- * Fetches the author of this message from cache or Discord API.
269
- *
270
- * **Note:** It is recommended to use this method instead of the `author` property
271
- * if the users cache has short lifetime or is backed by an asynchronous remote cache.
272
- *
273
- * @param force - Whether to bypass the cache and force a request to the API.
274
- * @returns A promise that resolves to the `User` who authored this message.
275
- */
276
- fetchAuthor(force?: boolean): Promise<User>;
277
- reply(options: MessageReplyOptions): Promise<Message<boolean>>;
278
- sendToChannel(options: MessageReplyOptions): Promise<Message<boolean>>;
279
- edit(options: MessageEditOptions | string): Promise<Message<boolean>>;
280
- _patch(data: Partial<MessagePayload>): Promise<void>;
281
- toJSON(): MessagePayload;
282
- toString(): string;
283
- }
284
- //#endregion
285
- //#region src/lib/client/Partial.d.ts
286
- declare enum Partial$1 {
287
- Message = 0,
288
- User = 1
289
- }
290
- //#endregion
291
640
  //#region src/lib/utils/IntentsBitField.d.ts
292
641
  type IntentResolvable = number | bigint | GatewayIntentBits | GatewayIntentBits[];
293
642
  declare class IntentsBitField {
@@ -325,6 +674,8 @@ declare class LocalCacheAdapter<Key, Value> extends BaseCacheAdapter<Key, Value>
325
674
  clear(): void;
326
675
  has(key: Key): boolean;
327
676
  find(filter: (data: Value) => boolean): Value | undefined;
677
+ forEach(callback: (value: Value, key: Key) => void): void;
678
+ map<T>(callback: (value: Value, key: Key) => T): T[];
328
679
  sweep(filter: (data: Value) => boolean): void;
329
680
  sweepTTL(): void;
330
681
  }
@@ -343,7 +694,7 @@ declare class HybridCache<Key, Value> {
343
694
  has(key: Key): Promise<boolean>;
344
695
  }
345
696
  //#endregion
346
- //#region src/lib/client/ClientCacheManager.d.ts
697
+ //#region src/lib/managers/client/ClientCacheManager.d.ts
347
698
  interface ClientCacheManagerOptions {
348
699
  users?: ClientModuleCacheOptions<User> | boolean;
349
700
  messages?: ClientModuleCacheOptions<Message> | boolean;
@@ -371,6 +722,71 @@ declare class ClientCacheManager {
371
722
  resolveLocal<Value>(cache: LocalCacheAdapter<string, Value>, id: string, factory: () => Value, patch?: (value: Value) => void): Value;
372
723
  }
373
724
  //#endregion
725
+ //#region src/lib/structures/Message.d.ts
726
+ type MessagePayload = APIMessage | GatewayMessageCreateDispatchData | GatewayMessageUpdateDispatchData;
727
+ declare class Message<InGuild extends boolean = boolean> extends BaseStructure {
728
+ #private;
729
+ data: MessagePayload;
730
+ constructor(client: Client, data: MessagePayload);
731
+ get partial(): boolean;
732
+ get content(): string;
733
+ get id(): string;
734
+ get channelId(): string;
735
+ get channel(): InGuild extends true ? TextBasedChannel & GuildChannel : TextBasedChannel;
736
+ get guildId(): InGuild extends true ? string : undefined;
737
+ get guild(): InGuild extends true ? Guild : undefined;
738
+ /**
739
+ * The author of this message.
740
+ *
741
+ * **Note:** This property returns the cached `User` synchronously.
742
+ * It may be stale if the users cache has short lifetime or uses an asynchronous remote store.
743
+ * To ensure the author is up-to-date, use the `fetchAuthor()` method instead.
744
+ */
745
+ get author(): User;
746
+ get createdAt(): Date;
747
+ get editedAt(): Date | undefined;
748
+ get createdTimestamp(): number;
749
+ get editedTimestamp(): number | undefined;
750
+ get url(): string;
751
+ inGuild(): this is Message<true>;
752
+ fetch(): Promise<Message>;
753
+ /**
754
+ * Fetches the author of this message from cache or Discord API.
755
+ *
756
+ * **Note:** It is recommended to use this method instead of the `author` property
757
+ * if the users cache has short lifetime or is backed by an asynchronous remote cache.
758
+ *
759
+ * @param force - Whether to bypass the cache and force a request to the API.
760
+ * @returns A promise that resolves to the `User` who authored this message.
761
+ */
762
+ fetchAuthor(force?: boolean): Promise<User>;
763
+ reply(options: string | MessageReplyOptions): Promise<Message<boolean>>;
764
+ edit(options: string | MessageEditOptions): Promise<Message<boolean>>;
765
+ _patch(data: Partial<MessagePayload>): Promise<void>;
766
+ toJSON(): MessagePayload;
767
+ toString(): string;
768
+ }
769
+ //#endregion
770
+ //#region src/lib/client/ClientHelper.d.ts
771
+ declare class ClientHelper {
772
+ readonly client: Client;
773
+ constructor(client: Client);
774
+ fetchUser(userId: string, force?: boolean): Promise<User>;
775
+ createDM(userId: string, force?: boolean): Promise<DMChannel>;
776
+ fetchMessage(channelId: string, messageId: string, force?: boolean): Promise<Message<boolean>>;
777
+ deleteMessage(channelId: string, messageId: string): Promise<void>;
778
+ fetchGuild(guildId: string, force?: boolean): Promise<Guild>;
779
+ fetchChannel<C extends Channel>(channelId: string, force?: boolean): Promise<C | undefined>;
780
+ crosspostMessage(channelId: string, messageId: string): Promise<Message<true>>;
781
+ }
782
+ //#endregion
783
+ //#region src/lib/client/Partial.d.ts
784
+ declare enum Partial$1 {
785
+ Message = 0,
786
+ User = 1,
787
+ Channel = 2
788
+ }
789
+ //#endregion
374
790
  //#region src/lib/client/Client.d.ts
375
791
  interface ClientOptions {
376
792
  token: string;
@@ -396,6 +812,10 @@ interface ClientEvents {
396
812
  channelCreate: [channel: Channel];
397
813
  channelUpdate: [channel: Channel];
398
814
  channelDelete: [channel: Channel];
815
+ threadCreate: [thread: ThreadBasedChannel];
816
+ threadUpdate: [thread: ThreadBasedChannel];
817
+ threadDelete: [thread: ThreadBasedChannel];
818
+ typingStart: [typing: Typing];
399
819
  }
400
820
  declare class Client<Ready extends boolean = boolean> extends EventEmitter<ClientEvents> {
401
821
  #private;
@@ -405,13 +825,18 @@ declare class Client<Ready extends boolean = boolean> extends EventEmitter<Clien
405
825
  };
406
826
  readonly shards: ShardingManager$1;
407
827
  readonly rest: RESTLike$1;
828
+ /**
829
+ * @private
830
+ * @deprecated
831
+ */
408
832
  readonly helper: ClientHelper;
409
833
  readonly cache: ClientCacheManager;
834
+ readonly channels: ClientChannelManager;
410
835
  constructor(options: ClientOptions, rest?: RESTLike$1);
411
836
  get user(): Ready extends true ? User : User | undefined;
412
837
  login(): Promise<void>;
413
838
  }
414
839
  declare function createClient(options: ClientOptions): Client<boolean>;
415
840
  //#endregion
416
- export { type AbstractConstructor, type Awaitable, BaseCacheAdapter, BaseChannel, BaseChannelPayload, type BaseRESTEvents, Channel, Client, ClientEvents, ClientHelper, ClientOptions, ClientShardingOptions, Cluster, type ClusterEvents, type ClusterOptions, type Constructor, DEFAULT_REST_OPTIONS, discord_api_types_v100 as DiscordAPIV10, DiscordHTTPError, type DiscordHTTPErrorRequest, type DiscordHTTPFlattenedError, type DiscordHTTPValidationError, type FunctionLike, Guild, GuildChannel, GuildPayload, GuildTextChannel, GuildVoiceChannel, HybridCache, Intent, IntentResolvable, IntentsBitField, LocalCacheAdapter, LocalCacheTTLEntry, Message, MessageCreateOptions, MessageEditOptions, MessagePayload, MessageReplyOptions, Partial$1 as Partial, type Promisify, type PromisifyValue, REST, RESTAdapter, type RESTAdapterEvents, type RESTEndpoint, type RESTEvents, type RESTLike, RESTMethod, type RESTOptions, type RESTProxyOptions, type RESTRequestFn, type RESTRequestOptions, type RPCHandler, type RejectFn, type ResolveFn, Service, type ServiceClientRuntime, ServiceDriver, type ServiceOptions, ServiceProcess, type ServiceProcessEvents, type ServiceServerRuntime, ServiceState, Shard, type ShardEvents, type ShardOptions, ShardState, ShardStrategy, ShardingManager, type ShardingManagerEvents, type ShardingManagerOptions, TextBasedChannel, TransportClient, type TransportClientEvents, TransportServer, type TransportServerEvents, User, UserPayload, VoiceBasedChannel, capitalize, createClient, createREST, createRESTAdapter, createService, createTransportClient, createTransportServer, instanceToObject, isCommonJS, isESM, isPlainObject, isPromiseLike, promisify, sleep };
841
+ export { type AbstractConstructor, AnnouncementThread, type Awaitable, BaseCacheAdapter, BaseChannel, BaseChannelPayload, type BaseRESTEvents, Channel, Client, ClientEvents, ClientHelper, ClientOptions, ClientShardingOptions, Cluster, type ClusterEvents, type ClusterOptions, type Constructor, CreateForumPostOptions, DEFAULT_REST_OPTIONS, DMChannel, discord_api_types_v100 as DiscordAPIV10, DiscordHTTPError, type DiscordHTTPErrorRequest, type DiscordHTTPFlattenedError, type DiscordHTTPValidationError, type FunctionLike, Guild, GuildAnnouncementChannel, GuildCategory, GuildChannel, GuildForumChannel, GuildPayload, GuildStageVoiceChannel, GuildTextChannel, GuildVoiceChannel, HybridCache, Intent, IntentResolvable, IntentsBitField, LocalCacheAdapter, LocalCacheTTLEntry, Message, MessagePayload, Partial$1 as Partial, PrivateThread, type Promisify, type PromisifyValue, PublicThread, REST, RESTAdapter, type RESTAdapterEvents, type RESTEndpoint, type RESTEvents, type RESTLike, RESTMethod, type RESTOptions, type RESTProxyOptions, type RESTRequestFn, type RESTRequestOptions, type RPCHandler, type RejectFn, type ResolveFn, Service, type ServiceClientRuntime, ServiceDriver, type ServiceOptions, ServiceProcess, type ServiceProcessEvents, type ServiceServerRuntime, ServiceState, Shard, type ShardEvents, type ShardOptions, ShardState, ShardStrategy, ShardingManager, type ShardingManagerEvents, type ShardingManagerOptions, Tag, TextBasedChannel, ThreadBasedChannel, ThreadChannel, TransportClient, type TransportClientEvents, TransportServer, type TransportServerEvents, Typing, TypingPayload, User, UserPayload, VoiceBasedChannel, capitalize, createClient, createREST, createRESTAdapter, createService, createTransportClient, createTransportServer, instanceToObject, isCommonJS, isESM, isPlainObject, isPromiseLike, promisify, sleep };
417
842
  //# sourceMappingURL=index.d.cts.map