seyfert 4.5.0 → 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.
Files changed (230) hide show
  1. package/lib/api/Routes/cdn.d.ts +2 -2
  2. package/lib/api/Routes/guilds.d.ts +2 -2
  3. package/lib/api/Routes/invites.d.ts +2 -2
  4. package/lib/api/api.d.ts +20 -8
  5. package/lib/api/api.js +198 -44
  6. package/lib/api/shared.d.ts +30 -1
  7. package/lib/api/utils/constants.d.ts +1 -1
  8. package/lib/api/utils/constants.js +1 -1
  9. package/lib/api/utils/utils.d.ts +2 -1
  10. package/lib/api/utils/utils.js +1 -1
  11. package/lib/builders/Attachment.d.ts +1 -1
  12. package/lib/builders/Attachment.js +30 -8
  13. package/lib/builders/MediaGallery.d.ts +2 -2
  14. package/lib/builders/MediaGallery.js +10 -0
  15. package/lib/builders/Modal.d.ts +18 -8
  16. package/lib/builders/Modal.js +36 -7
  17. package/lib/builders/Poll.js +18 -0
  18. package/lib/builders/RadioGroup.d.ts +4 -3
  19. package/lib/builders/RadioGroup.js +24 -3
  20. package/lib/builders/SelectMenu.d.ts +8 -6
  21. package/lib/builders/SelectMenu.js +24 -3
  22. package/lib/builders/types.d.ts +3 -2
  23. package/lib/cache/adapters/default.d.ts +1 -1
  24. package/lib/cache/adapters/default.js +23 -26
  25. package/lib/cache/adapters/limited.d.ts +1 -0
  26. package/lib/cache/adapters/limited.js +47 -33
  27. package/lib/cache/index.d.ts +19 -25
  28. package/lib/cache/index.js +58 -6
  29. package/lib/cache/resources/bans.d.ts +1 -1
  30. package/lib/cache/resources/bans.js +4 -4
  31. package/lib/cache/resources/channels.d.ts +1 -1
  32. package/lib/cache/resources/channels.js +4 -4
  33. package/lib/cache/resources/default/base.d.ts +1 -1
  34. package/lib/cache/resources/default/base.js +8 -8
  35. package/lib/cache/resources/default/guild-based.d.ts +5 -5
  36. package/lib/cache/resources/default/guild-based.js +29 -16
  37. package/lib/cache/resources/default/guild-related.d.ts +5 -5
  38. package/lib/cache/resources/default/guild-related.js +14 -14
  39. package/lib/cache/resources/emojis.d.ts +1 -1
  40. package/lib/cache/resources/emojis.js +4 -4
  41. package/lib/cache/resources/guilds.js +28 -15
  42. package/lib/cache/resources/members.d.ts +1 -1
  43. package/lib/cache/resources/members.js +6 -6
  44. package/lib/cache/resources/messages.d.ts +7 -2
  45. package/lib/cache/resources/messages.js +43 -20
  46. package/lib/cache/resources/overwrites.d.ts +1 -1
  47. package/lib/cache/resources/overwrites.js +5 -8
  48. package/lib/cache/resources/roles.d.ts +1 -1
  49. package/lib/cache/resources/roles.js +4 -4
  50. package/lib/cache/resources/stickers.d.ts +1 -1
  51. package/lib/cache/resources/stickers.js +4 -4
  52. package/lib/cache/resources/users.js +4 -4
  53. package/lib/cache/resources/voice-states.d.ts +1 -1
  54. package/lib/cache/resources/voice-states.js +4 -4
  55. package/lib/client/base.d.ts +83 -24
  56. package/lib/client/base.js +594 -39
  57. package/lib/client/client.d.ts +28 -3
  58. package/lib/client/client.js +33 -9
  59. package/lib/client/collectors.d.ts +9 -8
  60. package/lib/client/collectors.js +19 -52
  61. package/lib/client/httpclient.d.ts +3 -0
  62. package/lib/client/index.d.ts +3 -1
  63. package/lib/client/index.js +4 -0
  64. package/lib/client/intents.d.ts +3 -0
  65. package/lib/client/intents.js +9 -0
  66. package/lib/client/plugins/api.d.ts +4 -0
  67. package/lib/client/plugins/api.js +550 -0
  68. package/lib/client/plugins/errors.d.ts +25 -0
  69. package/lib/client/plugins/errors.js +79 -0
  70. package/lib/client/plugins/order.d.ts +10 -0
  71. package/lib/client/plugins/order.js +32 -0
  72. package/lib/client/plugins/registry.d.ts +273 -0
  73. package/lib/client/plugins/registry.js +868 -0
  74. package/lib/client/plugins/shared.d.ts +23 -0
  75. package/lib/client/plugins/shared.js +193 -0
  76. package/lib/client/plugins/types.d.ts +398 -0
  77. package/lib/client/plugins/types.js +8 -0
  78. package/lib/client/plugins.d.ts +78 -0
  79. package/lib/client/plugins.js +558 -0
  80. package/lib/client/transformers.d.ts +33 -33
  81. package/lib/client/workerclient.d.ts +10 -1
  82. package/lib/client/workerclient.js +27 -17
  83. package/lib/collection.d.ts +10 -8
  84. package/lib/collection.js +19 -25
  85. package/lib/commands/applications/chat.d.ts +20 -18
  86. package/lib/commands/applications/chat.js +39 -14
  87. package/lib/commands/applications/chatcontext.d.ts +23 -15
  88. package/lib/commands/applications/chatcontext.js +23 -2
  89. package/lib/commands/applications/entryPoint.d.ts +4 -3
  90. package/lib/commands/applications/entryPoint.js +1 -1
  91. package/lib/commands/applications/entrycontext.d.ts +7 -9
  92. package/lib/commands/applications/entrycontext.js +3 -1
  93. package/lib/commands/applications/menu.d.ts +4 -3
  94. package/lib/commands/applications/menucontext.d.ts +7 -9
  95. package/lib/commands/applications/menucontext.js +3 -1
  96. package/lib/commands/applications/options.d.ts +23 -23
  97. package/lib/commands/applications/shared.d.ts +39 -17
  98. package/lib/commands/decorators.d.ts +50 -38
  99. package/lib/commands/decorators.js +15 -5
  100. package/lib/commands/handle.d.ts +19 -8
  101. package/lib/commands/handle.js +224 -143
  102. package/lib/commands/handler.d.ts +21 -8
  103. package/lib/commands/handler.js +157 -69
  104. package/lib/commands/index.d.ts +1 -0
  105. package/lib/commands/optionresolver.d.ts +2 -2
  106. package/lib/common/it/colors.js +12 -2
  107. package/lib/common/it/error.d.ts +9 -0
  108. package/lib/common/it/error.js +8 -0
  109. package/lib/common/it/fake-promise.d.ts +4 -0
  110. package/lib/common/it/fake-promise.js +10 -0
  111. package/lib/common/it/formatter.d.ts +14 -11
  112. package/lib/common/it/formatter.js +4 -3
  113. package/lib/common/it/logger.d.ts +7 -1
  114. package/lib/common/it/logger.js +24 -6
  115. package/lib/common/it/utils.d.ts +6 -8
  116. package/lib/common/it/utils.js +44 -42
  117. package/lib/common/shorters/application.d.ts +3 -3
  118. package/lib/common/shorters/application.js +3 -2
  119. package/lib/common/shorters/bans.d.ts +8 -4
  120. package/lib/common/shorters/bans.js +13 -5
  121. package/lib/common/shorters/channels.d.ts +4 -4
  122. package/lib/common/shorters/channels.js +4 -4
  123. package/lib/common/shorters/emojis.js +1 -0
  124. package/lib/common/shorters/guilds.d.ts +8 -8
  125. package/lib/common/shorters/guilds.js +14 -31
  126. package/lib/common/shorters/interaction.d.ts +1 -1
  127. package/lib/common/shorters/invites.d.ts +201 -201
  128. package/lib/common/shorters/members.d.ts +7 -7
  129. package/lib/common/shorters/members.js +13 -14
  130. package/lib/common/shorters/messages.d.ts +2 -2
  131. package/lib/common/shorters/soundboard.d.ts +5 -5
  132. package/lib/common/shorters/users.d.ts +1 -1
  133. package/lib/common/shorters/webhook.d.ts +3 -2
  134. package/lib/common/shorters/webhook.js +0 -7
  135. package/lib/common/types/options.d.ts +4 -0
  136. package/lib/common/types/util.d.ts +8 -0
  137. package/lib/common/types/write.d.ts +2 -1
  138. package/lib/components/BaseSelectMenuComponent.d.ts +1 -1
  139. package/lib/components/BaseSelectMenuComponent.js +1 -1
  140. package/lib/components/ButtonComponent.d.ts +3 -3
  141. package/lib/components/ChannelSelectMenuComponent.d.ts +2 -2
  142. package/lib/components/File.d.ts +1 -1
  143. package/lib/components/MediaGallery.d.ts +1 -1
  144. package/lib/components/MentionableSelectMenuComponent.d.ts +1 -1
  145. package/lib/components/RoleSelectMenuComponent.d.ts +1 -1
  146. package/lib/components/Separator.d.ts +1 -1
  147. package/lib/components/StringSelectMenuComponent.d.ts +1 -1
  148. package/lib/components/TextInputComponent.d.ts +1 -1
  149. package/lib/components/Thumbnail.d.ts +1 -1
  150. package/lib/components/UserSelectMenuComponent.d.ts +1 -1
  151. package/lib/components/componentcommand.d.ts +8 -7
  152. package/lib/components/componentcontext.d.ts +24 -36
  153. package/lib/components/componentcontext.js +7 -17
  154. package/lib/components/handler.d.ts +17 -7
  155. package/lib/components/handler.js +108 -49
  156. package/lib/components/index.d.ts +1 -0
  157. package/lib/components/index.js +1 -0
  158. package/lib/components/interactioncontext.d.ts +45 -0
  159. package/lib/components/interactioncontext.js +93 -0
  160. package/lib/components/modalcommand.d.ts +5 -4
  161. package/lib/components/modalcontext.d.ts +39 -20
  162. package/lib/components/modalcontext.js +59 -6
  163. package/lib/events/event.d.ts +9 -3
  164. package/lib/events/handler.d.ts +51 -6
  165. package/lib/events/handler.js +165 -36
  166. package/lib/events/hooks/application_command.d.ts +1 -1
  167. package/lib/events/hooks/auto_moderation.d.ts +2 -2
  168. package/lib/events/hooks/guild.d.ts +150 -150
  169. package/lib/events/hooks/interactions.d.ts +1 -1
  170. package/lib/events/hooks/invite.d.ts +20 -20
  171. package/lib/events/hooks/message.d.ts +27 -27
  172. package/lib/events/hooks/presence.d.ts +11 -11
  173. package/lib/events/hooks/soundboard.d.ts +6 -6
  174. package/lib/events/hooks/stage.d.ts +2 -2
  175. package/lib/events/hooks/subscriptions.d.ts +3 -3
  176. package/lib/events/hooks/thread.d.ts +30 -30
  177. package/lib/events/hooks/voice.d.ts +3 -4
  178. package/lib/events/hooks/voice.js +2 -1
  179. package/lib/events/utils.d.ts +4 -0
  180. package/lib/events/utils.js +59 -0
  181. package/lib/index.d.ts +9 -4
  182. package/lib/index.js +13 -8
  183. package/lib/langs/handler.d.ts +14 -11
  184. package/lib/langs/handler.js +46 -9
  185. package/lib/langs/router.d.ts +10 -3
  186. package/lib/structures/Application.d.ts +1 -1
  187. package/lib/structures/Emoji.d.ts +3 -3
  188. package/lib/structures/Emoji.js +2 -2
  189. package/lib/structures/Guild.d.ts +154 -154
  190. package/lib/structures/GuildBan.d.ts +4 -4
  191. package/lib/structures/GuildBan.js +3 -3
  192. package/lib/structures/GuildMember.d.ts +7 -7
  193. package/lib/structures/GuildMember.js +28 -7
  194. package/lib/structures/GuildRole.d.ts +1 -1
  195. package/lib/structures/GuildRole.js +2 -2
  196. package/lib/structures/Interaction.d.ts +11 -9
  197. package/lib/structures/Interaction.js +33 -12
  198. package/lib/structures/Message.d.ts +21 -14
  199. package/lib/structures/Message.js +29 -14
  200. package/lib/structures/User.d.ts +1 -1
  201. package/lib/structures/VoiceState.d.ts +4 -0
  202. package/lib/structures/VoiceState.js +13 -1
  203. package/lib/structures/Webhook.d.ts +9 -1
  204. package/lib/structures/Webhook.js +4 -1
  205. package/lib/structures/channels.d.ts +148 -134
  206. package/lib/structures/channels.js +27 -26
  207. package/lib/structures/extra/BitField.d.ts +4 -4
  208. package/lib/structures/extra/BitField.js +20 -4
  209. package/lib/structures/extra/DiscordBase.js +1 -1
  210. package/lib/structures/extra/Permissions.d.ts +2 -4
  211. package/lib/structures/extra/Permissions.js +1 -17
  212. package/lib/types/payloads/_interactions/responses.d.ts +2 -2
  213. package/lib/types/payloads/components.d.ts +4 -4
  214. package/lib/websocket/SharedTypes.d.ts +4 -4
  215. package/lib/websocket/constants/index.d.ts +1 -1
  216. package/lib/websocket/constants/index.js +3 -2
  217. package/lib/websocket/discord/events/memberUpdate.js +2 -2
  218. package/lib/websocket/discord/heartbeater.d.ts +1 -0
  219. package/lib/websocket/discord/heartbeater.js +7 -0
  220. package/lib/websocket/discord/shard.d.ts +2 -2
  221. package/lib/websocket/discord/shard.js +15 -13
  222. package/lib/websocket/discord/sharder.d.ts +8 -7
  223. package/lib/websocket/discord/sharder.js +25 -5
  224. package/lib/websocket/discord/shared.d.ts +19 -6
  225. package/lib/websocket/discord/socket/custom.js +5 -0
  226. package/lib/websocket/discord/worker.d.ts +1 -0
  227. package/lib/websocket/discord/worker.js +2 -0
  228. package/lib/websocket/discord/workermanager.d.ts +25 -11
  229. package/lib/websocket/discord/workermanager.js +41 -10
  230. package/package.json +12 -16
@@ -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, RegisteredMiddlewares, SubCommand, UsingClient } from '../commands';
5
- import { type InferWithPrefix, type MiddlewareContext } from '../commands/applications/shared';
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, IntentStrings, OmitInsert, PermissionStrings, When } from '../common/types/util';
13
- import type { ComponentCommand, ModalCommand } from '../components';
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 { APIInteraction, APIInteractionResponse, LocaleString, RESTPostAPIChannelMessageJSONBody } from '../types';
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?: Record<string, MiddlewareContext>;
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
- get proxy(): import("../api").APIRoutes;
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
- t(locale: string): import("..").__InternalParseLocale<import("../commands").DefaultLocale> & {
81
- get(locale?: string): import("../commands").DefaultLocale;
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 RegisteredMiddlewares)[];
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
- getRC?(): Awaitable<InternalRuntimeConfig | InternalRuntimeConfigHTTP>;
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: number;
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?: IntentStrings | number[] | number;
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?: Record<string, MiddlewareContext>;
178
- handleCommand?: typeof HandleCommand;
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 {};