seyfert 5.2.1 → 5.2.2-dev-39915665713.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/lib/api/utils/constants.d.ts +5 -5
- package/lib/builders/Attachment.js +1 -1
- package/lib/builders/MediaGallery.d.ts +1 -3
- package/lib/client/plugins/errors.d.ts +2 -2
- package/lib/client/plugins.d.ts +14 -5
- package/lib/client/transformers.d.ts +40 -40
- package/lib/commands/applications/chat.d.ts +29 -29
- package/lib/commands/applications/entryPoint.d.ts +2 -2
- package/lib/commands/applications/menu.d.ts +2 -2
- package/lib/commands/applications/options.d.ts +12 -12
- package/lib/commands/handle.d.ts +3 -3
- package/lib/commands/handler.d.ts +4 -4
- package/lib/common/it/formatter.d.ts +1 -1
- package/lib/common/shorters/invites.d.ts +620 -620
- package/lib/components/modalcontext.d.ts +18 -18
- package/lib/events/hooks/application_command.d.ts +2 -2
- package/lib/events/hooks/auto_moderation.d.ts +9 -9
- package/lib/events/hooks/channel.d.ts +2 -2
- package/lib/events/hooks/custom.d.ts +2 -2
- package/lib/events/hooks/dispatch.d.ts +1 -1
- package/lib/events/hooks/guild.d.ts +57 -57
- package/lib/events/hooks/integration.d.ts +6 -6
- package/lib/events/hooks/interactions.d.ts +1 -1
- package/lib/events/hooks/invite.d.ts +57 -57
- package/lib/events/hooks/message.d.ts +117 -117
- package/lib/events/hooks/presence.d.ts +61 -61
- package/lib/events/hooks/soundboard.d.ts +25 -25
- package/lib/events/hooks/thread.d.ts +141 -141
- package/lib/events/hooks/typing.d.ts +2 -2
- package/lib/events/hooks/voice.d.ts +14 -14
- package/lib/events/hooks/webhook.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/structures/Emoji.d.ts +1 -1
- package/lib/structures/Guild.d.ts +363 -363
- package/lib/structures/GuildBan.d.ts +2 -2
- package/lib/structures/Interaction.d.ts +20 -20
- package/lib/structures/Message.d.ts +9 -9
- package/lib/structures/StageInstance.d.ts +1 -1
- package/lib/structures/channels.d.ts +375 -375
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const DefaultUserAgent:
|
|
2
|
-
export declare const ALLOWED_EXTENSIONS: readonly [
|
|
3
|
-
export declare const ALLOWED_STICKER_EXTENSIONS: readonly [
|
|
1
|
+
export declare const DefaultUserAgent: 'DiscordBot (https://seyfert.dev, v5.2.1)';
|
|
2
|
+
export declare const ALLOWED_EXTENSIONS: readonly ['webp', 'png', 'jpg', 'jpeg', 'gif'];
|
|
3
|
+
export declare const ALLOWED_STICKER_EXTENSIONS: readonly ['png', 'json', 'gif'];
|
|
4
4
|
export declare const ALLOWED_SIZES: readonly [16, 32, 64, 100, 128, 256, 512, 1024, 2048, 4096];
|
|
5
|
-
export declare const ALLOWED_SOUNDS_EXTENSIONS: readonly [
|
|
6
|
-
export declare const ALLOWED_TAG_BADGE_EXTENSIONS: readonly [
|
|
5
|
+
export declare const ALLOWED_SOUNDS_EXTENSIONS: readonly ['mp3', 'ogg'];
|
|
6
|
+
export declare const ALLOWED_TAG_BADGE_EXTENSIONS: readonly ['png', 'jpeg', 'webp'];
|
|
7
7
|
export type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
|
|
8
8
|
export type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
|
|
9
9
|
export type ImageSize = (typeof ALLOWED_SIZES)[number];
|
|
@@ -40,7 +40,7 @@ class AttachmentBuilder {
|
|
|
40
40
|
* @param data - The partial attachment data.
|
|
41
41
|
*/
|
|
42
42
|
constructor(data = {
|
|
43
|
-
filename: `${(
|
|
43
|
+
filename: `${(0, node_crypto_1.randomBytes)?.(8)?.toString('base64url') || 'default'}.jpg`,
|
|
44
44
|
}) {
|
|
45
45
|
this.data = data;
|
|
46
46
|
}
|
|
@@ -73,8 +73,6 @@ export declare class MediaGalleryItem {
|
|
|
73
73
|
* @returns The JSON representation of the item data.
|
|
74
74
|
*/
|
|
75
75
|
toJSON(): {
|
|
76
|
-
|
|
77
|
-
description?: string | undefined;
|
|
78
|
-
spoiler?: boolean | undefined;
|
|
76
|
+
[K in keyof APIMediaGalleryItems]?: APIMediaGalleryItems[K] | undefined;
|
|
79
77
|
};
|
|
80
78
|
}
|
|
@@ -21,5 +21,5 @@ export declare class SeyfertPluginAggregateError extends SeyfertError {
|
|
|
21
21
|
errors: unknown[];
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
export declare function wrapPluginError(plugin: string, phase: string, index: number, cause: unknown, code?: SeyfertPluginErrorCode, instanceId?: string):
|
|
25
|
-
export declare function createPluginConflictError(plugin: string, phase: string, index: number, detail: string, instanceId?: string):
|
|
24
|
+
export declare function wrapPluginError(plugin: string, phase: string, index: number, cause: unknown, code?: SeyfertPluginErrorCode, instanceId?: string): SeyfertPluginAggregateError | SeyfertPluginError;
|
|
25
|
+
export declare function createPluginConflictError(plugin: string, phase: string, index: number, detail: string, instanceId?: string): SeyfertPluginAggregateError | SeyfertPluginError;
|
package/lib/client/plugins.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export { createSharedKey } from './plugins/shared';
|
|
|
9
9
|
export { PluginOrder } from './plugins/types';
|
|
10
10
|
import type { AnySeyfertPlugin, ExtendOf, PluginAutocompleteNext, PluginAutocompletePayload, PluginClientMap, PluginCommandObserver, PluginContextMap, PluginGatewaySendPayload, PluginHookName, PluginHookPayload, PluginMiddlewareMap, PluginRequirementInput, ResolvedPluginList, SeyfertPlugin, SeyfertPluginApi, SeyfertPluginClient, SeyfertPluginOptions, SeyfertPluginTeardownApi } from './plugins/types';
|
|
11
11
|
export type { AnySeyfertPlugin, ContextOf, ExtendOf, HandleableComponent, HandleableModal, MiddlewaresOf, PluginAutocompleteNext, PluginAutocompletePayload, PluginAutocompleteWrapper, PluginCacheResourceConstructor, PluginCacheResourceOptions, PluginClientMap, PluginCommandContributionOptions, PluginCommandLoadable, PluginCommandObserver, PluginCommandObserverCommand, PluginCommandObserverContext, PluginContextInteraction, PluginContextMap, PluginContextMapOf, PluginContextOf, PluginContributionOptions, PluginDiagnosticCode, PluginDiagnosticMessage, PluginDiagnosticSeverity, PluginDiagnostics, PluginDisposer, PluginEventErrorHandler, PluginExtensionOf, PluginGatewayDispatchInterceptor, PluginGatewayDispatchMeta, PluginGatewayDispatchNext, PluginGatewaySendPayload, PluginGatewaySendPayloadWrapper, PluginHandlerConstructor, PluginHandlerCreator, PluginHandlerInstance, PluginHandlerKind, PluginHandlerMetadata, PluginHandlerOptions, PluginHandlerTransformer, PluginHookHandler, PluginHookName, PluginHookPayload, PluginHookPayloadFor, PluginIntentResolvable, PluginLangOptions, PluginLifecyclePhase, PluginLifecycleStatus, PluginLoadedMetadata, PluginMiddlewareDenialMetadata, PluginMiddlewareMap, PluginMiddlewareOptions, PluginMiddlewaresMapOf, PluginMiddlewaresOf, PluginOrderOpt, PluginRequirement, PluginRequirementDiagnostic, PluginRequirementInput, PluginRestFailPayload, PluginRestObserver, PluginRestRatelimitPayload, PluginRestRequestPayload, PluginRestSuccessPayload, PluginSharedOptions, PluginSharedRegistry, PluginUploadCommandsMetadata, PluginUsingClient, RegisteredPluginContext, RegisteredPluginExtension, RegisteredPluginMiddlewares, RegisteredPluginShared, RegisteredPlugins, ResolvedPluginList, SemverRange, SeyfertCommandDefaults, SeyfertComponentDefaults, SeyfertModalDefaults, SeyfertPlugin, SeyfertPluginApi, SeyfertPluginClient, SeyfertPluginHooks, SeyfertPluginOptions, SeyfertPluginTeardownApi, SeyfertRegistry, SharedKey, SharedValue, } from './plugins/types';
|
|
12
|
+
type InferredPluginExtension<E extends object> = {
|
|
13
|
+
[K in keyof E]: E[K];
|
|
14
|
+
};
|
|
12
15
|
type CreatePluginInputBase<Name extends string, I extends readonly AnySeyfertPlugin[], E extends object, C extends object, M extends PluginMiddlewareMap> = {
|
|
13
16
|
readonly name: Name;
|
|
14
17
|
readonly instanceId?: string;
|
|
@@ -19,12 +22,18 @@ type CreatePluginInputBase<Name extends string, I extends readonly AnySeyfertPlu
|
|
|
19
22
|
readonly middlewares?: M;
|
|
20
23
|
readonly globalMiddlewares?: readonly (keyof M & string)[];
|
|
21
24
|
options?(current: Readonly<BaseClientOptions>): SeyfertPluginOptions;
|
|
22
|
-
register?(api: SeyfertPluginApi<M, ExtendOf<I> & E
|
|
23
|
-
setup?(client: SeyfertPluginClient & ExtendOf<I> & E
|
|
24
|
-
teardown?(client: SeyfertPluginClient & ExtendOf<I> & E
|
|
25
|
+
register?(api: SeyfertPluginApi<M, ExtendOf<I> & InferredPluginExtension<E>>): void;
|
|
26
|
+
setup?(client: SeyfertPluginClient & ExtendOf<I> & InferredPluginExtension<E>, api?: SeyfertPluginApi<M, ExtendOf<I> & InferredPluginExtension<E>>): Awaitable<void>;
|
|
27
|
+
teardown?(client: SeyfertPluginClient & ExtendOf<I> & InferredPluginExtension<E>, api?: SeyfertPluginTeardownApi): Awaitable<void>;
|
|
25
28
|
};
|
|
26
29
|
type CreatePluginReservedKey = keyof CreatePluginInputBase<string, readonly AnySeyfertPlugin[], object, object, PluginMiddlewareMap> | 'meta';
|
|
27
30
|
type CreatePluginExtra<T extends object> = Omit<T, CreatePluginReservedKey>;
|
|
31
|
+
type RequiredPluginLifecycleParameters<T extends readonly unknown[]> = {
|
|
32
|
+
[K in keyof T]-?: Exclude<T[K], undefined>;
|
|
33
|
+
};
|
|
34
|
+
type CreatePluginLifecycleCheck<I extends readonly AnySeyfertPlugin[], E extends object, M extends PluginMiddlewareMap> = {
|
|
35
|
+
readonly [K in 'register' | 'setup' | 'teardown']?: (...args: RequiredPluginLifecycleParameters<Parameters<NonNullable<CreatePluginInputBase<string, I, E, {}, M>[K]>>>) => ReturnType<NonNullable<CreatePluginInputBase<string, I, E, {}, M>[K]>>;
|
|
36
|
+
};
|
|
28
37
|
type CreatePluginInputWithMeta<Name extends string, I extends readonly AnySeyfertPlugin[], E extends object, C extends object, M extends PluginMiddlewareMap, Meta> = CreatePluginInputBase<Name, I, E, C, M> & {
|
|
29
38
|
readonly meta: Meta;
|
|
30
39
|
};
|
|
@@ -49,8 +58,8 @@ export interface ResolvedClientPlugins {
|
|
|
49
58
|
options: BaseClientOptions;
|
|
50
59
|
registry: PluginRuntimeRegistry;
|
|
51
60
|
}
|
|
52
|
-
export declare function createPlugin<const Name extends string, const I extends readonly AnySeyfertPlugin[] = readonly [], E extends object = {}, C extends object = {}, M extends PluginMiddlewareMap = {}, const Meta = never, const Extra extends object = {}>(plugin: CreatePluginInputWithMeta<Name, I, E, C, M, Meta> & Extra): CreatePluginOutputWithMeta<Name, I, E, C, M, Meta> & CreatePluginExtra<Extra>;
|
|
53
|
-
export declare function createPlugin<const Name extends string, const I extends readonly AnySeyfertPlugin[] = readonly [], E extends object = {}, C extends object = {}, M extends PluginMiddlewareMap = {}, const Extra extends object = {}>(plugin: CreatePluginInputWithoutMeta<Name, I, E, C, M> & Extra): CreatePluginOutputBase<Name, I, E, C, M> & CreatePluginExtra<Extra>;
|
|
61
|
+
export declare function createPlugin<const Name extends string, const I extends readonly AnySeyfertPlugin[] = readonly [], E extends object = {}, C extends object = {}, M extends PluginMiddlewareMap = {}, const Meta = never, const Extra extends object = {}>(plugin: CreatePluginInputWithMeta<Name, I, E, C, M, Meta> & Extra & CreatePluginLifecycleCheck<I, NoInfer<E>, M>): CreatePluginOutputWithMeta<Name, I, E, C, M, Meta> & CreatePluginExtra<Extra>;
|
|
62
|
+
export declare function createPlugin<const Name extends string, const I extends readonly AnySeyfertPlugin[] = readonly [], E extends object = {}, C extends object = {}, M extends PluginMiddlewareMap = {}, const Extra extends object = {}>(plugin: CreatePluginInputWithoutMeta<Name, I, E, C, M> & Extra & CreatePluginLifecycleCheck<I, NoInfer<E>, M>): CreatePluginOutputBase<Name, I, E, C, M> & CreatePluginExtra<Extra>;
|
|
54
63
|
export declare function createPluginFactory<O extends object, P extends AnySeyfertPlugin>(setup: {
|
|
55
64
|
defaults: O;
|
|
56
65
|
validate?: (options: O) => void;
|
|
@@ -55,47 +55,47 @@ export type EntitlementStructure = InferCustomStructure<Entitlement, 'Entitlemen
|
|
|
55
55
|
export type SKUStructure = InferCustomStructure<SKU, 'SKU'>;
|
|
56
56
|
export type SubscriptionStructure = InferCustomStructure<Subscription, 'Subscription'>;
|
|
57
57
|
export declare const Transformers: {
|
|
58
|
-
Application(
|
|
59
|
-
ApplicationEmoji(
|
|
60
|
-
AnonymousGuild(
|
|
61
|
-
AutoModerationRule(
|
|
62
|
-
BaseChannel(
|
|
63
|
-
BaseGuildChannel(
|
|
64
|
-
TextGuildChannel(
|
|
65
|
-
DMChannel(
|
|
66
|
-
VoiceChannel(
|
|
67
|
-
StageChannel(
|
|
68
|
-
MediaChannel(
|
|
69
|
-
ForumChannel(
|
|
70
|
-
ThreadChannel(
|
|
58
|
+
Application(...args: ConstructorParameters<typeof Application>): ApplicationStructure;
|
|
59
|
+
ApplicationEmoji(...args: ConstructorParameters<typeof ApplicationEmoji>): ApplicationEmojiStructure;
|
|
60
|
+
AnonymousGuild(...args: ConstructorParameters<typeof AnonymousGuild>): AnonymousGuildStructure;
|
|
61
|
+
AutoModerationRule(...args: ConstructorParameters<typeof AutoModerationRule>): AutoModerationRuleStructure;
|
|
62
|
+
BaseChannel(...args: ConstructorParameters<typeof BaseChannel>): BaseChannelStructure;
|
|
63
|
+
BaseGuildChannel(...args: ConstructorParameters<typeof BaseGuildChannel>): BaseGuildChannelStructure;
|
|
64
|
+
TextGuildChannel(...args: ConstructorParameters<typeof TextGuildChannel>): TextGuildChannelStructure;
|
|
65
|
+
DMChannel(...args: ConstructorParameters<typeof DMChannel>): DMChannelStructure;
|
|
66
|
+
VoiceChannel(...args: ConstructorParameters<typeof VoiceChannel>): VoiceChannelStructure;
|
|
67
|
+
StageChannel(...args: ConstructorParameters<typeof StageChannel>): StageChannelStructure;
|
|
68
|
+
MediaChannel(...args: ConstructorParameters<typeof MediaChannel>): MediaChannelStructure;
|
|
69
|
+
ForumChannel(...args: ConstructorParameters<typeof ForumChannel>): ForumChannelStructure;
|
|
70
|
+
ThreadChannel(...args: ConstructorParameters<typeof ThreadChannel>): ThreadChannelStructure;
|
|
71
71
|
CategoryChannel(...args: ConstructorParameters<typeof CategoryChannel>): CategoryChannelStructure;
|
|
72
|
-
NewsChannel(
|
|
73
|
-
DirectoryChannel(
|
|
74
|
-
ClientUser(
|
|
75
|
-
Guild<State extends StructStates =
|
|
76
|
-
GuildBan(
|
|
77
|
-
Emoji(
|
|
78
|
-
GuildEmoji(
|
|
79
|
-
GuildMember(
|
|
80
|
-
InteractionGuildMember(
|
|
81
|
-
GuildRole(
|
|
82
|
-
GuildScheduledEvent(
|
|
83
|
-
GuildScheduledSubscriber(
|
|
84
|
-
StageInstance(
|
|
85
|
-
GuildTemplate(
|
|
86
|
-
GuildOnboarding(
|
|
87
|
-
GuildWelcomeScreen(
|
|
88
|
-
Message(
|
|
89
|
-
WebhookMessage(
|
|
90
|
-
Poll(
|
|
91
|
-
Sticker(
|
|
92
|
-
User(
|
|
93
|
-
VoiceState(
|
|
94
|
-
Webhook(
|
|
95
|
-
OptionResolver(
|
|
96
|
-
Entitlement(
|
|
97
|
-
SKU(
|
|
98
|
-
Subscription(
|
|
72
|
+
NewsChannel(...args: ConstructorParameters<typeof NewsChannel>): NewsChannelStructure;
|
|
73
|
+
DirectoryChannel(...args: ConstructorParameters<typeof DirectoryChannel>): DirectoryChannelStructure;
|
|
74
|
+
ClientUser(...args: ConstructorParameters<typeof ClientUser>): ClientUserStructure;
|
|
75
|
+
Guild<State extends StructStates = 'api'>(...args: ConstructorParameters<typeof Guild>): GuildStructure<State>;
|
|
76
|
+
GuildBan(...args: ConstructorParameters<typeof GuildBan>): GuildBanStructure;
|
|
77
|
+
Emoji(...args: ConstructorParameters<typeof Emoji>): EmojiStructure;
|
|
78
|
+
GuildEmoji(...args: ConstructorParameters<typeof GuildEmoji>): GuildEmojiStructure;
|
|
79
|
+
GuildMember(...args: ConstructorParameters<typeof GuildMember>): GuildMemberStructure;
|
|
80
|
+
InteractionGuildMember(...args: ConstructorParameters<typeof InteractionGuildMember>): InteractionGuildMemberStructure;
|
|
81
|
+
GuildRole(...args: ConstructorParameters<typeof GuildRole>): GuildRoleStructure;
|
|
82
|
+
GuildScheduledEvent(...args: ConstructorParameters<typeof GuildScheduledEvent>): GuildScheduledEventStructure;
|
|
83
|
+
GuildScheduledSubscriber(...args: ConstructorParameters<typeof GuildScheduledSubscriber>): GuildScheduledSubscriberStructure;
|
|
84
|
+
StageInstance(...args: ConstructorParameters<typeof StageInstance>): StageInstanceStructure;
|
|
85
|
+
GuildTemplate(...args: ConstructorParameters<typeof GuildTemplate>): GuildTemplateStructure;
|
|
86
|
+
GuildOnboarding(...args: ConstructorParameters<typeof GuildOnboarding>): GuildOnboardingStructure;
|
|
87
|
+
GuildWelcomeScreen(...args: ConstructorParameters<typeof GuildWelcomeScreen>): GuildWelcomeScreenStructure;
|
|
88
|
+
Message(...args: ConstructorParameters<typeof Message>): MessageStructure;
|
|
89
|
+
WebhookMessage(...args: ConstructorParameters<typeof WebhookMessage>): WebhookMessageStructure;
|
|
90
|
+
Poll(...args: ConstructorParameters<typeof Poll>): PollStructure;
|
|
91
|
+
Sticker(...args: ConstructorParameters<typeof Sticker>): StickerStructure;
|
|
92
|
+
User(...args: ConstructorParameters<typeof User>): UserStructure;
|
|
93
|
+
VoiceState(...args: ConstructorParameters<typeof VoiceState>): VoiceStateStructure;
|
|
94
|
+
Webhook(...args: ConstructorParameters<typeof Webhook>): WebhookStructure;
|
|
95
|
+
OptionResolver(...args: ConstructorParameters<typeof OptionResolver>): OptionResolverStructure;
|
|
96
|
+
Entitlement(...args: ConstructorParameters<typeof Entitlement>): EntitlementStructure;
|
|
97
|
+
SKU(...args: ConstructorParameters<typeof SKU>): SKUStructure;
|
|
98
|
+
Subscription(...args: ConstructorParameters<typeof Subscription>): SubscriptionStructure;
|
|
99
99
|
};
|
|
100
100
|
export type InferCustomStructure<T, N extends string> = CustomStructures extends Record<N, infer P> ? P : T;
|
|
101
101
|
export {};
|
|
@@ -81,16 +81,16 @@ export declare class BaseCommand {
|
|
|
81
81
|
props: ExtraProps;
|
|
82
82
|
private static __getMiddlewareOwnerName;
|
|
83
83
|
toJSON(): {
|
|
84
|
-
name: BaseCommand[
|
|
85
|
-
type: BaseCommand[
|
|
86
|
-
nsfw: BaseCommand[
|
|
87
|
-
description: BaseCommand[
|
|
88
|
-
name_localizations: BaseCommand[
|
|
89
|
-
description_localizations: BaseCommand[
|
|
90
|
-
guild_id: BaseCommand[
|
|
84
|
+
name: BaseCommand['name'];
|
|
85
|
+
type: BaseCommand['type'];
|
|
86
|
+
nsfw: BaseCommand['nsfw'];
|
|
87
|
+
description: BaseCommand['description'];
|
|
88
|
+
name_localizations: BaseCommand['name_localizations'];
|
|
89
|
+
description_localizations: BaseCommand['description_localizations'];
|
|
90
|
+
guild_id: BaseCommand['guildId'];
|
|
91
91
|
default_member_permissions: string;
|
|
92
|
-
contexts: BaseCommand[
|
|
93
|
-
integration_types: BaseCommand[
|
|
92
|
+
contexts: BaseCommand['contexts'];
|
|
93
|
+
integration_types: BaseCommand['integrationTypes'];
|
|
94
94
|
};
|
|
95
95
|
reload(): Promise<void>;
|
|
96
96
|
onBeforeMiddlewares?(context: CommandContext): any;
|
|
@@ -114,17 +114,17 @@ export declare class Command extends BaseCommand {
|
|
|
114
114
|
defaultDescription: string;
|
|
115
115
|
}>;
|
|
116
116
|
toJSON(): {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
guild_id: BaseCommand["guildId"];
|
|
117
|
+
name: BaseCommand['name'];
|
|
118
|
+
type: BaseCommand['type'];
|
|
119
|
+
nsfw: BaseCommand['nsfw'];
|
|
120
|
+
description: BaseCommand['description'];
|
|
121
|
+
name_localizations: BaseCommand['name_localizations'];
|
|
122
|
+
description_localizations: BaseCommand['description_localizations'];
|
|
123
|
+
guild_id: BaseCommand['guildId'];
|
|
125
124
|
default_member_permissions: string;
|
|
126
|
-
contexts: BaseCommand[
|
|
127
|
-
integration_types: BaseCommand[
|
|
125
|
+
contexts: BaseCommand['contexts'];
|
|
126
|
+
integration_types: BaseCommand['integrationTypes'];
|
|
127
|
+
options: APIApplicationCommandOption[];
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
export declare abstract class SubCommand extends BaseCommand {
|
|
@@ -132,17 +132,17 @@ export declare abstract class SubCommand extends BaseCommand {
|
|
|
132
132
|
group?: string;
|
|
133
133
|
options?: CommandOptionWithType[];
|
|
134
134
|
toJSON(): {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
guild_id: BaseCommand["guildId"];
|
|
135
|
+
name: BaseCommand['name'];
|
|
136
|
+
type: BaseCommand['type'];
|
|
137
|
+
nsfw: BaseCommand['nsfw'];
|
|
138
|
+
description: BaseCommand['description'];
|
|
139
|
+
name_localizations: BaseCommand['name_localizations'];
|
|
140
|
+
description_localizations: BaseCommand['description_localizations'];
|
|
141
|
+
guild_id: BaseCommand['guildId'];
|
|
143
142
|
default_member_permissions: string;
|
|
144
|
-
contexts: BaseCommand[
|
|
145
|
-
integration_types: BaseCommand[
|
|
143
|
+
contexts: BaseCommand['contexts'];
|
|
144
|
+
integration_types: BaseCommand['integrationTypes'];
|
|
145
|
+
options: APIApplicationCommandBasicOption[];
|
|
146
146
|
};
|
|
147
147
|
abstract run(context: CommandContext): any;
|
|
148
148
|
}
|
|
@@ -31,8 +31,8 @@ export declare abstract class EntryPointCommand {
|
|
|
31
31
|
default_member_permissions: null;
|
|
32
32
|
guild_id: null;
|
|
33
33
|
description: string;
|
|
34
|
-
name_localizations: Partial<Record<"
|
|
35
|
-
description_localizations: Partial<Record<"
|
|
34
|
+
name_localizations: Partial<Record<"bg" | "cs" | "da" | "de" | "el" | "en-GB" | "en-US" | "es-419" | "es-ES" | "fi" | "fr" | "hi" | "hr" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "nl" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "sv-SE" | "th" | "tr" | "uk" | "vi" | "zh-CN" | "zh-TW", string>> | undefined;
|
|
35
|
+
description_localizations: Partial<Record<"bg" | "cs" | "da" | "de" | "el" | "en-GB" | "en-US" | "es-419" | "es-ES" | "fi" | "fr" | "hi" | "hr" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "nl" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "sv-SE" | "th" | "tr" | "uk" | "vi" | "zh-CN" | "zh-TW", string>> | undefined;
|
|
36
36
|
dm_permission: boolean | undefined;
|
|
37
37
|
contexts: InteractionContextType[];
|
|
38
38
|
integration_types: ApplicationIntegrationType[];
|
|
@@ -29,8 +29,8 @@ export declare abstract class ContextMenuCommand {
|
|
|
29
29
|
type: ApplicationCommandType.User | ApplicationCommandType.Message;
|
|
30
30
|
nsfw: boolean | undefined;
|
|
31
31
|
description: string;
|
|
32
|
-
name_localizations: Partial<Record<"
|
|
33
|
-
description_localizations: Partial<Record<"
|
|
32
|
+
name_localizations: Partial<Record<"bg" | "cs" | "da" | "de" | "el" | "en-GB" | "en-US" | "es-419" | "es-ES" | "fi" | "fr" | "hi" | "hr" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "nl" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "sv-SE" | "th" | "tr" | "uk" | "vi" | "zh-CN" | "zh-TW", string>> | undefined;
|
|
33
|
+
description_localizations: Partial<Record<"bg" | "cs" | "da" | "de" | "el" | "en-GB" | "en-US" | "es-419" | "es-ES" | "fi" | "fr" | "hi" | "hr" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "nl" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "sv-SE" | "th" | "tr" | "uk" | "vi" | "zh-CN" | "zh-TW", string>> | undefined;
|
|
34
34
|
guild_id: string[] | undefined;
|
|
35
35
|
dm_permission: boolean | undefined;
|
|
36
36
|
default_member_permissions: string | undefined;
|
|
@@ -89,13 +89,12 @@ export type SeyfertAttachmentOption<R = boolean> = SeyfertBasicOption<Applicatio
|
|
|
89
89
|
file_types?: readonly FileUploadType[];
|
|
90
90
|
};
|
|
91
91
|
export declare function createStringOption<R extends boolean, C extends readonly SeyfertChoice<string>[] = readonly SeyfertChoice<string>[], VC = never>(data: SeyfertStringOption<C, R, VC>): {
|
|
92
|
-
readonly type: ApplicationCommandOptionType.String;
|
|
93
92
|
readonly required?: R | undefined;
|
|
94
93
|
readonly choices?: C | undefined;
|
|
95
94
|
readonly value?: ValueCallback<ApplicationCommandOptionType.String, C, VC> | undefined;
|
|
96
95
|
readonly description: string;
|
|
97
|
-
readonly description_localizations?: APIApplicationCommandBasicOption[
|
|
98
|
-
readonly name_localizations?: APIApplicationCommandBasicOption[
|
|
96
|
+
readonly description_localizations?: APIApplicationCommandBasicOption['description_localizations'];
|
|
97
|
+
readonly name_localizations?: APIApplicationCommandBasicOption['name_localizations'];
|
|
99
98
|
readonly locales?: {
|
|
100
99
|
name?: FlatObjectKeys<DefaultLocale>;
|
|
101
100
|
description?: FlatObjectKeys<DefaultLocale>;
|
|
@@ -104,15 +103,15 @@ export declare function createStringOption<R extends boolean, C extends readonly
|
|
|
104
103
|
readonly onAutocompleteError?: OnAutocompleteErrorCallback<string>;
|
|
105
104
|
readonly min_length?: number;
|
|
106
105
|
readonly max_length?: number;
|
|
106
|
+
readonly type: ApplicationCommandOptionType.String;
|
|
107
107
|
};
|
|
108
108
|
export declare function createIntegerOption<R extends boolean, C extends readonly SeyfertChoice<number>[] = readonly SeyfertChoice<number>[], VC = never>(data: SeyfertIntegerOption<C, R, VC>): {
|
|
109
|
-
readonly type: ApplicationCommandOptionType.Integer;
|
|
110
109
|
readonly required?: R | undefined;
|
|
111
110
|
readonly choices?: C | undefined;
|
|
112
111
|
readonly value?: ValueCallback<ApplicationCommandOptionType.Integer, C, VC> | undefined;
|
|
113
112
|
readonly description: string;
|
|
114
|
-
readonly description_localizations?: APIApplicationCommandBasicOption[
|
|
115
|
-
readonly name_localizations?: APIApplicationCommandBasicOption[
|
|
113
|
+
readonly description_localizations?: APIApplicationCommandBasicOption['description_localizations'];
|
|
114
|
+
readonly name_localizations?: APIApplicationCommandBasicOption['name_localizations'];
|
|
116
115
|
readonly locales?: {
|
|
117
116
|
name?: FlatObjectKeys<DefaultLocale>;
|
|
118
117
|
description?: FlatObjectKeys<DefaultLocale>;
|
|
@@ -121,15 +120,15 @@ export declare function createIntegerOption<R extends boolean, C extends readonl
|
|
|
121
120
|
readonly onAutocompleteError?: OnAutocompleteErrorCallback<number>;
|
|
122
121
|
readonly min_value?: number;
|
|
123
122
|
readonly max_value?: number;
|
|
123
|
+
readonly type: ApplicationCommandOptionType.Integer;
|
|
124
124
|
};
|
|
125
125
|
export declare function createNumberOption<R extends boolean, C extends readonly SeyfertChoice<number>[] = readonly SeyfertChoice<number>[], VC = never>(data: SeyfertNumberOption<C, R, VC>): {
|
|
126
|
-
readonly type: ApplicationCommandOptionType.Number;
|
|
127
126
|
readonly required?: R | undefined;
|
|
128
127
|
readonly choices?: C | undefined;
|
|
129
128
|
readonly value?: ValueCallback<ApplicationCommandOptionType.Number, C, VC> | undefined;
|
|
130
129
|
readonly description: string;
|
|
131
|
-
readonly description_localizations?: APIApplicationCommandBasicOption[
|
|
132
|
-
readonly name_localizations?: APIApplicationCommandBasicOption[
|
|
130
|
+
readonly description_localizations?: APIApplicationCommandBasicOption['description_localizations'];
|
|
131
|
+
readonly name_localizations?: APIApplicationCommandBasicOption['name_localizations'];
|
|
133
132
|
readonly locales?: {
|
|
134
133
|
name?: FlatObjectKeys<DefaultLocale>;
|
|
135
134
|
description?: FlatObjectKeys<DefaultLocale>;
|
|
@@ -138,19 +137,20 @@ export declare function createNumberOption<R extends boolean, C extends readonly
|
|
|
138
137
|
readonly onAutocompleteError?: OnAutocompleteErrorCallback<number>;
|
|
139
138
|
readonly min_value?: number;
|
|
140
139
|
readonly max_value?: number;
|
|
140
|
+
readonly type: ApplicationCommandOptionType.Number;
|
|
141
141
|
};
|
|
142
142
|
export declare function createChannelOption<R extends boolean, C extends keyof SeyfertChannelMap = keyof SeyfertChannelMap, VC = never>(data: SeyfertChannelOption<C, R, VC>): {
|
|
143
|
-
readonly type: ApplicationCommandOptionType.Channel;
|
|
144
143
|
readonly required?: R | undefined;
|
|
145
144
|
readonly value?: ValueCallback<ApplicationCommandOptionType.Channel, C, VC> | undefined;
|
|
146
145
|
readonly description: string;
|
|
147
|
-
readonly description_localizations?: APIApplicationCommandBasicOption[
|
|
148
|
-
readonly name_localizations?: APIApplicationCommandBasicOption[
|
|
146
|
+
readonly description_localizations?: APIApplicationCommandBasicOption['description_localizations'];
|
|
147
|
+
readonly name_localizations?: APIApplicationCommandBasicOption['name_localizations'];
|
|
149
148
|
readonly locales?: {
|
|
150
149
|
name?: FlatObjectKeys<DefaultLocale>;
|
|
151
150
|
description?: FlatObjectKeys<DefaultLocale>;
|
|
152
151
|
};
|
|
153
152
|
readonly channel_types?: readonly C[] | undefined;
|
|
153
|
+
readonly type: ApplicationCommandOptionType.Channel;
|
|
154
154
|
};
|
|
155
155
|
export declare function createBooleanOption<R extends boolean, T extends SeyfertBooleanOption<R> = SeyfertBooleanOption<R>>(data: T): T & {
|
|
156
156
|
readonly type: ApplicationCommandOptionType.Boolean;
|
package/lib/commands/handle.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ export declare class HandleCommand {
|
|
|
73
73
|
* @returns The missing permission names, or `undefined` when command execution can continue.
|
|
74
74
|
*/
|
|
75
75
|
checkBotPermissions(command: Command | SubCommand | ContextMenuCommand | EntryPointCommand, _context: CommandContext | MenuCommandContext<any> | EntryPointContext, permissions: PermissionsBitField): Awaitable<PermissionStrings | undefined>;
|
|
76
|
-
checkPermissions(app: PermissionsBitField, bot: bigint): ("
|
|
76
|
+
checkPermissions(app: PermissionsBitField, bot: bigint): ("AddReactions" | "Administrator" | "AttachFiles" | "BanMembers" | "BypassSlowmode" | "ChangeNickname" | "Connect" | "CreateEvents" | "CreateGuildExpressions" | "CreateInstantInvite" | "CreatePrivateThreads" | "CreatePublicThreads" | "DeafenMembers" | "EmbedLinks" | "KickMembers" | "ManageChannels" | "ManageEvents" | "ManageGuild" | "ManageGuildExpressions" | "ManageMessages" | "ManageNicknames" | "ManageRoles" | "ManageThreads" | "ManageWebhooks" | "MentionEveryone" | "ModerateMembers" | "MoveMembers" | "MuteMembers" | "PinMessages" | "PrioritySpeaker" | "ReadMessageHistory" | "RequestToSpeak" | "SendMessages" | "SendMessagesInThreads" | "SendPolls" | "SendTTSMessages" | "SendVoiceMessages" | "SetVoiceChannelStatus" | "Speak" | "Stream" | "UseApplicationCommands" | "UseEmbeddedActivities" | "UseExternalApps" | "UseExternalEmojis" | "UseExternalSounds" | "UseExternalStickers" | "UseSoundboard" | "UseVAD" | "ViewAuditLog" | "ViewChannel" | "ViewCreatorMonetizationAnalytics" | "ViewGuildInsights")[] | undefined;
|
|
77
77
|
fetchChannel(_option: CommandOptionWithType, query: string): Promise<import("..").APIChannel> | null;
|
|
78
78
|
fetchUser(_option: CommandOptionWithType, query: string): Promise<import("..").APIUser> | null;
|
|
79
79
|
fetchMember(_option: CommandOptionWithType, query: string, guildId: string): Promise<APIGuildMember | null>;
|
|
@@ -90,8 +90,8 @@ export declare class HandleCommand {
|
|
|
90
90
|
}>;
|
|
91
91
|
makeMenuCommand(body: APIApplicationCommandInteraction, shardId: number, __reply?: __InternalReplyFunction): void | {
|
|
92
92
|
command: ContextMenuCommand;
|
|
93
|
-
interaction:
|
|
94
|
-
context: MenuCommandContext<
|
|
93
|
+
interaction: MessageCommandInteraction<boolean> | UserCommandInteraction<boolean>;
|
|
94
|
+
context: MenuCommandContext<MessageCommandInteraction<boolean> | UserCommandInteraction<boolean>, never>;
|
|
95
95
|
};
|
|
96
96
|
runOptions(command: Command | SubCommand, context: CommandContext, resolver: OptionResolverStructure): Promise<boolean>;
|
|
97
97
|
argsOptionsParser(command: Command | SubCommand, message: GatewayMessageCreateDispatchData, args: Record<string, string>, resolved: MakeRequired<ContextOptionsResolved>): Promise<{
|
|
@@ -12,7 +12,7 @@ export declare class CommandHandler extends BaseHandler {
|
|
|
12
12
|
entryPoint: EntryPointCommand | null;
|
|
13
13
|
filter: (path: string) => boolean;
|
|
14
14
|
constructor(logger: Logger, client: UsingClient);
|
|
15
|
-
reload(resolve: string | Command): Promise<Command |
|
|
15
|
+
reload(resolve: string | Command): Promise<Command | ContextMenuCommand | EntryPointCommand | null>;
|
|
16
16
|
reloadAll(stopIfFail?: boolean): Promise<void>;
|
|
17
17
|
protected shouldUploadLocales(locales?: LocalizationMap | null, cachedLocales?: LocalizationMap | null): boolean;
|
|
18
18
|
protected shouldUploadChoices(option: APIApplicationCommandOption, cached: APIApplicationCommandOption): boolean;
|
|
@@ -21,10 +21,10 @@ export declare class CommandHandler extends BaseHandler {
|
|
|
21
21
|
private prepareCommand;
|
|
22
22
|
checkSubCommandsLimit(command: Command): void;
|
|
23
23
|
private normalizeLoadOptions;
|
|
24
|
-
set(commands: SeteableCommand[], optionsOrTransform?: CommandLoadTransformer | CommandLoadOptions): (Command |
|
|
24
|
+
set(commands: SeteableCommand[], optionsOrTransform?: CommandLoadTransformer | CommandLoadOptions): (Command | ContextMenuCommand | EntryPointCommand)[];
|
|
25
25
|
load(commandsDir: string, client: UsingClient, options?: CommandLoadOptions): Promise<(Command | ContextMenuCommand)[]>;
|
|
26
|
-
parseLocales(command: InstanceType<HandleableCommand>): Command |
|
|
27
|
-
protected getLocales(locale: string): ("
|
|
26
|
+
parseLocales(command: InstanceType<HandleableCommand>): Command | ContextMenuCommand | EntryPointCommand | SubCommand;
|
|
27
|
+
protected getLocales(locale: string): ("bg" | "cs" | "da" | "de" | "el" | "en-GB" | "en-US" | "es-419" | "es-ES" | "fi" | "fr" | "hi" | "hr" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "nl" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "sv-SE" | "th" | "tr" | "uk" | "vi" | "zh-CN" | "zh-TW")[];
|
|
28
28
|
protected getLocaleKey(locale: string, key: string, context: string): string | undefined;
|
|
29
29
|
parseGlobalLocales(command: InstanceType<HandleableCommand>): void;
|
|
30
30
|
parseCommandOptionLocales(option: CommandOption, commandName?: string): void;
|
|
@@ -215,7 +215,7 @@ export declare const Formatter: {
|
|
|
215
215
|
* @param animated Whether the emoji is animated. Defaults to false.
|
|
216
216
|
* @returns The formatted emoji.
|
|
217
217
|
*/
|
|
218
|
-
emojiMention(emojiId: string, name: string | null, animated?: boolean): `<${
|
|
218
|
+
emojiMention(emojiId: string, name: string | null, animated?: boolean): `<${'a' | ''}:${string}:${string}>`;
|
|
219
219
|
/**
|
|
220
220
|
* Formats a channel link.
|
|
221
221
|
* @param channelId The ID of the channel.
|