seyfert 2.1.0 → 2.1.1-dev-11316886063.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 (241) hide show
  1. package/lib/api/Router.d.ts +2 -2
  2. package/lib/api/Router.js +2 -1
  3. package/lib/api/Routes/applications.d.ts +29 -30
  4. package/lib/api/Routes/cdn.d.ts +6 -1
  5. package/lib/api/Routes/channels.d.ts +44 -45
  6. package/lib/api/Routes/gateway.d.ts +3 -4
  7. package/lib/api/Routes/guilds.d.ts +81 -80
  8. package/lib/api/Routes/index.d.ts +3 -1
  9. package/lib/api/Routes/interactions.d.ts +6 -6
  10. package/lib/api/Routes/invites.d.ts +3 -4
  11. package/lib/api/Routes/skus.d.ts +4 -5
  12. package/lib/api/Routes/soundboard.d.ts +23 -0
  13. package/lib/api/Routes/soundboard.js +2 -0
  14. package/lib/api/Routes/stage-instances.d.ts +5 -6
  15. package/lib/api/Routes/stickers.d.ts +3 -4
  16. package/lib/api/Routes/users.d.ts +11 -12
  17. package/lib/api/Routes/voice.d.ts +2 -3
  18. package/lib/api/Routes/webhooks.d.ts +16 -15
  19. package/lib/api/api.d.ts +17 -11
  20. package/lib/api/api.js +12 -10
  21. package/lib/api/shared.d.ts +1 -1
  22. package/lib/api/utils/constants.d.ts +2 -0
  23. package/lib/api/utils/constants.js +2 -1
  24. package/lib/builders/ActionRow.d.ts +1 -1
  25. package/lib/builders/Attachment.d.ts +2 -2
  26. package/lib/builders/Attachment.js +1 -1
  27. package/lib/builders/Button.d.ts +1 -1
  28. package/lib/builders/Button.js +1 -1
  29. package/lib/builders/Embed.d.ts +1 -1
  30. package/lib/builders/Embed.js +2 -2
  31. package/lib/builders/Modal.d.ts +1 -1
  32. package/lib/builders/Poll.d.ts +1 -1
  33. package/lib/builders/Poll.js +1 -1
  34. package/lib/builders/SelectMenu.d.ts +1 -1
  35. package/lib/builders/SelectMenu.js +1 -1
  36. package/lib/builders/types.d.ts +2 -1
  37. package/lib/cache/adapters/default.js +5 -3
  38. package/lib/cache/adapters/limited.d.ts +1 -2
  39. package/lib/cache/adapters/limited.js +34 -30
  40. package/lib/cache/adapters/workeradapter.js +3 -1
  41. package/lib/cache/index.d.ts +8 -11
  42. package/lib/cache/index.js +38 -37
  43. package/lib/cache/resources/bans.d.ts +2 -2
  44. package/lib/cache/resources/bans.js +1 -1
  45. package/lib/cache/resources/channels.d.ts +1 -1
  46. package/lib/cache/resources/default/guild-related.d.ts +1 -2
  47. package/lib/cache/resources/emojis.d.ts +2 -2
  48. package/lib/cache/resources/emojis.js +1 -1
  49. package/lib/cache/resources/guilds.d.ts +2 -2
  50. package/lib/cache/resources/guilds.js +7 -11
  51. package/lib/cache/resources/members.d.ts +2 -2
  52. package/lib/cache/resources/members.js +1 -1
  53. package/lib/cache/resources/messages.d.ts +2 -2
  54. package/lib/cache/resources/messages.js +3 -3
  55. package/lib/cache/resources/overwrites.d.ts +1 -1
  56. package/lib/cache/resources/roles.d.ts +2 -2
  57. package/lib/cache/resources/roles.js +1 -1
  58. package/lib/cache/resources/stickers.d.ts +2 -2
  59. package/lib/cache/resources/stickers.js +1 -1
  60. package/lib/cache/resources/users.d.ts +2 -2
  61. package/lib/cache/resources/users.js +1 -1
  62. package/lib/cache/resources/voice-states.d.ts +2 -2
  63. package/lib/cache/resources/voice-states.js +1 -1
  64. package/lib/client/base.d.ts +9 -14
  65. package/lib/client/base.js +43 -44
  66. package/lib/client/client.d.ts +3 -7
  67. package/lib/client/client.js +24 -41
  68. package/lib/client/collectors.js +1 -1
  69. package/lib/client/httpclient.d.ts +1 -1
  70. package/lib/client/transformers.d.ts +37 -34
  71. package/lib/client/transformers.js +66 -63
  72. package/lib/client/workerclient.d.ts +10 -11
  73. package/lib/client/workerclient.js +180 -75
  74. package/lib/collection.d.ts +3 -3
  75. package/lib/commands/applications/chat.d.ts +12 -32
  76. package/lib/commands/applications/chat.js +5 -6
  77. package/lib/commands/applications/chatcontext.d.ts +6 -6
  78. package/lib/commands/applications/chatcontext.js +16 -8
  79. package/lib/commands/applications/entryPoint.d.ts +1 -1
  80. package/lib/commands/applications/entrycontext.d.ts +6 -6
  81. package/lib/commands/applications/entrycontext.js +4 -4
  82. package/lib/commands/applications/menu.d.ts +1 -1
  83. package/lib/commands/applications/menucontext.d.ts +5 -5
  84. package/lib/commands/applications/menucontext.js +6 -6
  85. package/lib/commands/applications/options.d.ts +104 -28
  86. package/lib/commands/applications/options.js +4 -4
  87. package/lib/commands/applications/shared.d.ts +5 -2
  88. package/lib/commands/basecontext.d.ts +1 -1
  89. package/lib/commands/decorators.d.ts +10 -10
  90. package/lib/commands/decorators.js +5 -4
  91. package/lib/commands/handle.d.ts +9 -9
  92. package/lib/commands/handle.js +94 -68
  93. package/lib/commands/handler.d.ts +5 -5
  94. package/lib/commands/handler.js +21 -17
  95. package/lib/commands/optionresolver.d.ts +4 -4
  96. package/lib/commands/optionresolver.js +3 -3
  97. package/lib/common/it/formatter.d.ts +21 -21
  98. package/lib/common/it/formatter.js +40 -41
  99. package/lib/common/it/logger.js +1 -1
  100. package/lib/common/it/utils.d.ts +4 -3
  101. package/lib/common/it/utils.js +52 -27
  102. package/lib/common/shorters/application.d.ts +2 -3
  103. package/lib/common/shorters/application.js +3 -3
  104. package/lib/common/shorters/bans.js +1 -1
  105. package/lib/common/shorters/channels.d.ts +3 -3
  106. package/lib/common/shorters/channels.js +3 -3
  107. package/lib/common/shorters/emojis.js +4 -4
  108. package/lib/common/shorters/guilds.d.ts +3 -3
  109. package/lib/common/shorters/guilds.js +5 -9
  110. package/lib/common/shorters/interaction.d.ts +3 -3
  111. package/lib/common/shorters/interaction.js +6 -5
  112. package/lib/common/shorters/members.d.ts +4 -5
  113. package/lib/common/shorters/members.js +6 -7
  114. package/lib/common/shorters/messages.d.ts +1 -1
  115. package/lib/common/shorters/messages.js +4 -4
  116. package/lib/common/shorters/reactions.d.ts +1 -1
  117. package/lib/common/shorters/reactions.js +1 -1
  118. package/lib/common/shorters/roles.js +1 -1
  119. package/lib/common/shorters/templates.js +2 -2
  120. package/lib/common/shorters/threads.d.ts +1 -1
  121. package/lib/common/shorters/threads.js +17 -11
  122. package/lib/common/shorters/webhook.d.ts +1 -1
  123. package/lib/common/shorters/webhook.js +4 -4
  124. package/lib/common/types/options.d.ts +2 -2
  125. package/lib/common/types/resolvables.d.ts +1 -1
  126. package/lib/common/types/util.d.ts +4 -1
  127. package/lib/common/types/write.d.ts +1 -1
  128. package/lib/components/BaseComponent.js +1 -1
  129. package/lib/components/ButtonComponent.d.ts +1 -1
  130. package/lib/components/componentcommand.d.ts +1 -1
  131. package/lib/components/componentcontext.d.ts +4 -4
  132. package/lib/components/componentcontext.js +1 -1
  133. package/lib/components/handler.d.ts +10 -8
  134. package/lib/components/handler.js +16 -13
  135. package/lib/components/index.js +2 -1
  136. package/lib/components/modalcontext.d.ts +2 -2
  137. package/lib/components/modalcontext.js +1 -1
  138. package/lib/deps/mixer.d.ts +1 -1
  139. package/lib/events/handler.d.ts +5 -5
  140. package/lib/events/handler.js +66 -16
  141. package/lib/events/hooks/application_command.d.ts +1 -1
  142. package/lib/events/hooks/auto_moderation.d.ts +1 -1
  143. package/lib/events/hooks/auto_moderation.js +1 -1
  144. package/lib/events/hooks/channel.d.ts +1 -1
  145. package/lib/events/hooks/dispatch.d.ts +1 -1
  146. package/lib/events/hooks/entitlement.d.ts +4 -5
  147. package/lib/events/hooks/entitlement.js +4 -4
  148. package/lib/events/hooks/guild.d.ts +3 -3
  149. package/lib/events/hooks/guild.js +1 -1
  150. package/lib/events/hooks/index.d.ts +1 -0
  151. package/lib/events/hooks/index.js +1 -0
  152. package/lib/events/hooks/integration.d.ts +1 -1
  153. package/lib/events/hooks/integration.js +1 -1
  154. package/lib/events/hooks/interactions.d.ts +3 -3
  155. package/lib/events/hooks/invite.d.ts +1 -1
  156. package/lib/events/hooks/message.d.ts +3 -3
  157. package/lib/events/hooks/message.js +1 -1
  158. package/lib/events/hooks/presence.d.ts +2 -2
  159. package/lib/events/hooks/soundboard.d.ts +155 -0
  160. package/lib/events/hooks/soundboard.js +28 -0
  161. package/lib/events/hooks/stage.d.ts +2 -2
  162. package/lib/events/hooks/thread.d.ts +2 -2
  163. package/lib/events/hooks/thread.js +2 -2
  164. package/lib/events/hooks/typing.d.ts +1 -1
  165. package/lib/events/hooks/typing.js +1 -1
  166. package/lib/events/hooks/user.d.ts +2 -2
  167. package/lib/events/hooks/voice.d.ts +2 -2
  168. package/lib/events/hooks/voice.js +1 -1
  169. package/lib/events/hooks/webhook.d.ts +1 -1
  170. package/lib/index.d.ts +2 -2
  171. package/lib/index.js +3 -5
  172. package/lib/langs/handler.d.ts +2 -2
  173. package/lib/structures/Guild.d.ts +7 -4
  174. package/lib/structures/Guild.js +1 -1
  175. package/lib/structures/GuildBan.d.ts +1 -1
  176. package/lib/structures/GuildMember.d.ts +7 -5
  177. package/lib/structures/GuildMember.js +5 -3
  178. package/lib/structures/GuildRole.d.ts +1 -1
  179. package/lib/structures/GuildTemplate.d.ts +1 -1
  180. package/lib/structures/Interaction.d.ts +17 -14
  181. package/lib/structures/Interaction.js +28 -21
  182. package/lib/structures/Message.d.ts +4 -7
  183. package/lib/structures/Message.js +5 -5
  184. package/lib/structures/Poll.d.ts +3 -3
  185. package/lib/structures/Sticker.d.ts +2 -2
  186. package/lib/structures/Sticker.js +1 -1
  187. package/lib/structures/VoiceState.d.ts +2 -1
  188. package/lib/structures/VoiceState.js +1 -1
  189. package/lib/structures/Webhook.d.ts +3 -3
  190. package/lib/structures/Webhook.js +1 -1
  191. package/lib/structures/channels.d.ts +4 -4
  192. package/lib/structures/channels.js +6 -5
  193. package/lib/structures/extra/BitField.d.ts +3 -3
  194. package/lib/structures/extra/BitField.js +34 -33
  195. package/lib/structures/extra/DiscordBase.js +1 -1
  196. package/lib/structures/extra/Permissions.d.ts +2 -0
  197. package/lib/structures/extra/Permissions.js +21 -0
  198. package/lib/types/gateway.d.ts +53 -5
  199. package/lib/types/payloads/_interactions/base.d.ts +1 -1
  200. package/lib/types/payloads/channel.d.ts +2 -2
  201. package/lib/types/payloads/guild.d.ts +9 -1
  202. package/lib/types/payloads/guild.js +8 -0
  203. package/lib/types/payloads/index.d.ts +1 -0
  204. package/lib/types/payloads/index.js +1 -0
  205. package/lib/types/payloads/soundboard.d.ts +23 -0
  206. package/lib/types/payloads/soundboard.js +5 -0
  207. package/lib/types/payloads/user.js +0 -1
  208. package/lib/types/rest/application.d.ts +3 -3
  209. package/lib/types/rest/auditLog.d.ts +1 -1
  210. package/lib/types/rest/channel.d.ts +2 -2
  211. package/lib/types/rest/guild.d.ts +2 -2
  212. package/lib/types/rest/guildScheduledEvent.d.ts +1 -1
  213. package/lib/types/rest/index.d.ts +1 -0
  214. package/lib/types/rest/index.js +1 -0
  215. package/lib/types/rest/oauth2.d.ts +1 -1
  216. package/lib/types/rest/poll.d.ts +1 -1
  217. package/lib/types/rest/soundboard.d.ts +64 -0
  218. package/lib/types/rest/soundboard.js +2 -0
  219. package/lib/types/rest/stageInstance.d.ts +1 -1
  220. package/lib/types/rest/template.d.ts +1 -1
  221. package/lib/types/rest/user.d.ts +1 -1
  222. package/lib/types/rest/webhook.d.ts +1 -1
  223. package/lib/types/utils/index.d.ts +11 -2
  224. package/lib/types/utils/index.js +10 -2
  225. package/lib/websocket/SharedTypes.d.ts +11 -2
  226. package/lib/websocket/constants/index.js +0 -10
  227. package/lib/websocket/discord/basesocket.d.ts +1 -1
  228. package/lib/websocket/discord/shard.d.ts +1 -1
  229. package/lib/websocket/discord/shard.js +25 -16
  230. package/lib/websocket/discord/sharder.d.ts +9 -6
  231. package/lib/websocket/discord/sharder.js +91 -74
  232. package/lib/websocket/discord/shared.d.ts +3 -14
  233. package/lib/websocket/discord/socket/custom.js +19 -6
  234. package/lib/websocket/discord/worker.d.ts +8 -2
  235. package/lib/websocket/discord/workermanager.d.ts +42 -17
  236. package/lib/websocket/discord/workermanager.js +144 -37
  237. package/lib/websocket/structures/timeout.d.ts +4 -5
  238. package/lib/websocket/structures/timeout.js +23 -24
  239. package/package.json +72 -70
  240. package/lib/cache/resources/threads.d.ts +0 -14
  241. package/lib/cache/resources/threads.js +0 -32
