@wolfstar/plugin-gateway 0.1.2-next-20260926220154 → 0.1.2-next-20260926220856
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/README.md +7 -7
- package/dist/esm/index.d.ts +296 -26
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +297 -26
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -272,13 +272,13 @@ Mixin(MyTextChannel, [MyMixin]);
|
|
|
272
272
|
```
|
|
273
273
|
|
|
274
274
|
> [!NOTE]
|
|
275
|
-
> `Structure`
|
|
276
|
-
> [`@discordjs/structures`](https://github.com/discordjs/discord.js/tree/main/packages/structures)
|
|
277
|
-
>
|
|
278
|
-
>
|
|
279
|
-
>
|
|
280
|
-
>
|
|
281
|
-
>
|
|
275
|
+
> `Structure`, `BitField`, and `PermissionsBitField` are adapted from
|
|
276
|
+
> [`@discordjs/structures`](https://github.com/discordjs/discord.js/tree/main/packages/structures)
|
|
277
|
+
> (Apache-2.0), which is not a dependency: it is only published as `dev` snapshots requiring
|
|
278
|
+
> Node.js 24.17, and has no `Guild` nor `GuildMember` yet. That package does not export the symbols
|
|
279
|
+
> keying a structure's data and its patch/clone methods, but creates them with `Symbol.for`, so
|
|
280
|
+
> `kData`, `kPatch`, and `kClone` are created under the same keys: they are the very same symbols.
|
|
281
|
+
> The structures here are this package's own, following its conventions.
|
|
282
282
|
|
|
283
283
|
### Guilds, emojis, stickers and invites
|
|
284
284
|
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -3,9 +3,16 @@ import { OptionalWebSocketManagerOptions, ShardRange, WebSocketManager } from "@
|
|
|
3
3
|
import { Client as Client$1 } from "@discordjs/core";
|
|
4
4
|
import { Awaitable, Cache, CacheEntityName, CacheEntityTypes, EntityCache } from "@wolfstar/plugin-cache";
|
|
5
5
|
import { APIApplication, APIApplicationCommand, APIAttachment, APIAuditLogChange, APIAutoModerationAction, APIAutoModerationRule, APIAutoModerationRuleTriggerMetadata, APIAvatarDecorationData, APIChannel, APIChannelMention, APICollectibles, APIEmbed, APIEmbedAuthor, APIEmbedField, APIEmbedFooter, APIEmbedImage, APIEmbedProvider, APIEmbedThumbnail, APIEmbedVideo, APIEmoji, APIExtendedInvite, APIGuild, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIGuildMember, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, APIGuildPreview, APIGuildScheduledEvent, APIGuildScheduledEventEntityMetadata, APIGuildScheduledEventRecurrenceRule, APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetMember, APIIncidentsData, APIInviteChannel, APIInviteGuild, APIMessage, APIOverwrite, APIPartialEmoji, APIPoll, APIPollAnswer, APIReaction, APIRole, APIRoleTags, APISoundboardSound, APIStageInstance, APISticker, APIStickerPack, APITemplate, APIThreadChannel, APIThreadMember, APIUser, APIUserPrimaryGuild, APIVoiceRegion, APIWebhook, ActivityFlags, ActivityType, AttachmentFlags, AuditLogEvent, AutoModerationRuleEventType, AutoModerationRuleKeywordPresetType, AutoModerationRuleTriggerType, ChannelFlags, ChannelType, ForumLayoutType, GatewayActivity, GatewayActivityAssets, GatewayActivityUpdateData, GatewayAutoModerationActionExecutionDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayDispatchEvents, GatewayDispatchPayload, GatewayGuildDeleteDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildSoundboardSoundDeleteDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntentBits, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayPresenceClientStatus, GatewayPresenceUpdateData, GatewayReadyDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSync, GatewayThreadMembersUpdateDispatchData, GatewayTypingStartDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildMemberFlags, GuildOnboardingMode, GuildOnboardingPromptType, GuildPremiumTier, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventStatus, GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle, InviteTargetType, InviteType, Locale, MessageFlags, MessageType, OverwriteType, PermissionFlagsBits, PresenceUpdateReceiveStatus, PresenceUpdateStatus, RESTGetAPIGuildVanityUrlResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIGuildJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIGuildsJSONBody, RESTPostAPIWebhookWithTokenJSONBody, ReactionType, RoleFlags, Snowflake, SortOrderType, StageInstancePrivacyLevel, StickerFormatType, ThreadAutoArchiveDuration, ThreadChannelType, UserFlags, VideoQualityMode, WebhookType } from "discord-api-types/v10";
|
|
6
|
-
import { ActivityFlagsBitField as ActivityFlagsBitField$1, AttachmentFlagsBitField as AttachmentFlagsBitField$1, BitField, BitField as BitField$1, BitFieldResolvable, BitFieldResolvable as BitFieldResolvable$1, ChannelFlagsBitField as ChannelFlagsBitField$1, MessageFlagsBitField as MessageFlagsBitField$1, Partialize, PermissionsBitField, Structure as Structure$1 } from "@discordjs/structures";
|
|
7
6
|
import { BaseImageURLOptions, EmojiURLOptions, ImageURLOptions, RawFile } from "@discordjs/rest";
|
|
8
7
|
//#region src/structures/Structure.d.ts
|
|
8
|
+
/*!
|
|
9
|
+
* The base of `Structure` (its data template, constructor, `kPatch`, `kClone`, `optimizeData`, and `toJSON`) is adapted
|
|
10
|
+
* from `@discordjs/structures`' `Structure` (https://github.com/discordjs/discord.js/tree/main/packages/structures),
|
|
11
|
+
* Copyright 2023 Noel Buechler and Chai Kohen, licensed under the Apache License, Version 2.0
|
|
12
|
+
* (https://www.apache.org/licenses/LICENSE-2.0). Changed from the original: merged into this package's `Structure`,
|
|
13
|
+
* which adds relations and parsed timestamps, with `kPatch` and `kClone` made public and the mixin constructor hook
|
|
14
|
+
* dropped.
|
|
15
|
+
*/
|
|
9
16
|
/**
|
|
10
17
|
* The symbol under which a {@link Structure} stores its raw API data, shared with `@discordjs/structures`.
|
|
11
18
|
*/
|
|
@@ -24,18 +31,26 @@ export declare const kClone: unique symbol;
|
|
|
24
31
|
*/
|
|
25
32
|
export declare const kRelations: unique symbol;
|
|
26
33
|
/**
|
|
27
|
-
* The base class every structure extends
|
|
28
|
-
*
|
|
34
|
+
* The base class every structure extends, following `@discordjs/structures`' `Structure`, with its data and
|
|
35
|
+
* patch/clone methods reachable from subclasses outside of discord.js.
|
|
29
36
|
*
|
|
30
37
|
* @remarks
|
|
31
38
|
* Structures never hold a reference to a client, so they can be built from any raw payload, be it a gateway dispatch,
|
|
32
39
|
* a cache hit, or a REST response.
|
|
33
40
|
*
|
|
34
41
|
* @typeParam Data The raw API data this structure wraps.
|
|
35
|
-
* @typeParam
|
|
42
|
+
* @typeParam _Omitted The keys the structure's `DataTemplate` strips from the stored data, for subclasses to type their
|
|
43
|
+
* constructor with.
|
|
36
44
|
*/
|
|
37
|
-
export declare abstract class Structure<Data extends object,
|
|
45
|
+
export declare abstract class Structure<Data extends object, _Omitted extends keyof Data | "" = ""> {
|
|
38
46
|
#private;
|
|
47
|
+
/**
|
|
48
|
+
* The template used for removing data from the raw data stored for each structure.
|
|
49
|
+
*
|
|
50
|
+
* @remarks This template should be overridden in all subclasses to provide more accurate type information.
|
|
51
|
+
* The template in the base {@link Structure} class will have no effect on most subclasses for this reason.
|
|
52
|
+
*/
|
|
53
|
+
protected static readonly DataTemplate: Record<string, unknown>;
|
|
39
54
|
/**
|
|
40
55
|
* The raw API data of this structure.
|
|
41
56
|
*/
|
|
@@ -52,6 +67,21 @@ export declare abstract class Structure<Data extends object, Omitted extends key
|
|
|
52
67
|
* @param relations The related structures, resolved from the cache by the structure's manager.
|
|
53
68
|
*/
|
|
54
69
|
constructor(data: Readonly<Partial<Data>>, relations?: object);
|
|
70
|
+
/**
|
|
71
|
+
* @returns A cloned version of the data template, ready to create a new data object.
|
|
72
|
+
*/
|
|
73
|
+
private getDataTemplate;
|
|
74
|
+
/**
|
|
75
|
+
* Stores raw data in optimized formats, used in tandem with a data template. Called by the constructor and by
|
|
76
|
+
* `kPatch`.
|
|
77
|
+
*
|
|
78
|
+
* @example `created_timestamp` is an ISO string, which can be stored in optimized form as a number.
|
|
79
|
+
* @param _data The raw data received from the API to optimize.
|
|
80
|
+
* @remarks Implemented in subclasses and mixins where needed; mixins must use the closest ancestor's access modifier.
|
|
81
|
+
* When implementing it, call `super.optimizeData` if any class in the super chain aside from {@link Structure}
|
|
82
|
+
* implements it. Mixins never need to, as `Mixin` walks the prototype chain.
|
|
83
|
+
*/
|
|
84
|
+
protected optimizeData(_data: Partial<Data>): void;
|
|
55
85
|
/** Parses a timestamp once when constructing or patching a structure. */
|
|
56
86
|
protected optimizeTimestamp(key: string, value: string | null | undefined): void;
|
|
57
87
|
/** Gets a timestamp previously parsed by `optimizeData`. */
|
|
@@ -70,6 +100,14 @@ export declare abstract class Structure<Data extends object, Omitted extends key
|
|
|
70
100
|
* @returns The copy.
|
|
71
101
|
*/
|
|
72
102
|
[kClone](patch?: Readonly<Partial<Data>>): this;
|
|
103
|
+
/**
|
|
104
|
+
* Transforms this structure to its JSON format, with raw API data (or close to it), automatically called by
|
|
105
|
+
* `JSON.stringify()` when this structure is stringified.
|
|
106
|
+
*
|
|
107
|
+
* @remarks
|
|
108
|
+
* The type of this data is determined by omissions at runtime and is only guaranteed for default omissions.
|
|
109
|
+
*/
|
|
110
|
+
toJSON(): Data;
|
|
73
111
|
/**
|
|
74
112
|
* Forgets resolved relations, e.g. when a patch carries fresher data for them.
|
|
75
113
|
*
|
|
@@ -148,6 +186,118 @@ export declare class AnonymousGuild<Data extends AnonymousGuildData = AnonymousG
|
|
|
148
186
|
toString(): string;
|
|
149
187
|
}
|
|
150
188
|
//#endregion
|
|
189
|
+
//#region src/util/BitField.d.ts
|
|
190
|
+
/*!
|
|
191
|
+
* Adapted from `@discordjs/structures`' `BitField` (https://github.com/discordjs/discord.js/tree/main/packages/structures),
|
|
192
|
+
* Copyright 2023 Noel Buechler and Chai Kohen, licensed under the Apache License, Version 2.0
|
|
193
|
+
* (https://www.apache.org/licenses/LICENSE-2.0). Changed from the original: restyled, and its type helpers inlined.
|
|
194
|
+
*/
|
|
195
|
+
interface RecursiveReadonlyArray<ItemType> extends ReadonlyArray<ItemType | RecursiveReadonlyArray<ItemType>> {}
|
|
196
|
+
type EnumLike<Enum, Value> = Record<keyof Enum, Value>;
|
|
197
|
+
type NonAbstract<Type extends abstract new (...args: any) => any> = Type extends (abstract new (...args: infer Args) => infer Instance) ? Pick<Type, keyof Type> & (new (...args: Args) => Instance) : never;
|
|
198
|
+
/**
|
|
199
|
+
* Data that can be resolved to give a bit field. This can be:
|
|
200
|
+
* A bit number (this can be a number literal or a value taken from {@link (BitField:class).Flags})
|
|
201
|
+
* A string bit number
|
|
202
|
+
* An instance of BitField
|
|
203
|
+
* An Array of BitFieldResolvable
|
|
204
|
+
*/
|
|
205
|
+
export type BitFieldResolvable<Flags extends string> = Flags | Readonly<BitField<Flags>> | RecursiveReadonlyArray<Flags | Readonly<BitField<Flags>> | bigint | number | `${bigint}`> | bigint | number | `${bigint}`;
|
|
206
|
+
/**
|
|
207
|
+
* Data structure that makes it easy to interact with a bit field.
|
|
208
|
+
*/
|
|
209
|
+
export declare abstract class BitField<Flags extends string> {
|
|
210
|
+
/**
|
|
211
|
+
* Numeric bit field flags.
|
|
212
|
+
*
|
|
213
|
+
* @remarks Defined in extension classes
|
|
214
|
+
*/
|
|
215
|
+
static readonly Flags: EnumLike<unknown, bigint | number>;
|
|
216
|
+
static readonly DefaultBit: bigint;
|
|
217
|
+
/**
|
|
218
|
+
* Bitfield of the packed bits
|
|
219
|
+
*/
|
|
220
|
+
bitField: bigint;
|
|
221
|
+
["constructor"]: NonAbstract<typeof BitField<Flags>>;
|
|
222
|
+
/**
|
|
223
|
+
* @param bits - Bit(s) to read from
|
|
224
|
+
*/
|
|
225
|
+
constructor(bits?: BitFieldResolvable<Flags>);
|
|
226
|
+
/**
|
|
227
|
+
* Checks whether the bit field has a bit, or any of multiple bits.
|
|
228
|
+
*
|
|
229
|
+
* @param bit - Bit(s) to check for
|
|
230
|
+
* @returns Whether the bit field has the bit(s)
|
|
231
|
+
*/
|
|
232
|
+
any(bit: BitFieldResolvable<Flags>): boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Checks if this bit field equals another
|
|
235
|
+
*
|
|
236
|
+
* @param bit - Bit(s) to check for
|
|
237
|
+
* @returns Whether this bit field equals the other
|
|
238
|
+
*/
|
|
239
|
+
equals(bit: BitFieldResolvable<Flags>): boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Checks whether the bit field has a bit, or multiple bits.
|
|
242
|
+
*
|
|
243
|
+
* @param bit - Bit(s) to check for
|
|
244
|
+
* @returns Whether the bit field has the bit(s)
|
|
245
|
+
*/
|
|
246
|
+
has(bit: BitFieldResolvable<Flags>, ..._hasParams: unknown[]): boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Gets all given bits that are missing from the bit field.
|
|
249
|
+
*
|
|
250
|
+
* @param bits - Bit(s) to check for
|
|
251
|
+
* @param hasParams - Additional parameters for the has method, if any
|
|
252
|
+
* @returns A bit field containing the missing bits
|
|
253
|
+
*/
|
|
254
|
+
missing(bits: BitFieldResolvable<Flags>, ...hasParams: readonly unknown[]): Flags[];
|
|
255
|
+
/**
|
|
256
|
+
* Freezes these bits, making them immutable.
|
|
257
|
+
*
|
|
258
|
+
* @returns This bit field but frozen
|
|
259
|
+
*/
|
|
260
|
+
freeze(): Readonly<this>;
|
|
261
|
+
/**
|
|
262
|
+
* Adds bits to these ones.
|
|
263
|
+
*
|
|
264
|
+
* @param bits - Bits to add
|
|
265
|
+
* @returns These bits or new BitField if the instance is frozen.
|
|
266
|
+
*/
|
|
267
|
+
add(...bits: BitFieldResolvable<Flags>[]): BitField<Flags>;
|
|
268
|
+
/**
|
|
269
|
+
* Removes bits from these.
|
|
270
|
+
*
|
|
271
|
+
* @param bits - Bits to remove
|
|
272
|
+
* @returns These bits or new BitField if the instance is frozen.
|
|
273
|
+
*/
|
|
274
|
+
remove(...bits: BitFieldResolvable<Flags>[]): BitField<Flags>;
|
|
275
|
+
/**
|
|
276
|
+
* Gets an object mapping field names to a boolean indicating whether the bit is available.
|
|
277
|
+
*
|
|
278
|
+
* @param hasParams - Additional parameters for the has method, if any
|
|
279
|
+
* @returns An object mapping field names to a boolean indicating whether the bit is available
|
|
280
|
+
*/
|
|
281
|
+
serialize(...hasParams: readonly unknown[]): Partial<Record<keyof Flags, boolean>>;
|
|
282
|
+
/**
|
|
283
|
+
* Gets an Array of bit field names based on the bits available.
|
|
284
|
+
*
|
|
285
|
+
* @param hasParams - Additional parameters for the has method, if any
|
|
286
|
+
* @returns An Array of bit field names
|
|
287
|
+
*/
|
|
288
|
+
toArray(...hasParams: readonly unknown[]): Flags[];
|
|
289
|
+
toJSON(asNumber?: boolean): string | number;
|
|
290
|
+
valueOf(): bigint;
|
|
291
|
+
[Symbol.iterator](...hasParams: unknown[]): Generator<Flags, void, unknown>;
|
|
292
|
+
/**
|
|
293
|
+
* Resolves bit fields to their numeric form.
|
|
294
|
+
*
|
|
295
|
+
* @param bit - bit(s) to resolve
|
|
296
|
+
* @returns the numeric value of the bit fields
|
|
297
|
+
*/
|
|
298
|
+
static resolve<Flags extends string = string>(bit: BitFieldResolvable<Flags>): bigint;
|
|
299
|
+
}
|
|
300
|
+
//#endregion
|
|
151
301
|
//#region src/util/PermissionsBitField.d.ts
|
|
152
302
|
/**
|
|
153
303
|
* The name of any permission.
|
|
@@ -156,7 +306,116 @@ export type PermissionsString = keyof typeof PermissionFlagsBits;
|
|
|
156
306
|
/**
|
|
157
307
|
* Anything a `PermissionsBitField` can be built from.
|
|
158
308
|
*/
|
|
159
|
-
export type PermissionResolvable = BitFieldResolvable
|
|
309
|
+
export type PermissionResolvable = BitFieldResolvable<PermissionsString>;
|
|
310
|
+
/**
|
|
311
|
+
* Data structure that makes it easy to interact with a permission bit field. All {@link GuildMember}s have a set of
|
|
312
|
+
* permissions in their guild, and each channel in the guild may also have {@link PermissionOverwrites} for the member
|
|
313
|
+
* that override their default permissions.
|
|
314
|
+
*/
|
|
315
|
+
export declare class PermissionsBitField extends BitField<PermissionsString> {
|
|
316
|
+
/**
|
|
317
|
+
* Numeric permission flags.
|
|
318
|
+
*
|
|
319
|
+
* @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}
|
|
320
|
+
*/
|
|
321
|
+
static Flags: {
|
|
322
|
+
readonly CreateInstantInvite: bigint;
|
|
323
|
+
readonly KickMembers: bigint;
|
|
324
|
+
readonly BanMembers: bigint;
|
|
325
|
+
readonly Administrator: bigint;
|
|
326
|
+
readonly ManageChannels: bigint;
|
|
327
|
+
readonly ManageGuild: bigint;
|
|
328
|
+
readonly AddReactions: bigint;
|
|
329
|
+
readonly ViewAuditLog: bigint;
|
|
330
|
+
readonly PrioritySpeaker: bigint;
|
|
331
|
+
readonly Stream: bigint;
|
|
332
|
+
readonly ViewChannel: bigint;
|
|
333
|
+
readonly SendMessages: bigint;
|
|
334
|
+
readonly SendTTSMessages: bigint;
|
|
335
|
+
readonly ManageMessages: bigint;
|
|
336
|
+
readonly EmbedLinks: bigint;
|
|
337
|
+
readonly AttachFiles: bigint;
|
|
338
|
+
readonly ReadMessageHistory: bigint;
|
|
339
|
+
readonly MentionEveryone: bigint;
|
|
340
|
+
readonly UseExternalEmojis: bigint;
|
|
341
|
+
readonly ViewGuildInsights: bigint;
|
|
342
|
+
readonly Connect: bigint;
|
|
343
|
+
readonly Speak: bigint;
|
|
344
|
+
readonly MuteMembers: bigint;
|
|
345
|
+
readonly DeafenMembers: bigint;
|
|
346
|
+
readonly MoveMembers: bigint;
|
|
347
|
+
readonly UseVAD: bigint;
|
|
348
|
+
readonly ChangeNickname: bigint;
|
|
349
|
+
readonly ManageNicknames: bigint;
|
|
350
|
+
readonly ManageRoles: bigint;
|
|
351
|
+
readonly ManageWebhooks: bigint;
|
|
352
|
+
readonly ManageEmojisAndStickers: bigint;
|
|
353
|
+
readonly ManageGuildExpressions: bigint;
|
|
354
|
+
readonly UseApplicationCommands: bigint;
|
|
355
|
+
readonly RequestToSpeak: bigint;
|
|
356
|
+
readonly ManageEvents: bigint;
|
|
357
|
+
readonly ManageThreads: bigint;
|
|
358
|
+
readonly CreatePublicThreads: bigint;
|
|
359
|
+
readonly CreatePrivateThreads: bigint;
|
|
360
|
+
readonly UseExternalStickers: bigint;
|
|
361
|
+
readonly SendMessagesInThreads: bigint;
|
|
362
|
+
readonly UseEmbeddedActivities: bigint;
|
|
363
|
+
readonly ModerateMembers: bigint;
|
|
364
|
+
readonly ViewCreatorMonetizationAnalytics: bigint;
|
|
365
|
+
readonly UseSoundboard: bigint;
|
|
366
|
+
readonly CreateGuildExpressions: bigint;
|
|
367
|
+
readonly CreateEvents: bigint;
|
|
368
|
+
readonly UseExternalSounds: bigint;
|
|
369
|
+
readonly SendVoiceMessages: bigint;
|
|
370
|
+
readonly SetVoiceChannelStatus: bigint;
|
|
371
|
+
readonly SendPolls: bigint;
|
|
372
|
+
readonly UseExternalApps: bigint;
|
|
373
|
+
readonly PinMessages: bigint;
|
|
374
|
+
readonly BypassSlowmode: bigint;
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* Bit field representing every permission combined
|
|
378
|
+
*/
|
|
379
|
+
static readonly All: bigint;
|
|
380
|
+
/**
|
|
381
|
+
* Bit field representing the default permissions for users
|
|
382
|
+
*/
|
|
383
|
+
static readonly Default = 104324673n;
|
|
384
|
+
/**
|
|
385
|
+
* Bit field representing the permissions required for moderators of stage channels
|
|
386
|
+
*/
|
|
387
|
+
static readonly StageModerator: bigint;
|
|
388
|
+
/**
|
|
389
|
+
* Gets all given bits that are missing from the bit field.
|
|
390
|
+
*
|
|
391
|
+
* @param bits - Bit(s) to check for
|
|
392
|
+
* @param checkAdmin - Whether to allow the administrator permission to override
|
|
393
|
+
* @returns A bit field containing the missing permissions
|
|
394
|
+
*/
|
|
395
|
+
missing(bits: PermissionResolvable, checkAdmin?: boolean): PermissionsString[];
|
|
396
|
+
/**
|
|
397
|
+
* Checks whether the bit field has a permission, or any of multiple permissions.
|
|
398
|
+
*
|
|
399
|
+
* @param permission - Permission(s) to check for
|
|
400
|
+
* @param checkAdmin - Whether to allow the administrator permission to override
|
|
401
|
+
* @returns Whether the bit field has the permission(s)
|
|
402
|
+
*/
|
|
403
|
+
any(permission: PermissionResolvable, checkAdmin?: boolean): boolean;
|
|
404
|
+
/**
|
|
405
|
+
* Checks whether the bit field has a permission, or multiple permissions.
|
|
406
|
+
*
|
|
407
|
+
* @param permission - Permission(s) to check for
|
|
408
|
+
* @param checkAdmin - Whether to allow the administrator permission to override
|
|
409
|
+
* @returns Whether the bit field has the permission(s)
|
|
410
|
+
*/
|
|
411
|
+
has(permission: PermissionResolvable, checkAdmin?: boolean): boolean;
|
|
412
|
+
/**
|
|
413
|
+
* Gets an Array of bitfield names based on the permissions available.
|
|
414
|
+
*
|
|
415
|
+
* @returns An Array of permission names
|
|
416
|
+
*/
|
|
417
|
+
toArray(): PermissionsString[];
|
|
418
|
+
}
|
|
160
419
|
//#endregion
|
|
161
420
|
//#region src/util/channels.d.ts
|
|
162
421
|
/**
|
|
@@ -589,44 +848,44 @@ export declare class AutoModerationRuleManager extends CachedManager<"autoModera
|
|
|
589
848
|
/**
|
|
590
849
|
* A 32-bit flags bitfield, resolving flag names to `bigint`s and serializing to a `number`.
|
|
591
850
|
*/
|
|
592
|
-
export declare abstract class NumberFlagsBitField<Flags extends string> extends BitField
|
|
593
|
-
static resolve<Flags extends string = string>(bit: BitFieldResolvable
|
|
851
|
+
export declare abstract class NumberFlagsBitField<Flags extends string> extends BitField<Flags> {
|
|
852
|
+
static resolve<Flags extends string = string>(bit: BitFieldResolvable<Flags>): bigint;
|
|
594
853
|
toJSON(): number;
|
|
595
854
|
}
|
|
596
855
|
export type ActivityFlagsString = keyof typeof ActivityFlags;
|
|
597
|
-
export type ActivityFlagsResolvable = BitFieldResolvable
|
|
856
|
+
export type ActivityFlagsResolvable = BitFieldResolvable<ActivityFlagsString>;
|
|
598
857
|
/**
|
|
599
858
|
* The flags of a presence activity.
|
|
600
859
|
*/
|
|
601
|
-
export declare class ActivityFlagsBitField extends
|
|
602
|
-
static
|
|
860
|
+
export declare class ActivityFlagsBitField extends NumberFlagsBitField<ActivityFlagsString> {
|
|
861
|
+
static readonly Flags: typeof ActivityFlags;
|
|
603
862
|
}
|
|
604
863
|
export type AttachmentFlagsString = keyof typeof AttachmentFlags;
|
|
605
|
-
export type AttachmentFlagsResolvable = BitFieldResolvable
|
|
864
|
+
export type AttachmentFlagsResolvable = BitFieldResolvable<AttachmentFlagsString>;
|
|
606
865
|
/**
|
|
607
866
|
* The flags of a message attachment.
|
|
608
867
|
*/
|
|
609
|
-
export declare class AttachmentFlagsBitField extends
|
|
610
|
-
static
|
|
868
|
+
export declare class AttachmentFlagsBitField extends NumberFlagsBitField<AttachmentFlagsString> {
|
|
869
|
+
static readonly Flags: typeof AttachmentFlags;
|
|
611
870
|
}
|
|
612
871
|
export type ChannelFlagsString = keyof typeof ChannelFlags;
|
|
613
|
-
export type ChannelFlagsResolvable = BitFieldResolvable
|
|
872
|
+
export type ChannelFlagsResolvable = BitFieldResolvable<ChannelFlagsString>;
|
|
614
873
|
/**
|
|
615
874
|
* The flags of a channel.
|
|
616
875
|
*/
|
|
617
|
-
export declare class ChannelFlagsBitField extends
|
|
618
|
-
static
|
|
876
|
+
export declare class ChannelFlagsBitField extends NumberFlagsBitField<ChannelFlagsString> {
|
|
877
|
+
static readonly Flags: typeof ChannelFlags;
|
|
619
878
|
}
|
|
620
879
|
export type MessageFlagsString = keyof typeof MessageFlags;
|
|
621
|
-
export type MessageFlagsResolvable = BitFieldResolvable
|
|
880
|
+
export type MessageFlagsResolvable = BitFieldResolvable<MessageFlagsString>;
|
|
622
881
|
/**
|
|
623
882
|
* The flags of a message.
|
|
624
883
|
*/
|
|
625
|
-
export declare class MessageFlagsBitField extends
|
|
626
|
-
static
|
|
884
|
+
export declare class MessageFlagsBitField extends NumberFlagsBitField<MessageFlagsString> {
|
|
885
|
+
static readonly Flags: typeof MessageFlags;
|
|
627
886
|
}
|
|
628
887
|
export type GuildMemberFlagsString = keyof typeof GuildMemberFlags;
|
|
629
|
-
export type GuildMemberFlagsResolvable = BitFieldResolvable
|
|
888
|
+
export type GuildMemberFlagsResolvable = BitFieldResolvable<GuildMemberFlagsString>;
|
|
630
889
|
/**
|
|
631
890
|
* The flags of a guild member.
|
|
632
891
|
*/
|
|
@@ -634,7 +893,7 @@ export declare class GuildMemberFlagsBitField extends NumberFlagsBitField<GuildM
|
|
|
634
893
|
static readonly Flags: typeof GuildMemberFlags;
|
|
635
894
|
}
|
|
636
895
|
export type IntentsString = keyof typeof GatewayIntentBits;
|
|
637
|
-
export type IntentsResolvable = BitFieldResolvable
|
|
896
|
+
export type IntentsResolvable = BitFieldResolvable<IntentsString>;
|
|
638
897
|
/**
|
|
639
898
|
* The gateway intents to identify with.
|
|
640
899
|
*/
|
|
@@ -642,7 +901,7 @@ export declare class IntentsBitField extends NumberFlagsBitField<IntentsString>
|
|
|
642
901
|
static readonly Flags: typeof GatewayIntentBits;
|
|
643
902
|
}
|
|
644
903
|
export type RoleFlagsString = keyof typeof RoleFlags;
|
|
645
|
-
export type RoleFlagsResolvable = BitFieldResolvable
|
|
904
|
+
export type RoleFlagsResolvable = BitFieldResolvable<RoleFlagsString>;
|
|
646
905
|
/**
|
|
647
906
|
* The flags of a role.
|
|
648
907
|
*/
|
|
@@ -650,7 +909,7 @@ export declare class RoleFlagsBitField extends NumberFlagsBitField<RoleFlagsStri
|
|
|
650
909
|
static readonly Flags: typeof RoleFlags;
|
|
651
910
|
}
|
|
652
911
|
export type SystemChannelFlagsString = keyof typeof GuildSystemChannelFlags;
|
|
653
|
-
export type SystemChannelFlagsResolvable = BitFieldResolvable
|
|
912
|
+
export type SystemChannelFlagsResolvable = BitFieldResolvable<SystemChannelFlagsString>;
|
|
654
913
|
/**
|
|
655
914
|
* The flags of a guild's system channel, deciding which system messages are suppressed.
|
|
656
915
|
*/
|
|
@@ -658,7 +917,7 @@ export declare class SystemChannelFlagsBitField extends NumberFlagsBitField<Syst
|
|
|
658
917
|
static readonly Flags: typeof GuildSystemChannelFlags;
|
|
659
918
|
}
|
|
660
919
|
export type UserFlagsString = keyof typeof UserFlags;
|
|
661
|
-
export type UserFlagsResolvable = BitFieldResolvable
|
|
920
|
+
export type UserFlagsResolvable = BitFieldResolvable<UserFlagsString>;
|
|
662
921
|
/**
|
|
663
922
|
* The flags (badges) of a user.
|
|
664
923
|
*/
|
|
@@ -1300,6 +1559,17 @@ export declare class RoleManager extends CachedManager<"roles", Role, [guildId:
|
|
|
1300
1559
|
private store;
|
|
1301
1560
|
}
|
|
1302
1561
|
//#endregion
|
|
1562
|
+
//#region src/util/types.d.ts
|
|
1563
|
+
/*!
|
|
1564
|
+
* `Partialize` is adapted from `@discordjs/structures` (https://github.com/discordjs/discord.js/tree/main/packages/structures),
|
|
1565
|
+
* Copyright 2023 Noel Buechler and Chai Kohen, licensed under the Apache License, Version 2.0
|
|
1566
|
+
* (https://www.apache.org/licenses/LICENSE-2.0).
|
|
1567
|
+
*/
|
|
1568
|
+
/**
|
|
1569
|
+
* `Type`, with the `Omitted` keys made optional: the data a structure omitting them from its `DataTemplate` accepts.
|
|
1570
|
+
*/
|
|
1571
|
+
type Partialize<Type, Omitted extends keyof Type | ""> = Omit<Type, Omitted> & Partial<Pick<Type, Exclude<Omitted, "">>>;
|
|
1572
|
+
//#endregion
|
|
1303
1573
|
//#region src/structures/Role.d.ts
|
|
1304
1574
|
/**
|
|
1305
1575
|
* The colors of a role: `primaryColor` alone for a solid color, with `secondaryColor` for a gradient, and with
|
|
@@ -7434,5 +7704,5 @@ export declare function computeTargetPermissions(guildId: Snowflake, overwrites:
|
|
|
7434
7704
|
*/
|
|
7435
7705
|
export declare function computePermissionsIn(channel: AnyChannel | Snowflake, target: GuildMember | Role | Snowflake): Promise<PermissionsBitField>;
|
|
7436
7706
|
//#endregion
|
|
7437
|
-
export
|
|
7707
|
+
export type { GatewayEventMap, GatewayEventName, MessageReactionEventDetails, RawAPIType, StructureCreator };
|
|
7438
7708
|
//# sourceMappingURL=index.d.ts.map
|