@wolfstar/plugin-gateway 0.7.0 → 0.8.0-next-20260928170843
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/esm/index.d.ts +281 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +69 -2
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Client, Listener, container } from "@wolfstar/http-framework";
|
|
|
2
2
|
import { CloseCodes, DefaultWebSocketManagerOptions, WebSocketManager, WebSocketShardEvents, WebSocketShardStatus } from "@discordjs/ws";
|
|
3
3
|
import { Client as Client$1 } from "@discordjs/core";
|
|
4
4
|
import { applyGatewayDispatch, autoModerationRuleKey, banKey, createCache, emojiKey, integrationKey, inviteKey, isIterableCache, memberKey, mergeValues, messageKey, presenceKey, roleKey, scheduledEventKey, soundboardSoundKey, stageInstanceKey, stickerKey, threadMemberKey, voiceStateKey } from "@wolfstar/plugin-cache";
|
|
5
|
-
import { ActivityType, AuditLogEvent, ButtonStyle, ChannelType, ComponentType, FormattingPatterns, GatewayDispatchEvents, GatewayIntentBits, GatewayOpcodes, GuildFeature, GuildMemberFlags, GuildPremiumTier, GuildScheduledEventStatus, GuildSystemChannelFlags, GuildWidgetStyle, InviteType, MessageFlags, MessageReferenceType, MessageType, OverwriteType, PermissionFlagsBits, PresenceUpdateStatus, RoleFlags, RouteBases, Routes, SeparatorSpacingSize, StickerFormatType, UserFlags, WebhookType } from "discord-api-types/v10";
|
|
5
|
+
import { ActivityType, ApplicationFlags, AuditLogEvent, ButtonStyle, ChannelType, ComponentType, FormattingPatterns, GatewayDispatchEvents, GatewayIntentBits, GatewayOpcodes, GuildFeature, GuildMemberFlags, GuildPremiumTier, GuildScheduledEventStatus, GuildSystemChannelFlags, GuildWidgetStyle, InviteType, MessageFlags, MessageReferenceType, MessageType, OverwriteType, PermissionFlagsBits, PresenceUpdateStatus, RoleFlags, RouteBases, Routes, SeparatorSpacingSize, StickerFormatType, UserFlags, WebhookType } from "discord-api-types/v10";
|
|
6
6
|
import { ActionRowComponent, Activity as Activity$1, ActivityFlagsBitField as ActivityFlagsBitField$1, AnnouncementChannel as AnnouncementChannel$1, AnnouncementThreadChannel as AnnouncementThreadChannel$1, Attachment as Attachment$1, AttachmentFlagsBitField as AttachmentFlagsBitField$1, AutoModerationRule as AutoModerationRule$1, BitField, BitField as BitField$1, CategoryChannel as CategoryChannel$1, Channel as Channel$1, ChannelFlagsBitField as ChannelFlagsBitField$1, ChannelSelectMenuComponent as ChannelSelectMenuComponent$1, Component as Component$1, ContainerComponent as ContainerComponent$1, DMChannel as DMChannel$1, Embed as Embed$1, Emoji as Emoji$1, FileComponent as FileComponent$1, FileUploadComponent as FileUploadComponent$1, ForumChannel as ForumChannel$1, GroupDMChannel as GroupDMChannel$1, InteractiveButtonComponent as InteractiveButtonComponent$1, Invite, LinkButtonComponent as LinkButtonComponent$1, MediaChannel as MediaChannel$1, MediaGalleryComponent as MediaGalleryComponent$1, MediaGalleryItem as MediaGalleryItem$1, MentionableSelectMenuComponent as MentionableSelectMenuComponent$1, Message as Message$1, MessageFlagsBitField as MessageFlagsBitField$1, PermissionsBitField, Poll as Poll$1, PollAnswer as PollAnswer$1, PremiumButtonComponent as PremiumButtonComponent$1, Presence as Presence$1, PrivateThreadChannel as PrivateThreadChannel$1, PublicThreadChannel as PublicThreadChannel$1, Reaction, RoleSelectMenuComponent as RoleSelectMenuComponent$1, SectionComponent as SectionComponent$1, SeparatorComponent as SeparatorComponent$1, SoundboardSound as SoundboardSound$1, StageChannel as StageChannel$1, StageInstance as StageInstance$1, Sticker as Sticker$1, StickerPack as StickerPack$1, StringSelectMenuComponent as StringSelectMenuComponent$1, Structure as Structure$1, TextChannel as TextChannel$1, TextDisplayComponent as TextDisplayComponent$1, TextInputComponent as TextInputComponent$1, ThumbnailComponent as ThumbnailComponent$1, UnfurledMediaItem as UnfurledMediaItem$1, User as User$1, UserSelectMenuComponent as UserSelectMenuComponent$1, VoiceChannel as VoiceChannel$1, VoiceState as VoiceState$1, Webhook as Webhook$1 } from "@discordjs/structures";
|
|
7
7
|
import { readFile } from "node:fs/promises";
|
|
8
8
|
import { basename } from "node:path";
|
|
@@ -576,6 +576,12 @@ var SystemChannelFlagsBitField = class extends NumberFlagsBitField {
|
|
|
576
576
|
var UserFlagsBitField = class extends NumberFlagsBitField {
|
|
577
577
|
static Flags = UserFlags;
|
|
578
578
|
};
|
|
579
|
+
/**
|
|
580
|
+
* The flags of an application.
|
|
581
|
+
*/
|
|
582
|
+
var ApplicationFlagsBitField = class extends NumberFlagsBitField {
|
|
583
|
+
static Flags = ApplicationFlags;
|
|
584
|
+
};
|
|
579
585
|
|
|
580
586
|
//#endregion
|
|
581
587
|
//#region src/structures/channels/mixins/BaseChannelMixin.ts
|
|
@@ -14043,6 +14049,44 @@ function resolveCache(options) {
|
|
|
14043
14049
|
*/
|
|
14044
14050
|
const GatewayErrorCodes = Object.freeze(Object.fromEntries(Object.keys(GatewayErrorMessages).map((code) => [code, code])));
|
|
14045
14051
|
|
|
14052
|
+
//#endregion
|
|
14053
|
+
//#region src/util/Colors.ts
|
|
14054
|
+
/**
|
|
14055
|
+
* Named colors accepted by {@link resolveColor}.
|
|
14056
|
+
*/
|
|
14057
|
+
const Colors = {
|
|
14058
|
+
Aqua: 1752220,
|
|
14059
|
+
Blue: 3447003,
|
|
14060
|
+
Blurple: 5793266,
|
|
14061
|
+
DarkAqua: 1146986,
|
|
14062
|
+
DarkBlue: 2123412,
|
|
14063
|
+
DarkButNotBlack: 2895667,
|
|
14064
|
+
DarkerGrey: 8359053,
|
|
14065
|
+
DarkGold: 12745742,
|
|
14066
|
+
DarkGreen: 2067276,
|
|
14067
|
+
DarkGrey: 9936031,
|
|
14068
|
+
DarkNavy: 2899536,
|
|
14069
|
+
DarkOrange: 11027200,
|
|
14070
|
+
DarkPurple: 7419530,
|
|
14071
|
+
DarkRed: 10038562,
|
|
14072
|
+
DarkVividPink: 11342935,
|
|
14073
|
+
Default: 0,
|
|
14074
|
+
Fuchsia: 15418782,
|
|
14075
|
+
Gold: 15844367,
|
|
14076
|
+
Green: 5763719,
|
|
14077
|
+
Grey: 9807270,
|
|
14078
|
+
Greyple: 10070709,
|
|
14079
|
+
LightGrey: 12370112,
|
|
14080
|
+
LuminousVividPink: 15277667,
|
|
14081
|
+
Navy: 3426654,
|
|
14082
|
+
NotQuiteBlack: 2303786,
|
|
14083
|
+
Orange: 15105570,
|
|
14084
|
+
Purple: 10181046,
|
|
14085
|
+
Red: 15548997,
|
|
14086
|
+
White: 16777215,
|
|
14087
|
+
Yellow: 16705372
|
|
14088
|
+
};
|
|
14089
|
+
|
|
14046
14090
|
//#endregion
|
|
14047
14091
|
//#region src/util/decorators.ts
|
|
14048
14092
|
/**
|
|
@@ -14081,5 +14125,28 @@ function RegisterAsGatewayListener(event, options = {}) {
|
|
|
14081
14125
|
}
|
|
14082
14126
|
|
|
14083
14127
|
//#endregion
|
|
14084
|
-
|
|
14128
|
+
//#region src/util/Util.ts
|
|
14129
|
+
/**
|
|
14130
|
+
* Resolves a {@link ColorResolvable} to its number.
|
|
14131
|
+
*
|
|
14132
|
+
* @param color The color to resolve.
|
|
14133
|
+
* @throws A `TypeError` when the value is no color, a `RangeError` when it is outside `0x000000`-`0xffffff`.
|
|
14134
|
+
*/
|
|
14135
|
+
function resolveColor(color) {
|
|
14136
|
+
let resolved;
|
|
14137
|
+
if (typeof color === "string") {
|
|
14138
|
+
if (color === "Random") return Math.floor(Math.random() * 16777216);
|
|
14139
|
+
if (/^#?[\da-f]{6}$/i.test(color)) return Number.parseInt(color.replace("#", ""), 16);
|
|
14140
|
+
resolved = Colors[color] ?? NaN;
|
|
14141
|
+
} else if (Array.isArray(color)) {
|
|
14142
|
+
const [red, green, blue] = color;
|
|
14143
|
+
resolved = (red << 16) + (green << 8) + blue;
|
|
14144
|
+
} else resolved = color;
|
|
14145
|
+
if (!Number.isInteger(resolved)) throw new TypeError(`Cannot resolve ${String(color)} to a color`);
|
|
14146
|
+
if (resolved < 0 || resolved > 16777215) throw new RangeError("Colors must be within 0x000000-0xffffff");
|
|
14147
|
+
return resolved;
|
|
14148
|
+
}
|
|
14149
|
+
|
|
14150
|
+
//#endregion
|
|
14151
|
+
export { Action, ActionRow, ActionsManager, Activity, ActivityFlagsBitField, AnnouncementChannel, AnnouncementThreadChannel, AnonymousGuild, ApplicationFlagsBitField, AppliedTagsMixin, Attachment, AttachmentFlagsBitField, AutoModerationActionExecution, AutoModerationRule, AutoModerationRuleManager, BaseChannel, BaseChannelMixin, BaseInvite, CachedManager as BaseManager, CachedManager, BitField, CategoryChannel, Channel, ChannelFlagsBitField, ChannelManager, ChannelMessageManager, ChannelOwnerMixin, ChannelParentMixin, ChannelPermissionMixin, ChannelSelectMenuComponent, ChannelSlowmodeMixin, ChannelThreadManager, ChannelThreadsMixin, ChannelTopicMixin, ChannelWebhooksMixin, CheckboxComponent, CheckboxGroupComponent, ClientUser, Colors, Component, ComponentMixin, ContainerComponent, DMChannel, DMChannelMixin, DispatchAction, DispatchHandlers, DispatchQueue, DispatchTimeoutError, Embed, Emoji, EventGatewayListener, FileComponent, FileUploadComponent, ForumChannel, GatewayClient, GatewayError, GatewayErrorCodes, GatewayErrorMessages, GatewayEvents, GatewayRangeError, GatewaySessionStoreError, GatewayTypeError, GroupDMChannel, GroupDMInvite, GroupDMMixin, Guild, GuildAuditLogsEntry, GuildBan, GuildBanManager, GuildChannelFields, GuildChannelManager, GuildChannelMixin, GuildEmoji, GuildEmojiManager, GuildEmojiRoleManager, GuildIntegrationManager, GuildInvite, GuildInviteManager, GuildManager, GuildMember, GuildMemberFlagsBitField, GuildMemberManager, GuildMemberRoleManager, GuildMembersRateLimitError, GuildMembersTimeoutError, GuildOnboarding, GuildOnboardingPrompt, GuildOnboardingPromptOption, GuildPreview, GuildScheduledEvent, GuildScheduledEventManager, GuildSoundboardSoundManager, GuildStickerManager, GuildTemplate, GuildTemplateManager, Integration, IntentsBitField, InteractiveButtonComponent, InviteGuild, LabelComponent, LinkButtonComponent, MediaChannel, MediaGalleryComponent, MediaGalleryItem, MentionableSelectMenuComponent, Message, MessageFlagsBitField, MessageManager, MessageMentions, MessagePayload, MessageReaction, Mixin, MultiDispatchAction, MultiDispatchHandlers, NumberFlagsBitField, Partials, PermissionOverwriteManager, PermissionOverwrites, PermissionsBitField, Poll, PollAnswer, PremiumButtonComponent, Presence, PresenceManager, PrivateThreadChannel, PublicThreadChannel, RadioGroupComponent, ReactionEmoji, ReactionManager, ReactionUserManager, RegisterAsGatewayListener, RichPresenceAssets, Role, RoleFlagsBitField, RoleManager, RoleSelectMenuComponent, SectionComponent, SeparatorComponent, SoundboardSound, StageChannel, StageInstance, StageInstanceManager, Sticker, StickerPack, StringSelectMenuComponent, Structure, StructureMixin, SystemChannelFlagsBitField, TextChannel, TextChannelMixin, TextDisplayComponent, TextInputComponent, ThreadChannelMemberManager, ThreadChannelMixin, ThreadManager, ThreadMember, ThreadMemberManager, ThreadOnlyChannelMixin, ThumbnailComponent, Typing, UnfurledMediaItem, User, UserFlagsBitField, UserManager, UserSelectMenuComponent, VoiceChannel, VoiceChannelMixin, VoiceState, VoiceStateManager, Webhook, WebhookManager, WebhookMixin, WelcomeScreen, Widget, WidgetMember, bindClient, compareRolePositions, computeChannelPermissions, computeGuildPermissions, computePermissionsIn, computeTargetPermissions, createChannel, createComponent, createInvite, dispatchPartition, findComponentByCustomId, getGatewayClient, initStructure, isDeepEqual, isThreadChannelType, kClient, kClone, kData, kPatch, kPatchRelations, kRelations, resolveColor, resolveId, resolveOverwriteOptions, snowflakeTimestamp, toAPIOverwrite, toChannelBody };
|
|
14085
14152
|
//# sourceMappingURL=index.js.map
|