seyfert 4.4.1 → 5.0.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/README.md +7 -1
- package/lib/api/Routes/cdn.d.ts +2 -2
- package/lib/api/Routes/guilds.d.ts +2 -2
- package/lib/api/Routes/invites.d.ts +2 -2
- package/lib/api/api.d.ts +20 -8
- package/lib/api/api.js +198 -44
- package/lib/api/shared.d.ts +30 -1
- package/lib/api/utils/constants.d.ts +1 -1
- package/lib/api/utils/constants.js +1 -1
- package/lib/api/utils/utils.d.ts +2 -1
- package/lib/api/utils/utils.js +1 -1
- package/lib/builders/Attachment.d.ts +1 -1
- package/lib/builders/Attachment.js +30 -8
- package/lib/builders/MediaGallery.d.ts +2 -2
- package/lib/builders/MediaGallery.js +10 -0
- package/lib/builders/Modal.d.ts +18 -8
- package/lib/builders/Modal.js +36 -7
- package/lib/builders/Poll.js +18 -0
- package/lib/builders/RadioGroup.d.ts +4 -3
- package/lib/builders/RadioGroup.js +24 -3
- package/lib/builders/SelectMenu.d.ts +8 -6
- package/lib/builders/SelectMenu.js +24 -3
- package/lib/builders/types.d.ts +3 -2
- package/lib/cache/adapters/default.d.ts +1 -1
- package/lib/cache/adapters/default.js +23 -26
- package/lib/cache/adapters/limited.d.ts +1 -0
- package/lib/cache/adapters/limited.js +47 -33
- package/lib/cache/index.d.ts +19 -25
- package/lib/cache/index.js +58 -6
- package/lib/cache/resources/bans.d.ts +1 -1
- package/lib/cache/resources/bans.js +4 -4
- package/lib/cache/resources/channels.d.ts +1 -1
- package/lib/cache/resources/channels.js +4 -4
- package/lib/cache/resources/default/base.d.ts +1 -1
- package/lib/cache/resources/default/base.js +8 -8
- package/lib/cache/resources/default/guild-based.d.ts +5 -5
- package/lib/cache/resources/default/guild-based.js +29 -16
- package/lib/cache/resources/default/guild-related.d.ts +5 -5
- package/lib/cache/resources/default/guild-related.js +14 -14
- package/lib/cache/resources/emojis.d.ts +1 -1
- package/lib/cache/resources/emojis.js +4 -4
- package/lib/cache/resources/guilds.js +28 -15
- package/lib/cache/resources/members.d.ts +1 -1
- package/lib/cache/resources/members.js +6 -6
- package/lib/cache/resources/messages.d.ts +7 -2
- package/lib/cache/resources/messages.js +43 -20
- package/lib/cache/resources/overwrites.d.ts +1 -1
- package/lib/cache/resources/overwrites.js +5 -8
- package/lib/cache/resources/roles.d.ts +1 -1
- package/lib/cache/resources/roles.js +4 -4
- package/lib/cache/resources/stickers.d.ts +1 -1
- package/lib/cache/resources/stickers.js +4 -4
- package/lib/cache/resources/users.js +4 -4
- package/lib/cache/resources/voice-states.d.ts +1 -1
- package/lib/cache/resources/voice-states.js +4 -4
- package/lib/client/base.d.ts +83 -24
- package/lib/client/base.js +594 -39
- package/lib/client/client.d.ts +29 -4
- package/lib/client/client.js +38 -13
- package/lib/client/collectors.d.ts +9 -8
- package/lib/client/collectors.js +19 -52
- package/lib/client/httpclient.d.ts +3 -0
- package/lib/client/index.d.ts +3 -1
- package/lib/client/index.js +4 -0
- package/lib/client/intents.d.ts +3 -0
- package/lib/client/intents.js +9 -0
- package/lib/client/plugins/api.d.ts +4 -0
- package/lib/client/plugins/api.js +550 -0
- package/lib/client/plugins/errors.d.ts +25 -0
- package/lib/client/plugins/errors.js +79 -0
- package/lib/client/plugins/order.d.ts +10 -0
- package/lib/client/plugins/order.js +32 -0
- package/lib/client/plugins/registry.d.ts +273 -0
- package/lib/client/plugins/registry.js +868 -0
- package/lib/client/plugins/shared.d.ts +23 -0
- package/lib/client/plugins/shared.js +193 -0
- package/lib/client/plugins/types.d.ts +398 -0
- package/lib/client/plugins/types.js +8 -0
- package/lib/client/plugins.d.ts +78 -0
- package/lib/client/plugins.js +558 -0
- package/lib/client/transformers.d.ts +33 -33
- package/lib/client/workerclient.d.ts +11 -2
- package/lib/client/workerclient.js +33 -22
- package/lib/collection.d.ts +10 -8
- package/lib/collection.js +19 -25
- package/lib/commands/applications/chat.d.ts +20 -18
- package/lib/commands/applications/chat.js +39 -14
- package/lib/commands/applications/chatcontext.d.ts +23 -15
- package/lib/commands/applications/chatcontext.js +23 -2
- package/lib/commands/applications/entryPoint.d.ts +4 -3
- package/lib/commands/applications/entryPoint.js +1 -1
- package/lib/commands/applications/entrycontext.d.ts +7 -9
- package/lib/commands/applications/entrycontext.js +3 -1
- package/lib/commands/applications/menu.d.ts +4 -3
- package/lib/commands/applications/menucontext.d.ts +7 -9
- package/lib/commands/applications/menucontext.js +3 -1
- package/lib/commands/applications/options.d.ts +23 -23
- package/lib/commands/applications/shared.d.ts +39 -17
- package/lib/commands/decorators.d.ts +50 -38
- package/lib/commands/decorators.js +15 -5
- package/lib/commands/handle.d.ts +19 -8
- package/lib/commands/handle.js +224 -143
- package/lib/commands/handler.d.ts +21 -8
- package/lib/commands/handler.js +157 -69
- package/lib/commands/index.d.ts +1 -0
- package/lib/commands/optionresolver.d.ts +2 -2
- package/lib/common/it/colors.js +12 -2
- package/lib/common/it/error.d.ts +9 -0
- package/lib/common/it/error.js +8 -0
- package/lib/common/it/fake-promise.d.ts +4 -0
- package/lib/common/it/fake-promise.js +10 -0
- package/lib/common/it/formatter.d.ts +14 -11
- package/lib/common/it/formatter.js +4 -3
- package/lib/common/it/logger.d.ts +7 -1
- package/lib/common/it/logger.js +24 -6
- package/lib/common/it/utils.d.ts +6 -8
- package/lib/common/it/utils.js +44 -42
- package/lib/common/shorters/application.d.ts +3 -3
- package/lib/common/shorters/application.js +3 -2
- package/lib/common/shorters/bans.d.ts +8 -4
- package/lib/common/shorters/bans.js +13 -5
- package/lib/common/shorters/channels.d.ts +4 -4
- package/lib/common/shorters/channels.js +4 -4
- package/lib/common/shorters/emojis.js +1 -0
- package/lib/common/shorters/guilds.d.ts +8 -8
- package/lib/common/shorters/guilds.js +14 -31
- package/lib/common/shorters/interaction.d.ts +1 -1
- package/lib/common/shorters/invites.d.ts +201 -201
- package/lib/common/shorters/members.d.ts +7 -7
- package/lib/common/shorters/members.js +13 -14
- package/lib/common/shorters/messages.d.ts +2 -2
- package/lib/common/shorters/soundboard.d.ts +5 -5
- package/lib/common/shorters/users.d.ts +1 -1
- package/lib/common/shorters/webhook.d.ts +3 -2
- package/lib/common/shorters/webhook.js +0 -7
- package/lib/common/types/options.d.ts +4 -0
- package/lib/common/types/util.d.ts +8 -0
- package/lib/common/types/write.d.ts +2 -1
- package/lib/components/BaseSelectMenuComponent.d.ts +1 -1
- package/lib/components/BaseSelectMenuComponent.js +1 -1
- package/lib/components/ButtonComponent.d.ts +3 -3
- package/lib/components/ChannelSelectMenuComponent.d.ts +2 -2
- package/lib/components/File.d.ts +1 -1
- package/lib/components/MediaGallery.d.ts +1 -1
- package/lib/components/MentionableSelectMenuComponent.d.ts +1 -1
- package/lib/components/RoleSelectMenuComponent.d.ts +1 -1
- package/lib/components/Separator.d.ts +1 -1
- package/lib/components/StringSelectMenuComponent.d.ts +1 -1
- package/lib/components/TextInputComponent.d.ts +1 -1
- package/lib/components/Thumbnail.d.ts +1 -1
- package/lib/components/UserSelectMenuComponent.d.ts +1 -1
- package/lib/components/componentcommand.d.ts +8 -7
- package/lib/components/componentcontext.d.ts +24 -36
- package/lib/components/componentcontext.js +7 -17
- package/lib/components/handler.d.ts +17 -7
- package/lib/components/handler.js +108 -49
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/interactioncontext.d.ts +45 -0
- package/lib/components/interactioncontext.js +93 -0
- package/lib/components/modalcommand.d.ts +5 -4
- package/lib/components/modalcontext.d.ts +39 -20
- package/lib/components/modalcontext.js +59 -6
- package/lib/events/event.d.ts +9 -3
- package/lib/events/handler.d.ts +51 -6
- package/lib/events/handler.js +165 -36
- package/lib/events/hooks/application_command.d.ts +1 -1
- package/lib/events/hooks/auto_moderation.d.ts +2 -2
- package/lib/events/hooks/guild.d.ts +150 -150
- package/lib/events/hooks/interactions.d.ts +1 -1
- package/lib/events/hooks/invite.d.ts +20 -20
- package/lib/events/hooks/message.d.ts +27 -27
- package/lib/events/hooks/presence.d.ts +11 -11
- package/lib/events/hooks/soundboard.d.ts +6 -6
- package/lib/events/hooks/stage.d.ts +2 -2
- package/lib/events/hooks/subscriptions.d.ts +3 -3
- package/lib/events/hooks/thread.d.ts +30 -30
- package/lib/events/hooks/voice.d.ts +3 -4
- package/lib/events/hooks/voice.js +2 -1
- package/lib/events/utils.d.ts +4 -0
- package/lib/events/utils.js +59 -0
- package/lib/index.d.ts +9 -4
- package/lib/index.js +14 -8
- package/lib/langs/handler.d.ts +14 -11
- package/lib/langs/handler.js +46 -9
- package/lib/langs/router.d.ts +10 -3
- package/lib/structures/Application.d.ts +1 -1
- package/lib/structures/Emoji.d.ts +3 -3
- package/lib/structures/Emoji.js +2 -2
- package/lib/structures/Guild.d.ts +154 -154
- package/lib/structures/GuildBan.d.ts +4 -4
- package/lib/structures/GuildBan.js +3 -3
- package/lib/structures/GuildMember.d.ts +7 -7
- package/lib/structures/GuildMember.js +28 -7
- package/lib/structures/GuildRole.d.ts +1 -1
- package/lib/structures/GuildRole.js +2 -2
- package/lib/structures/Interaction.d.ts +11 -9
- package/lib/structures/Interaction.js +33 -12
- package/lib/structures/Message.d.ts +21 -14
- package/lib/structures/Message.js +29 -14
- package/lib/structures/User.d.ts +1 -1
- package/lib/structures/VoiceState.d.ts +4 -0
- package/lib/structures/VoiceState.js +13 -1
- package/lib/structures/Webhook.d.ts +9 -1
- package/lib/structures/Webhook.js +4 -1
- package/lib/structures/channels.d.ts +148 -134
- package/lib/structures/channels.js +27 -26
- package/lib/structures/extra/BitField.d.ts +4 -4
- package/lib/structures/extra/BitField.js +20 -4
- package/lib/structures/extra/DiscordBase.js +1 -1
- package/lib/structures/extra/Permissions.d.ts +2 -4
- package/lib/structures/extra/Permissions.js +1 -17
- package/lib/types/payloads/_interactions/responses.d.ts +2 -2
- package/lib/types/payloads/components.d.ts +4 -4
- package/lib/websocket/SharedTypes.d.ts +4 -4
- package/lib/websocket/constants/index.d.ts +1 -1
- package/lib/websocket/constants/index.js +3 -2
- package/lib/websocket/discord/events/memberUpdate.js +2 -2
- package/lib/websocket/discord/heartbeater.d.ts +1 -0
- package/lib/websocket/discord/heartbeater.js +7 -0
- package/lib/websocket/discord/shard.d.ts +2 -2
- package/lib/websocket/discord/shard.js +16 -14
- package/lib/websocket/discord/sharder.d.ts +8 -7
- package/lib/websocket/discord/sharder.js +26 -6
- package/lib/websocket/discord/shared.d.ts +19 -6
- package/lib/websocket/discord/socket/custom.js +5 -0
- package/lib/websocket/discord/worker.d.ts +1 -0
- package/lib/websocket/discord/worker.js +2 -0
- package/lib/websocket/discord/workermanager.d.ts +25 -11
- package/lib/websocket/discord/workermanager.js +41 -10
- package/package.json +13 -17
package/lib/client/base.d.ts
CHANGED
|
@@ -1,23 +1,36 @@
|
|
|
1
1
|
import { ApiHandler } from '../api';
|
|
2
2
|
import type { Adapter, DisabledCache } from '../cache';
|
|
3
3
|
import { Cache } from '../cache';
|
|
4
|
-
import type { Command, CommandContext, ContextMenuCommand, ExtendedRC, ExtendedRCLocations, ExtraProps, MenuCommandContext,
|
|
5
|
-
import {
|
|
4
|
+
import type { Command, CommandContext, ContextMenuCommand, ExtendContext, ExtendedRC, ExtendedRCLocations, ExtraProps, MenuCommandContext, ResolvedRegisteredMiddlewares, UsingClient } from '../commands';
|
|
5
|
+
import { SubCommand } from '../commands';
|
|
6
|
+
import { type AnyMiddlewareContext, type InferWithPrefix, type MiddlewareContext } from '../commands/applications/shared';
|
|
7
|
+
import type { BaseContext } from '../commands/basecontext';
|
|
6
8
|
import { HandleCommand } from '../commands/handle';
|
|
7
9
|
import { CommandHandler } from '../commands/handler';
|
|
8
|
-
import { ApplicationShorter, ChannelShorter, EmojiShorter, GuildShorter, InteractionShorter, InvitesShorter, Logger, type MakeRequired, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, ThreadShorter, UsersShorter, WebhookShorter } from '../common';
|
|
10
|
+
import { ApplicationShorter, ChannelShorter, EmojiShorter, GuildShorter, InteractionShorter, InvitesShorter, Logger, type LoggerOptions, type MakeRequired, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, ThreadShorter, UsersShorter, WebhookShorter } from '../common';
|
|
9
11
|
import { BanShorter } from '../common/shorters/bans';
|
|
10
12
|
import { SoundboardShorter } from '../common/shorters/soundboard';
|
|
11
13
|
import { VoiceStateShorter } from '../common/shorters/voiceStates';
|
|
12
|
-
import type { Awaitable, DeepPartial,
|
|
13
|
-
import
|
|
14
|
+
import type { Awaitable, DeepPartial, OmitInsert, PermissionStrings, When } from '../common/types/util';
|
|
15
|
+
import { ComponentCommand, ModalCommand } from '../components';
|
|
14
16
|
import { ComponentHandler } from '../components/handler';
|
|
17
|
+
import { type CustomEventRunner } from '../events';
|
|
15
18
|
import { LangsHandler } from '../langs/handler';
|
|
16
19
|
import type { ChatInputCommandInteraction, ComponentInteraction, EntryPointInteraction, MessageCommandInteraction, ModalSubmitInteraction, UserCommandInteraction } from '../structures';
|
|
17
|
-
import type
|
|
20
|
+
import { type APIInteraction, type APIInteractionResponse, type LocaleString, type RESTPostAPIChannelMessageJSONBody } from '../types';
|
|
21
|
+
import { type GatewayIntentInput } from './intents';
|
|
22
|
+
import { type AnySeyfertPlugin, type PluginMiddlewareDenialMetadata, type PluginSharedRegistry, type ResolvedPluginList } from './plugins';
|
|
18
23
|
import type { MessageStructure } from './transformers';
|
|
24
|
+
export type ContextScopeContext = BaseContext & ExtendContext;
|
|
25
|
+
export type ContextScope = <T>(context: ContextScopeContext, run: () => Awaitable<T>) => Awaitable<T>;
|
|
26
|
+
type ResolvedMiddlewareKey<T extends Record<string, AnyMiddlewareContext>> = Extract<keyof T, string>;
|
|
27
|
+
export type ClientMiddlewares<T extends Record<string, AnyMiddlewareContext> = ResolvedRegisteredMiddlewares> = [
|
|
28
|
+
ResolvedMiddlewareKey<T>
|
|
29
|
+
] extends [never] ? Record<string, MiddlewareContext> : {
|
|
30
|
+
[K in ResolvedMiddlewareKey<T>]?: T[K];
|
|
31
|
+
};
|
|
19
32
|
export declare class BaseClient {
|
|
20
|
-
rest: ApiHandler
|
|
33
|
+
rest: ApiHandler<this>;
|
|
21
34
|
cache: Cache;
|
|
22
35
|
applications: ApplicationShorter;
|
|
23
36
|
users: UsersShorter;
|
|
@@ -44,11 +57,21 @@ export declare class BaseClient {
|
|
|
44
57
|
handleCommand: HandleCommand;
|
|
45
58
|
private _applicationId?;
|
|
46
59
|
private _botId?;
|
|
47
|
-
middlewares?:
|
|
60
|
+
middlewares?: ClientMiddlewares;
|
|
48
61
|
protected static getBotIdFromToken(token: string): string;
|
|
62
|
+
readonly plugins: ResolvedPluginList;
|
|
63
|
+
shared: PluginSharedRegistry;
|
|
64
|
+
events: CustomEventRunner;
|
|
65
|
+
private pluginsSetupPromise?;
|
|
66
|
+
private pluginsClosePromise?;
|
|
67
|
+
private langBaseValues;
|
|
68
|
+
private pluginCacheDisabledCache;
|
|
69
|
+
private pluginBaseGatewayIntents;
|
|
70
|
+
private pluginComponentsBeforeLoadDepth;
|
|
49
71
|
options: BaseClientOptions;
|
|
50
72
|
constructor(options?: BaseClientOptions);
|
|
51
|
-
|
|
73
|
+
protected configureLogger(defaults: LoggerOptions, options?: LoggerOptions): void;
|
|
74
|
+
get proxy(): import("..").APIRoutes;
|
|
52
75
|
set botId(id: string);
|
|
53
76
|
get botId(): string;
|
|
54
77
|
set applicationId(id: string);
|
|
@@ -56,6 +79,31 @@ export declare class BaseClient {
|
|
|
56
79
|
setServices({ rest, cache, langs, middlewares, handleCommand }: ServicesOptions): void;
|
|
57
80
|
protected execute(..._options: unknown[]): Promise<void>;
|
|
58
81
|
start(options?: Pick<DeepPartial<StartOptions>, 'langsDir' | 'commandsDir' | 'connection' | 'token' | 'componentsDir'>): Promise<void>;
|
|
82
|
+
reloadPluginContributions(): Promise<void>;
|
|
83
|
+
private bindPluginRestObserverProvider;
|
|
84
|
+
private bindPluginLangReload;
|
|
85
|
+
private refreshPluginCacheResources;
|
|
86
|
+
protected resolvePluginGatewayIntents(base?: GatewayIntentInput): number;
|
|
87
|
+
private reloadPluginMiddlewares;
|
|
88
|
+
private reloadPluginCommands;
|
|
89
|
+
private reloadPluginComponents;
|
|
90
|
+
private setupPlugins;
|
|
91
|
+
/**
|
|
92
|
+
* Closes resources managed by the plugin lifecycle.
|
|
93
|
+
*
|
|
94
|
+
* This waits for in-flight plugin setup and runs `SeyfertPlugin.teardown`.
|
|
95
|
+
* It does not close the gateway, REST client, or cache adapter.
|
|
96
|
+
*/
|
|
97
|
+
close(): Promise<void>;
|
|
98
|
+
private applyPluginCommands;
|
|
99
|
+
private get loadedCommands();
|
|
100
|
+
private applyPluginComponents;
|
|
101
|
+
private createPluginCommandInstance;
|
|
102
|
+
private createPluginComponentInstance;
|
|
103
|
+
private runPluginHandlerCreators;
|
|
104
|
+
private matchesPluginHandlerKind;
|
|
105
|
+
private createPluginLoadedMetadata;
|
|
106
|
+
private emitPluginCustomEvent;
|
|
59
107
|
protected onPacket(..._packet: unknown[]): Promise<any>;
|
|
60
108
|
/**
|
|
61
109
|
*
|
|
@@ -70,25 +118,24 @@ export declare class BaseClient {
|
|
|
70
118
|
}>;
|
|
71
119
|
private shouldUploadCommands;
|
|
72
120
|
private syncCachePath;
|
|
121
|
+
private cachedCommandGuilds;
|
|
73
122
|
uploadCommands({ applicationId, cachePath }?: {
|
|
74
123
|
applicationId?: string;
|
|
75
124
|
cachePath?: string;
|
|
76
125
|
}): Promise<void>;
|
|
126
|
+
private emitUploadCommandsMetadata;
|
|
77
127
|
loadCommands(dir?: string): Promise<void>;
|
|
78
128
|
loadComponents(dir?: string): Promise<void>;
|
|
79
129
|
loadLangs(dir?: string): Promise<void>;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
getRC<T extends InternalRuntimeConfigHTTP | InternalRuntimeConfig = InternalRuntimeConfigHTTP | InternalRuntimeConfig>(): Promise<{
|
|
84
|
-
debug: boolean;
|
|
85
|
-
} & Omit<T, "debug" | "locations"> & {
|
|
86
|
-
locations: RCLocations;
|
|
87
|
-
}>;
|
|
130
|
+
private applyPluginLangs;
|
|
131
|
+
t(locale: string): import("..").SeyfertLocale;
|
|
132
|
+
getRC<T extends InternalRuntimeConfigHTTP | InternalRuntimeConfig = InternalRuntimeConfigHTTP | InternalRuntimeConfig>(): Promise<ResolvedRC>;
|
|
88
133
|
}
|
|
89
134
|
export interface BaseClientOptions {
|
|
135
|
+
plugins?: readonly AnySeyfertPlugin[];
|
|
136
|
+
contextScopes?: readonly ContextScope[];
|
|
90
137
|
context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ComponentInteraction | ModalSubmitInteraction | EntryPointInteraction<boolean> | When<InferWithPrefix, MessageStructure, never>) => Record<string, unknown>;
|
|
91
|
-
globalMiddlewares?: readonly (keyof
|
|
138
|
+
globalMiddlewares?: readonly (keyof ResolvedRegisteredMiddlewares)[];
|
|
92
139
|
commands?: {
|
|
93
140
|
defaults?: {
|
|
94
141
|
onBeforeMiddlewares?: (context: CommandContext | MenuCommandContext<any, never>) => unknown;
|
|
@@ -97,7 +144,7 @@ export interface BaseClientOptions {
|
|
|
97
144
|
onPermissionsFail?: Command['onPermissionsFail'];
|
|
98
145
|
onBotPermissionsFail?: (context: MenuCommandContext<any, never> | CommandContext, permissions: PermissionStrings) => unknown;
|
|
99
146
|
onInternalError?: (client: UsingClient, command: Command | SubCommand | ContextMenuCommand, error?: unknown) => unknown;
|
|
100
|
-
onMiddlewaresError?: (context: CommandContext | MenuCommandContext<any, never>, error: string) => unknown;
|
|
147
|
+
onMiddlewaresError?: (context: CommandContext | MenuCommandContext<any, never>, error: string, metadata: PluginMiddlewareDenialMetadata) => unknown;
|
|
101
148
|
onOptionsError?: Command['onOptionsError'];
|
|
102
149
|
onAfterRun?: (context: CommandContext | MenuCommandContext<any, never>, error: unknown) => unknown;
|
|
103
150
|
props?: ExtraProps;
|
|
@@ -122,7 +169,8 @@ export interface BaseClientOptions {
|
|
|
122
169
|
};
|
|
123
170
|
};
|
|
124
171
|
allowedMentions?: RESTPostAPIChannelMessageJSONBody['allowed_mentions'];
|
|
125
|
-
|
|
172
|
+
logger?: LoggerOptions;
|
|
173
|
+
getRC?(): Awaitable<InternalRuntimeConfig | InternalRuntimeConfigHTTP | RuntimeConfig | RuntimeConfigHTTP>;
|
|
126
174
|
}
|
|
127
175
|
export interface StartOptions {
|
|
128
176
|
eventsDir: string;
|
|
@@ -130,7 +178,7 @@ export interface StartOptions {
|
|
|
130
178
|
commandsDir: string;
|
|
131
179
|
componentsDir: string;
|
|
132
180
|
connection: {
|
|
133
|
-
intents:
|
|
181
|
+
intents: GatewayIntentInput;
|
|
134
182
|
};
|
|
135
183
|
httpConnection: {
|
|
136
184
|
publicKey: string;
|
|
@@ -154,6 +202,11 @@ interface RC extends ExtendedRC {
|
|
|
154
202
|
port?: number;
|
|
155
203
|
publicKey?: string;
|
|
156
204
|
}
|
|
205
|
+
export type ResolvedRC = Readonly<Omit<RC, 'locations' | 'debug'> & {
|
|
206
|
+
locations: Readonly<MakeRequired<RC['locations'], 'base'>>;
|
|
207
|
+
debug: boolean;
|
|
208
|
+
intents: number;
|
|
209
|
+
}>;
|
|
157
210
|
export type InternalRuntimeConfigHTTP = Omit<MakeRequired<RC, 'publicKey' | 'port' | 'applicationId'>, 'intents' | 'locations'> & {
|
|
158
211
|
locations: Omit<RC['locations'], 'events'>;
|
|
159
212
|
};
|
|
@@ -162,8 +215,10 @@ export type RuntimeConfigHTTP = Omit<MakeRequired<RC, 'publicKey' | 'application
|
|
|
162
215
|
};
|
|
163
216
|
export type InternalRuntimeConfig = MakeRequired<RC, 'intents'>;
|
|
164
217
|
export type RuntimeConfig = OmitInsert<InternalRuntimeConfig, 'intents', {
|
|
165
|
-
intents?:
|
|
218
|
+
intents?: GatewayIntentInput;
|
|
166
219
|
}>;
|
|
220
|
+
export type BotConfig = InternalRuntimeConfig;
|
|
221
|
+
export type HttpConfig = InternalRuntimeConfigHTTP;
|
|
167
222
|
export interface ServicesOptions {
|
|
168
223
|
rest?: ApiHandler;
|
|
169
224
|
cache?: {
|
|
@@ -172,9 +227,13 @@ export interface ServicesOptions {
|
|
|
172
227
|
};
|
|
173
228
|
langs?: {
|
|
174
229
|
default?: string;
|
|
230
|
+
preferGuildLocale?: boolean;
|
|
175
231
|
aliases?: Record<string, LocaleString[]>;
|
|
176
232
|
};
|
|
177
|
-
middlewares?:
|
|
178
|
-
|
|
233
|
+
middlewares?: ClientMiddlewares;
|
|
234
|
+
/**
|
|
235
|
+
* Custom command handler subclass constructor. Pass the class itself, not an instance.
|
|
236
|
+
*/
|
|
237
|
+
handleCommand?: new (client: UsingClient) => HandleCommand;
|
|
179
238
|
}
|
|
180
239
|
export {};
|