@@ -1,5 +1,5 @@
1
- import type { ApplicationCommandType, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../types';
2
1
  import { type PermissionStrings } from '../../common';
2
+ import type { ApplicationCommandType, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../types';
3
3
  import type { RegisteredMiddlewares } from '../decorators';
4
4
  import type { MenuCommandContext } from './menucontext';
5
5
  import type { ExtraProps, UsingClient } from './shared';
@@ -1,10 +1,10 @@
1
1
  import type { ContextMenuCommand, ReturnCache } from '../..';
2
+ import { type GuildMemberStructure, type GuildStructure, type MessageStructure, type UserStructure, type WebhookMessageStructure } from '../../client/transformers';
2
3
  import { type InteractionCreateBodyRequest, type InteractionMessageUpdateBodyRequest, type ModalCreateBodyRequest, type UnionToTuple, type When } from '../../common';
3
4
  import type { AllChannels, MessageCommandInteraction, UserCommandInteraction } from '../../structures';
4
5
  import { BaseContext } from '../basecontext';
5
6
  import type { RegisteredMiddlewares } from '../decorators';
6
7
  import type { CommandMetadata, ExtendContext, GlobalMetadata, UsingClient } from './shared';
7
- import { type GuildMemberStructure, type GuildStructure, type MessageStructure, type UserStructure, type WebhookMessageStructure } from '../../client/transformers';
8
8
  export type InteractionTarget<T> = T extends MessageCommandInteraction ? MessageStructure : UserStructure;
9
9
  export interface MenuCommandContext<T extends MessageCommandInteraction | UserCommandInteraction, M extends keyof RegisteredMiddlewares = never> extends BaseContext, ExtendContext {
10
10
  }
@@ -21,12 +21,12 @@ export declare class MenuCommandContext<T extends MessageCommandInteraction | Us
21
21
  get(locale?: string): import("./shared").DefaultLocale;
22
22
  };
23
23
  get fullCommandName(): string;
24
- write<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<When<FR, WebhookMessageStructure, void | WebhookMessageStructure>>;
25
- modal(body: ModalCreateBodyRequest): Promise<void>;
26
- deferReply(ephemeral?: boolean): Promise<void>;
24
+ write<WR extends boolean = false>(body: InteractionCreateBodyRequest, withResponse?: WR): Promise<When<WR, WebhookMessageStructure, void | WebhookMessageStructure>>;
25
+ modal(body: ModalCreateBodyRequest): Promise<undefined>;
26
+ deferReply<WR extends boolean = false>(ephemeral?: boolean): Promise<When<WR, WebhookMessageStructure, undefined>>;
27
27
  editResponse(body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
28
28
  deleteResponse(): Promise<void | undefined>;
29
- editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, fetchReply?: FR): Promise<When<FR, WebhookMessageStructure | MessageStructure, void | WebhookMessageStructure | MessageStructure>>;
29
+ editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<When<WR, WebhookMessageStructure | MessageStructure, void | WebhookMessageStructure | MessageStructure>>;
30
30
  fetchResponse(): Promise<import("../..").WebhookMessage | undefined>;
31
31
  channel(mode?: 'rest' | 'flow'): Promise<AllChannels>;
32
32
  channel(mode?: 'cache'): ReturnCache<AllChannels>;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MenuCommandContext = void 0;
4
- const types_1 = require("../../types");
4
+ const transformers_1 = require("../../client/transformers");
5
5
  const common_1 = require("../../common");
6
+ const types_1 = require("../../types");
6
7
  const basecontext_1 = require("../basecontext");
7
- const transformers_1 = require("../../client/transformers");
8
8
  class MenuCommandContext extends basecontext_1.BaseContext {
9
9
  client;
10
10
  interaction;
@@ -38,8 +38,8 @@ class MenuCommandContext extends basecontext_1.BaseContext {
38
38
  get fullCommandName() {
39
39
  return this.command.name;
40
40
  }
41
- write(body, fetchReply) {
42
- return this.interaction.write(body, fetchReply);
41
+ write(body, withResponse) {
42
+ return this.interaction.write(body, withResponse);
43
43
  }
44
44
  modal(body) {
45
45
  return this.interaction.modal(body);
@@ -53,8 +53,8 @@ class MenuCommandContext extends basecontext_1.BaseContext {
53
53
  deleteResponse() {
54
54
  return this.interaction.deleteResponse();
55
55
  }
56
- editOrReply(body, fetchReply) {
57
- return this.interaction.editOrReply(body, fetchReply);
56
+ editOrReply(body, withResponse) {
57
+ return this.interaction.editOrReply(body, withResponse);
58
58
  }
59
59
  fetchResponse() {
60
60
  return this.interaction.fetchResponse();
@@ -1,48 +1,127 @@
1
- import { ApplicationCommandOptionType, type APIApplicationCommandOptionChoice, type ChannelType } from '../../types';
2
- import type { AutocompleteCallback, EntryPointContext, MenuCommandContext, OnAutocompleteErrorCallback, ReturnOptionsTypes, __TypesWrapper } from '..';
3
- import type { MessageCommandInteraction, UserCommandInteraction } from '../../structures';
4
- import type { CommandContext } from './chatcontext';
5
- import type { MiddlewareContext } from './shared';
1
+ import type { AutocompleteCallback, EntryPointContext, MenuCommandContext, OnAutocompleteErrorCallback, ReturnOptionsTypes } from '..';
2
+ import type { Awaitable, FlatObjectKeys } from '../../common';
6
3
  import type { ModalContext } from '../../components';
7
4
  import type { ComponentContext } from '../../components/componentcontext';
8
- export type SeyfertBasicOption<T extends keyof __TypesWrapper, D = {}> = __TypesWrapper[T] & D;
9
- export type SeyfertStringOption = SeyfertBasicOption<'String'> & {
5
+ import type { MessageCommandInteraction, UserCommandInteraction } from '../../structures';
6
+ import { type APIApplicationCommandBasicOption, type APIApplicationCommandOptionChoice, ApplicationCommandOptionType, type ChannelType } from '../../types';
7
+ import type { CommandContext } from './chatcontext';
8
+ import type { DefaultLocale, MiddlewareContext, OKFunction, StopFunction } from './shared';
9
+ export interface SeyfertBasicOption<T extends keyof ReturnOptionsTypes> {
10
+ required?: boolean;
11
+ value?(data: {
12
+ context: CommandContext;
13
+ value: ReturnOptionsTypes[T];
14
+ }, ok: OKFunction<any>, fail: StopFunction): Awaitable<void>;
15
+ description: string;
16
+ description_localizations?: APIApplicationCommandBasicOption['description_localizations'];
17
+ name_localizations?: APIApplicationCommandBasicOption['name_localizations'];
18
+ locales?: {
19
+ name?: FlatObjectKeys<DefaultLocale>;
20
+ description?: FlatObjectKeys<DefaultLocale>;
21
+ };
22
+ }
23
+ export interface SeyfertBaseChoiceableOption<T extends keyof ReturnOptionsTypes, C = T extends ChoiceableTypes ? SeyfertChoice<ChoiceableValues[T]>[] : never> {
24
+ required?: boolean;
25
+ choices?: C;
26
+ value?: ValueCallback<T, C>;
27
+ description: string;
28
+ description_localizations?: APIApplicationCommandBasicOption['description_localizations'];
29
+ name_localizations?: APIApplicationCommandBasicOption['name_localizations'];
30
+ locales?: {
31
+ name?: FlatObjectKeys<DefaultLocale>;
32
+ description?: FlatObjectKeys<DefaultLocale>;
33
+ };
34
+ }
35
+ export type SeyfertChoice<T extends string | number> = {
36
+ readonly name: string;
37
+ readonly value: T;
38
+ } | APIApplicationCommandOptionChoice<T>;
39
+ export type ChoiceableTypes = ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
40
+ export interface ChoiceableValues {
41
+ [ApplicationCommandOptionType.String]: string;
42
+ [ApplicationCommandOptionType.Number]: number;
43
+ [ApplicationCommandOptionType.Integer]: number;
44
+ }
45
+ export type ValueCallback<T extends keyof ReturnOptionsTypes, C = T extends ChoiceableTypes ? SeyfertChoice<ChoiceableValues[T]>[] : never> = (data: {
46
+ context: CommandContext;
47
+ value: T extends ChoiceableTypes ? C extends SeyfertChoice<ChoiceableValues[T]>[] ? C[number]['value'] extends ReturnOptionsTypes[T] ? C[number]['value'] : ReturnOptionsTypes[T] : ReturnOptionsTypes[T] : ReturnOptionsTypes[T];
48
+ }, ok: OKFunction<any>, fail: StopFunction) => Awaitable<void>;
49
+ export type SeyfertStringOption<T = SeyfertChoice<string>[]> = SeyfertBaseChoiceableOption<ApplicationCommandOptionType.String, T> & {
10
50
  autocomplete?: AutocompleteCallback;
11
51
  onAutocompleteError?: OnAutocompleteErrorCallback;
12
- choices?: readonly {
13
- readonly name: string;
14
- readonly value: string;
15
- }[] | APIApplicationCommandOptionChoice<ReturnOptionsTypes[ApplicationCommandOptionType.String]>[];
16
52
  min_length?: number;
17
53
  max_length?: number;
18
54
  };
19
- export type SeyfertIntegerOption = SeyfertBasicOption<'Integer'> & {
55
+ export type SeyfertIntegerOption<T = SeyfertChoice<number>[]> = SeyfertBaseChoiceableOption<ApplicationCommandOptionType.Integer, T> & {
20
56
  autocomplete?: AutocompleteCallback;
21
57
  onAutocompleteError?: OnAutocompleteErrorCallback;
22
- choices?: APIApplicationCommandOptionChoice<ReturnOptionsTypes[ApplicationCommandOptionType.Integer]>[];
23
58
  min_value?: number;
24
59
  max_value?: number;
25
60
  };
26
- export type SeyfertBooleanOption = SeyfertBasicOption<'Boolean'>;
27
- export type SeyfertUserOption = SeyfertBasicOption<'User'>;
28
- export type SeyfertChannelOption = SeyfertBasicOption<'Channel'> & {
29
- channel_types?: ChannelType[];
30
- };
31
- export type SeyfertRoleOption = SeyfertBasicOption<'Role'>;
32
- export type SeyfertMentionableOption = SeyfertBasicOption<'Mentionable'>;
33
- export type SeyfertNumberOption = SeyfertBasicOption<'Number'> & {
61
+ export type SeyfertNumberOption<T = SeyfertChoice<number>[]> = SeyfertBaseChoiceableOption<ApplicationCommandOptionType.Number, T> & {
34
62
  autocomplete?: AutocompleteCallback;
35
63
  onAutocompleteError?: OnAutocompleteErrorCallback;
36
- choices?: APIApplicationCommandOptionChoice<ReturnOptionsTypes[ApplicationCommandOptionType.Number]>[];
37
64
  min_value?: number;
38
65
  max_value?: number;
39
66
  };
40
- export type SeyfertAttachmentOption = SeyfertBasicOption<'Attachment'>;
41
- export declare function createStringOption<T extends SeyfertStringOption = SeyfertStringOption>(data: T): T & {
67
+ export type SeyfertBooleanOption = SeyfertBasicOption<ApplicationCommandOptionType.Boolean>;
68
+ export type SeyfertUserOption = SeyfertBasicOption<ApplicationCommandOptionType.User>;
69
+ export type SeyfertChannelOption = SeyfertBasicOption<ApplicationCommandOptionType.Channel> & {
70
+ channel_types?: ChannelType[];
71
+ };
72
+ export type SeyfertRoleOption = SeyfertBasicOption<ApplicationCommandOptionType.Role>;
73
+ export type SeyfertMentionableOption = SeyfertBasicOption<ApplicationCommandOptionType.Mentionable>;
74
+ export type SeyfertAttachmentOption = SeyfertBasicOption<ApplicationCommandOptionType.Attachment>;
75
+ export declare function createStringOption<C extends SeyfertChoice<string>[] = SeyfertChoice<string>[]>(data: SeyfertStringOption<C>): {
42
76
  readonly type: ApplicationCommandOptionType.String;
77
+ readonly required?: boolean;
78
+ readonly choices?: C | undefined;
79
+ readonly value?: ValueCallback<ApplicationCommandOptionType.String, C> | undefined;
80
+ readonly description: string;
81
+ readonly description_localizations?: APIApplicationCommandBasicOption["description_localizations"];
82
+ readonly name_localizations?: APIApplicationCommandBasicOption["name_localizations"];
83
+ readonly locales?: {
84
+ name?: FlatObjectKeys<DefaultLocale>;
85
+ description?: FlatObjectKeys<DefaultLocale>;
86
+ };
87
+ readonly autocomplete?: AutocompleteCallback;
88
+ readonly onAutocompleteError?: OnAutocompleteErrorCallback;
89
+ readonly min_length?: number;
90
+ readonly max_length?: number;
43
91
  };
44
- export declare function createIntegerOption<T extends SeyfertIntegerOption = SeyfertIntegerOption>(data: T): T & {
92
+ export declare function createIntegerOption<C extends SeyfertChoice<number>[] = SeyfertChoice<number>[]>(data: SeyfertIntegerOption<C>): {
45
93
  readonly type: ApplicationCommandOptionType.Integer;
94
+ readonly required?: boolean;
95
+ readonly choices?: C | undefined;
96
+ readonly value?: ValueCallback<ApplicationCommandOptionType.Integer, C> | undefined;
97
+ readonly description: string;
98
+ readonly description_localizations?: APIApplicationCommandBasicOption["description_localizations"];
99
+ readonly name_localizations?: APIApplicationCommandBasicOption["name_localizations"];
100
+ readonly locales?: {
101
+ name?: FlatObjectKeys<DefaultLocale>;
102
+ description?: FlatObjectKeys<DefaultLocale>;
103
+ };
104
+ readonly autocomplete?: AutocompleteCallback;
105
+ readonly onAutocompleteError?: OnAutocompleteErrorCallback;
106
+ readonly min_value?: number;
107
+ readonly max_value?: number;
108
+ };
109
+ export declare function createNumberOption<C extends SeyfertChoice<number>[] = SeyfertChoice<number>[]>(data: SeyfertNumberOption<C>): {
110
+ readonly type: ApplicationCommandOptionType.Number;
111
+ readonly required?: boolean;
112
+ readonly choices?: C | undefined;
113
+ readonly value?: ValueCallback<ApplicationCommandOptionType.Number, C> | undefined;
114
+ readonly description: string;
115
+ readonly description_localizations?: APIApplicationCommandBasicOption["description_localizations"];
116
+ readonly name_localizations?: APIApplicationCommandBasicOption["name_localizations"];
117
+ readonly locales?: {
118
+ name?: FlatObjectKeys<DefaultLocale>;
119
+ description?: FlatObjectKeys<DefaultLocale>;
120
+ };
121
+ readonly autocomplete?: AutocompleteCallback;
122
+ readonly onAutocompleteError?: OnAutocompleteErrorCallback;
123
+ readonly min_value?: number;
124
+ readonly max_value?: number;
46
125
  };
47
126
  export declare function createBooleanOption<T extends SeyfertBooleanOption = SeyfertBooleanOption>(data: T): T & {
48
127
  readonly type: ApplicationCommandOptionType.Boolean;
@@ -59,9 +138,6 @@ export declare function createRoleOption<T extends SeyfertRoleOption = SeyfertRo
59
138
  export declare function createMentionableOption<T extends SeyfertMentionableOption = SeyfertMentionableOption>(data: T): T & {
60
139
  readonly type: ApplicationCommandOptionType.Mentionable;
61
140
  };
62
- export declare function createNumberOption<T extends SeyfertNumberOption = SeyfertNumberOption>(data: T): T & {
63
- readonly type: ApplicationCommandOptionType.Number;
64
- };
65
141
  export declare function createAttachmentOption<T extends SeyfertAttachmentOption = SeyfertAttachmentOption>(data: T): T & {
66
142
  readonly type: ApplicationCommandOptionType.Attachment;
67
143
  };
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createStringOption = createStringOption;
4
4
  exports.createIntegerOption = createIntegerOption;
5
+ exports.createNumberOption = createNumberOption;
5
6
  exports.createBooleanOption = createBooleanOption;
6
7
  exports.createUserOption = createUserOption;
7
8
  exports.createChannelOption = createChannelOption;
8
9
  exports.createRoleOption = createRoleOption;
9
10
  exports.createMentionableOption = createMentionableOption;
10
- exports.createNumberOption = createNumberOption;
11
11
  exports.createAttachmentOption = createAttachmentOption;
12
12
  exports.createMiddleware = createMiddleware;
13
13
  const types_1 = require("../../types");
@@ -17,6 +17,9 @@ function createStringOption(data) {
17
17
  function createIntegerOption(data) {
18
18
  return { ...data, type: types_1.ApplicationCommandOptionType.Integer };
19
19
  }
20
+ function createNumberOption(data) {
21
+ return { ...data, type: types_1.ApplicationCommandOptionType.Number };
22
+ }
20
23
  function createBooleanOption(data) {
21
24
  return { ...data, type: types_1.ApplicationCommandOptionType.Boolean };
22
25
  }
@@ -32,9 +35,6 @@ function createRoleOption(data) {
32
35
  function createMentionableOption(data) {
33
36
  return { ...data, type: types_1.ApplicationCommandOptionType.Mentionable };
34
37
  }
35
- function createNumberOption(data) {
36
- return { ...data, type: types_1.ApplicationCommandOptionType.Number };
37
- }
38
38
  function createAttachmentOption(data) {
39
39
  return { ...data, type: types_1.ApplicationCommandOptionType.Attachment };
40
40
  }
@@ -20,6 +20,9 @@ export interface ExtraProps {
20
20
  export interface UsingClient extends BaseClient {
21
21
  }
22
22
  export type ParseClient<T extends BaseClient> = T;
23
+ export type ParseGlobalMiddlewares<T extends Record<string, MiddlewareContext>> = {
24
+ [K in keyof T]: MetadataMiddleware<T[K]>;
25
+ };
23
26
  export interface InternalOptions {
24
27
  }
25
28
  export interface CustomStructures {
@@ -34,9 +37,9 @@ export type MetadataMiddleware<T extends MiddlewareContext> = IsStrictlyUndefine
34
37
  export type CommandMetadata<T extends readonly (keyof RegisteredMiddlewares)[]> = T extends readonly [
35
38
  infer first,
36
39
  ...infer rest
37
- ] ? first extends keyof RegisteredMiddlewares ? (MetadataMiddleware<RegisteredMiddlewares[first]> extends never ? {} : {
40
+ ] ? first extends keyof RegisteredMiddlewares ? (MetadataMiddleware<RegisteredMiddlewares[first]> extends never ? never : {
38
41
  [key in first]: MetadataMiddleware<RegisteredMiddlewares[first]>;
39
- }) & (rest extends readonly (keyof RegisteredMiddlewares)[] ? CommandMetadata<rest> : {}) : {} : {};
42
+ }) & (rest extends readonly (keyof RegisteredMiddlewares)[] ? CommandMetadata<rest> : never) : never : never;
40
43
  export type MessageCommandOptionErrors = ['CHANNEL_TYPES', type: ChannelType[]] | ['STRING_MIN_LENGTH', min: number] | ['STRING_MAX_LENGTH', max: number] | ['STRING_INVALID_CHOICE', choices: readonly {
41
44
  name: string;
42
45
  value: string;
@@ -1,5 +1,5 @@
1
1
  import type { ModalContext } from '../components';
2
- import type { ContextComponentCommandInteractionMap, ComponentContext } from '../components/componentcontext';
2
+ import type { ComponentContext, ContextComponentCommandInteractionMap } from '../components/componentcontext';
3
3
  import type { MessageCommandInteraction, UserCommandInteraction } from '../structures';
4
4
  import type { CommandContext } from './applications/chatcontext';
5
5
  import type { MenuCommandContext } from './applications/menucontext';
@@ -1,5 +1,5 @@
1
- import { ApplicationCommandType, ApplicationIntegrationType, type EntryPointCommandHandlerType, InteractionContextType, type LocaleString } from '../types';
2
1
  import type { FlatObjectKeys, PermissionStrings } from '../common';
2
+ import { ApplicationCommandType, ApplicationIntegrationType, type EntryPointCommandHandlerType, InteractionContextType, type LocaleString } from '../types';
3
3
  import type { CommandOption, OptionsRecord, SubCommand } from './applications/chat';
4
4
  import type { DefaultLocale, ExtraProps, IgnoreCommand, MiddlewareContext } from './applications/shared';
5
5
  export interface RegisteredMiddlewares {
@@ -27,7 +27,7 @@ export declare function Locales({ name: names, description: descriptions, }: {
27
27
  name?: [language: LocaleString, value: string][];
28
28
  description?: [language: LocaleString, value: string][];
29
29
  }): <T extends {
30
- new (...args: any[]): {};
30
+ new (...args: any[]): object;
31
31
  }>(target: T) => {
32
32
  new (...args: any[]): {
33
33
  name_localizations: {
@@ -39,7 +39,7 @@ export declare function Locales({ name: names, description: descriptions, }: {
39
39
  };
40
40
  } & T;
41
41
  export declare function LocalesT(name?: FlatObjectKeys<DefaultLocale>, description?: FlatObjectKeys<DefaultLocale>): <T extends {
42
- new (...args: any[]): {};
42
+ new (...args: any[]): object;
43
43
  }>(target: T) => {
44
44
  new (...args: any[]): {
45
45
  __t: {
@@ -54,7 +54,7 @@ export declare function GroupsT(groups: Record<string, {
54
54
  defaultDescription: string;
55
55
  aliases?: string[];
56
56
  }>): <T extends {
57
- new (...args: any[]): {};
57
+ new (...args: any[]): object;
58
58
  }>(target: T) => {
59
59
  new (...args: any[]): {
60
60
  __tGroups: Record<string, {
@@ -72,7 +72,7 @@ export declare function Groups(groups: Record<string, {
72
72
  defaultDescription: string;
73
73
  aliases?: string[];
74
74
  }>): <T extends {
75
- new (...args: any[]): {};
75
+ new (...args: any[]): object;
76
76
  }>(target: T) => {
77
77
  new (...args: any[]): {
78
78
  groups: Record<string, {
@@ -85,21 +85,21 @@ export declare function Groups(groups: Record<string, {
85
85
  };
86
86
  } & T;
87
87
  export declare function Group(groupName: string): <T extends {
88
- new (...args: any[]): {};
88
+ new (...args: any[]): object;
89
89
  }>(target: T) => {
90
90
  new (...args: any[]): {
91
91
  group: string;
92
92
  };
93
93
  } & T;
94
94
  export declare function Options(options: (new () => SubCommand)[] | OptionsRecord): <T extends {
95
- new (...args: any[]): {};
95
+ new (...args: any[]): object;
96
96
  }>(target: T) => {
97
97
  new (...args: any[]): {
98
98
  options: SubCommand[] | CommandOption[];
99
99
  };
100
100
  } & T;
101
101
  export declare function AutoLoad(): <T extends {
102
- new (...args: any[]): {};
102
+ new (...args: any[]): object;
103
103
  }>(target: T) => {
104
104
  new (...args: any[]): {
105
105
  __autoload: boolean;
@@ -109,14 +109,14 @@ export type ParseMiddlewares<T extends Record<string, MiddlewareContext>> = {
109
109
  [k in keyof T]: T[k];
110
110
  };
111
111
  export declare function Middlewares(cbs: readonly (keyof RegisteredMiddlewares)[]): <T extends {
112
- new (...args: any[]): {};
112
+ new (...args: any[]): object;
113
113
  }>(target: T) => {
114
114
  new (...args: any[]): {
115
115
  middlewares: readonly never[];
116
116
  };
117
117
  } & T;
118
118
  export declare function Declare(declare: CommandDeclareOptions): <T extends {
119
- new (...args: any[]): {};
119
+ new (...args: any[]): object;
120
120
  }>(target: T) => {
121
121
  new (...args: any[]): {
122
122
  name: string;
@@ -9,6 +9,7 @@ exports.Options = Options;
9
9
  exports.AutoLoad = AutoLoad;
10
10
  exports.Middlewares = Middlewares;
11
11
  exports.Declare = Declare;
12
+ const Permissions_1 = require("../structures/extra/Permissions");
12
13
  const types_1 = require("../types");
13
14
  function Locales({ name: names, description: descriptions, }) {
14
15
  return (target) => class extends target {
@@ -86,11 +87,11 @@ function Declare(declare) {
86
87
  integrationTypes = declare.integrationTypes?.map(i => types_1.ApplicationIntegrationType[i]) ?? [
87
88
  types_1.ApplicationIntegrationType.GuildInstall,
88
89
  ];
89
- defaultMemberPermissions = Array.isArray(declare.defaultMemberPermissions)
90
- ? declare.defaultMemberPermissions?.reduce((acc, prev) => acc | types_1.PermissionFlagsBits[prev], BigInt(0))
90
+ defaultMemberPermissions = declare.defaultMemberPermissions
91
+ ? Permissions_1.PermissionsBitField.resolve(declare.defaultMemberPermissions)
91
92
  : declare.defaultMemberPermissions;
92
- botPermissions = Array.isArray(declare.botPermissions)
93
- ? declare.botPermissions?.reduce((acc, prev) => acc | types_1.PermissionFlagsBits[prev], BigInt(0))
93
+ botPermissions = declare.botPermissions
94
+ ? Permissions_1.PermissionsBitField.resolve(declare.botPermissions)
94
95
  : declare.botPermissions;
95
96
  description = '';
96
97
  type = types_1.ApplicationCommandType.ChatInput;
@@ -1,9 +1,9 @@
1
- import { type APIApplicationCommandInteraction, type APIInteraction, type GatewayMessageCreateDispatchData, type APIApplicationCommandInteractionDataOption, ApplicationCommandOptionType } from '../types';
2
- import { Command, type ContextOptionsResolved, type UsingClient, type CommandAutocompleteOption, type ContextMenuCommand, MenuCommandContext, CommandContext, SubCommand, type CommandOption, type MessageCommandOptionErrors, EntryPointContext, type EntryPointCommand } from '.';
3
- import { AutocompleteInteraction, type ComponentInteraction, type ModalSubmitInteraction, type ChatInputCommandInteraction, type MessageCommandInteraction, type UserCommandInteraction, type __InternalReplyFunction, type EntryPointInteraction } from '../structures';
4
- import type { PermissionsBitField } from '../structures/extra/Permissions';
1
+ import { Command, type CommandAutocompleteOption, CommandContext, type CommandOption, type ContextMenuCommand, type ContextOptionsResolved, type EntryPointCommand, EntryPointContext, MenuCommandContext, type MessageCommandOptionErrors, SubCommand, type UsingClient } from '.';
2
+ import { type MessageStructure, type OptionResolverStructure, Transformers } from '../client/transformers';
5
3
  import type { MakeRequired } from '../common';
6
- import { type MessageStructure, Transformers, type OptionResolverStructure } from '../client/transformers';
4
+ import { AutocompleteInteraction, type ChatInputCommandInteraction, type ComponentInteraction, type EntryPointInteraction, type MessageCommandInteraction, type ModalSubmitInteraction, type UserCommandInteraction, type __InternalReplyFunction } from '../structures';
5
+ import type { PermissionsBitField } from '../structures/extra/Permissions';
6
+ import { type APIApplicationCommandInteraction, type APIApplicationCommandInteractionDataOption, type APIInteraction, ApplicationCommandOptionType, type GatewayMessageCreateDispatchData } from '../types';
7
7
  export type CommandOptionWithType = CommandOption & {
8
8
  type: ApplicationCommandOptionType;
9
9
  };
@@ -36,10 +36,10 @@ export declare class HandleCommand {
36
36
  name: string;
37
37
  }): T | undefined;
38
38
  checkPermissions(app: PermissionsBitField, bot: bigint): import("../common").PermissionStrings | undefined;
39
- fetchChannel(_option: CommandOptionWithType, query: string): Promise<import("../types").APIChannel | null>;
40
- fetchUser(_option: CommandOptionWithType, query: string): Promise<import("../types").APIUser | null>;
41
- fetchMember(_option: CommandOptionWithType, query: string, guildId: string): Promise<import("../types").APIGuildMember | null>;
42
- fetchRole(_option: CommandOptionWithType, query: string, guildId?: string): Promise<import("../types").APIRole | null | undefined>;
39
+ fetchChannel(_option: CommandOptionWithType, query: string): Promise<import("../types").APIChannel> | null;
40
+ fetchUser(_option: CommandOptionWithType, query: string): Promise<import("../types").APIUser> | null;
41
+ fetchMember(_option: CommandOptionWithType, query: string, guildId: string): Promise<import("../types").APIGuildMember> | null;
42
+ fetchRole(_option: CommandOptionWithType, query: string, guildId?: string): Promise<import("../types").APIRole> | null;
43
43
  runGlobalMiddlewares(command: Command | ContextMenuCommand | SubCommand | EntryPointCommand, context: CommandContext<{}, never> | MenuCommandContext<any> | EntryPointContext): Promise<false | {
44
44
  error?: string;
45
45
  pass?: boolean;