seyfert 1.3.3 → 1.5.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 (138) hide show
  1. package/README.md +7 -7
  2. package/lib/api/Router.js +3 -1
  3. package/lib/api/Routes/guilds.d.ts +4 -1
  4. package/lib/api/api.js +13 -7
  5. package/lib/builders/Attachment.d.ts +1 -4
  6. package/lib/builders/Attachment.js +4 -4
  7. package/lib/cache/adapters/workeradapter.js +7 -3
  8. package/lib/cache/index.d.ts +6 -2
  9. package/lib/cache/index.js +18 -0
  10. package/lib/cache/resources/bans.d.ts +12 -0
  11. package/lib/cache/resources/bans.js +35 -0
  12. package/lib/cache/resources/default/base.d.ts +1 -2
  13. package/lib/cache/resources/default/guild-based.d.ts +1 -2
  14. package/lib/cache/resources/members.js +4 -4
  15. package/lib/cache/resources/messages.js +8 -6
  16. package/lib/client/base.d.ts +33 -7
  17. package/lib/client/base.js +80 -21
  18. package/lib/client/client.d.ts +18 -6
  19. package/lib/client/client.js +45 -37
  20. package/lib/client/collectors.d.ts +36 -0
  21. package/lib/client/collectors.js +85 -0
  22. package/lib/client/httpclient.d.ts +7 -8
  23. package/lib/client/httpclient.js +96 -17
  24. package/lib/client/oninteractioncreate.d.ts +2 -2
  25. package/lib/client/oninteractioncreate.js +15 -7
  26. package/lib/client/onmessagecreate.d.ts +12 -2
  27. package/lib/client/onmessagecreate.js +105 -82
  28. package/lib/client/workerclient.d.ts +5 -2
  29. package/lib/client/workerclient.js +66 -63
  30. package/lib/collection.d.ts +2 -2
  31. package/lib/collection.js +2 -2
  32. package/lib/commands/applications/chat.d.ts +11 -10
  33. package/lib/commands/applications/chat.js +23 -8
  34. package/lib/commands/applications/chatcontext.d.ts +1 -1
  35. package/lib/commands/applications/chatcontext.js +2 -2
  36. package/lib/commands/applications/menu.d.ts +8 -7
  37. package/lib/commands/applications/menu.js +3 -50
  38. package/lib/commands/applications/menucontext.d.ts +1 -1
  39. package/lib/commands/applications/menucontext.js +3 -3
  40. package/lib/commands/applications/options.d.ts +3 -1
  41. package/lib/commands/applications/shared.d.ts +12 -0
  42. package/lib/commands/basecontext.d.ts +26 -0
  43. package/lib/commands/{basecontex.js → basecontext.js} +24 -0
  44. package/lib/commands/decorators.d.ts +11 -17
  45. package/lib/commands/decorators.js +7 -14
  46. package/lib/commands/handler.d.ts +6 -1
  47. package/lib/commands/handler.js +161 -29
  48. package/lib/common/bot/watcher.d.ts +1 -2
  49. package/lib/common/bot/watcher.js +9 -4
  50. package/lib/common/index.d.ts +1 -0
  51. package/lib/common/index.js +3 -1
  52. package/lib/common/it/formatter.d.ts +155 -0
  53. package/lib/common/it/formatter.js +184 -0
  54. package/lib/common/it/logger.d.ts +1 -1
  55. package/lib/common/it/logger.js +14 -13
  56. package/lib/common/it/utils.d.ts +2 -0
  57. package/lib/common/it/utils.js +21 -9
  58. package/lib/common/shorters/bans.d.ts +43 -0
  59. package/lib/common/shorters/bans.js +78 -0
  60. package/lib/common/shorters/emojis.d.ts +1 -1
  61. package/lib/common/shorters/emojis.js +4 -3
  62. package/lib/common/shorters/interaction.js +9 -7
  63. package/lib/common/shorters/messages.js +2 -2
  64. package/lib/common/shorters/webhook.js +2 -2
  65. package/lib/components/componentcommand.d.ts +22 -0
  66. package/lib/components/{command.js → componentcommand.js} +3 -5
  67. package/lib/components/componentcontext.d.ts +20 -16
  68. package/lib/components/componentcontext.js +27 -9
  69. package/lib/components/handler.d.ts +11 -6
  70. package/lib/components/handler.js +106 -32
  71. package/lib/components/index.d.ts +3 -1
  72. package/lib/components/index.js +3 -1
  73. package/lib/components/modalcommand.d.ts +16 -0
  74. package/lib/components/modalcommand.js +10 -0
  75. package/lib/components/modalcontext.d.ts +104 -0
  76. package/lib/components/modalcontext.js +132 -0
  77. package/lib/events/event.d.ts +4 -3
  78. package/lib/events/handler.d.ts +12 -6
  79. package/lib/events/handler.js +60 -20
  80. package/lib/events/hooks/application_command.d.ts +2 -2
  81. package/lib/events/hooks/auto_moderation.d.ts +5 -5
  82. package/lib/events/hooks/channel.d.ts +5 -5
  83. package/lib/events/hooks/custom.d.ts +3 -3
  84. package/lib/events/hooks/dispatch.d.ts +4 -4
  85. package/lib/events/hooks/entitlement.d.ts +4 -4
  86. package/lib/events/hooks/guild.d.ts +41 -96
  87. package/lib/events/hooks/guild.js +6 -6
  88. package/lib/events/hooks/integration.d.ts +61 -4
  89. package/lib/events/hooks/interactions.d.ts +2 -2
  90. package/lib/events/hooks/invite.d.ts +6 -3
  91. package/lib/events/hooks/message.d.ts +23 -18
  92. package/lib/events/hooks/message.js +1 -1
  93. package/lib/events/hooks/presence.d.ts +11 -3
  94. package/lib/events/hooks/presence.js +2 -2
  95. package/lib/events/hooks/stage.d.ts +7 -13
  96. package/lib/events/hooks/stage.js +2 -2
  97. package/lib/events/hooks/thread.d.ts +21 -10
  98. package/lib/events/hooks/thread.js +2 -2
  99. package/lib/events/hooks/typing.d.ts +3 -2
  100. package/lib/events/hooks/user.d.ts +2 -2
  101. package/lib/events/hooks/user.js +2 -2
  102. package/lib/events/hooks/voice.d.ts +5 -45
  103. package/lib/events/hooks/voice.js +4 -7
  104. package/lib/events/hooks/webhook.d.ts +2 -2
  105. package/lib/index.d.ts +4 -4
  106. package/lib/index.js +11 -5
  107. package/lib/langs/handler.d.ts +4 -1
  108. package/lib/langs/handler.js +3 -3
  109. package/lib/structures/Guild.d.ts +9 -1
  110. package/lib/structures/Guild.js +2 -0
  111. package/lib/structures/GuildBan.d.ts +25 -0
  112. package/lib/structures/GuildBan.js +36 -0
  113. package/lib/structures/GuildEmoji.d.ts +1 -1
  114. package/lib/structures/GuildMember.d.ts +7 -2
  115. package/lib/structures/GuildMember.js +4 -4
  116. package/lib/structures/Interaction.d.ts +4 -3
  117. package/lib/structures/Interaction.js +29 -12
  118. package/lib/structures/Message.d.ts +69 -8
  119. package/lib/structures/Message.js +59 -17
  120. package/lib/structures/Sticker.d.ts +3 -3
  121. package/lib/structures/User.d.ts +1 -0
  122. package/lib/structures/User.js +4 -1
  123. package/lib/structures/VoiceState.d.ts +6 -5
  124. package/lib/structures/VoiceState.js +6 -3
  125. package/lib/structures/channels.d.ts +4 -1
  126. package/lib/structures/channels.js +37 -6
  127. package/lib/structures/extra/functions.js +1 -1
  128. package/lib/websocket/discord/basesocket.d.ts +1 -0
  129. package/lib/websocket/discord/basesocket.js +17 -0
  130. package/lib/websocket/discord/shard.d.ts +1 -0
  131. package/lib/websocket/discord/shard.js +6 -0
  132. package/lib/websocket/discord/sharder.js +10 -3
  133. package/lib/websocket/discord/shared.d.ts +1 -0
  134. package/lib/websocket/discord/workermanager.d.ts +2 -3
  135. package/lib/websocket/discord/workermanager.js +4 -2
  136. package/package.json +7 -7
  137. package/lib/commands/basecontex.d.ts +0 -15
  138. package/lib/components/command.d.ts +0 -24
package/README.md CHANGED
@@ -14,15 +14,15 @@
14
14
 
15
15
  # FAQ
16
16
  ## So, what is `seyfert`?
17
- Seyfert is the ultimate Discord framework! We make easy to interact with the Discord API, big cache control, scalable code and a pretty dev experience.
17
+ Seyfert is the ultimate Discord framework! We make it easy to interact with the Discord API, big cache control, scalable code and a pretty dev experience.
18
18
 
19
- ## Why I should use it?
20
- There are many reasons to use Seyfert, but we cannot put them all in here so there is a few of them!
19
+ ## Why should I use it?
20
+ There are many reasons to use Seyfert, but they dont all fit in this tiny readme, so here is a list of the most awesome reasons!
21
21
 
22
- - **RAM Saver**
22
+ - **Low RAM Usage**
23
23
  - **Latest features**
24
24
  - **Dev experience**
25
- - **24/6 support (Sunday is for going to church)**
25
+ - **24/6 support (Sunday is for church)**
26
26
  - **Written from Scratch**
27
27
  - **Type-safe**
28
28
  - **And many more!!**
@@ -30,12 +30,12 @@ There are many reasons to use Seyfert, but we cannot put them all in here so the
30
30
 
31
31
  ## Installation
32
32
  > [!NOTE]
33
- > You **NEED** Node.js 18>= for this to work, also we recomended Node.js 20 LTS and Bun latest
33
+ > You **NEED** Node.js 18>= for this to work, Node.js 20 LTS and Bun latest are recommended
34
34
  ```sh
35
35
  pnpm add seyfert
36
36
  ```
37
37
 
38
- > You may use your preferred package manager, for this example I am using PNPM since is more efficient.
38
+ > You may use your preferred package manager, for this example PNMP is being used since it’s more efficient.
39
39
 
40
40
  # Useful links
41
41
 
package/lib/api/Router.js CHANGED
@@ -45,7 +45,7 @@ exports.CDNRouter = {
45
45
  return (value, options) => {
46
46
  const lastRoute = `${common_1.CDN_URL}/${route.join('/')}`;
47
47
  let routeResult = lastRoute;
48
- if (typeof value === 'string') {
48
+ if (typeof value === 'string' || typeof value === 'number') {
49
49
  routeResult = `${lastRoute}${value ? `/${value}` : ''}`;
50
50
  return parseCDNURL(routeResult, options);
51
51
  }
@@ -63,6 +63,8 @@ exports.CDNRouter = {
63
63
  function parseCDNURL(route, options = {}) {
64
64
  if (options.forceStatic && route.includes('a_'))
65
65
  options.extension = 'png';
66
+ if (!options.extension && route.includes('a_'))
67
+ options.extension = 'gif';
66
68
  const url = new URL(`${route}.${options.extension || 'png'}`);
67
69
  if (options.size)
68
70
  url.searchParams.set('size', `${options.size}`);
@@ -1,4 +1,4 @@
1
- import type { APIThreadChannel, RESTDeleteAPIAutoModerationRuleResult, RESTDeleteAPIGuildBanResult, RESTDeleteAPIGuildEmojiResult, RESTDeleteAPIGuildIntegrationResult, RESTDeleteAPIGuildMemberResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildResult, RESTDeleteAPIGuildRoleResult, RESTDeleteAPIGuildScheduledEventResult, RESTDeleteAPIGuildStickerResult, RESTDeleteAPIGuildTemplateResult, RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRuleResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPIGuildBanResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildChannelsResult, RESTGetAPIGuildEmojiResult, RESTGetAPIGuildEmojisResult, RESTGetAPIGuildIntegrationsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTGetAPIGuildPreviewResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTGetAPIGuildQuery, RESTGetAPIGuildResult, RESTGetAPIGuildRolesResult, RESTGetAPIGuildScheduledEventQuery, RESTGetAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTGetAPIGuildStickerResult, RESTGetAPIGuildStickersResult, RESTGetAPIGuildTemplatesResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIGuildWelcomeScreenResult, RESTGetAPIGuildWidgetImageQuery, RESTGetAPIGuildWidgetImageResult, RESTGetAPIGuildWidgetJSONResult, RESTGetAPIGuildWidgetSettingsResult, RESTGetAPITemplateResult, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTPatchAPICurrentGuildMemberJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPIGuildResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleResult, RESTPatchAPIGuildScheduledEventJSONBody, RESTPatchAPIGuildScheduledEventResult, RESTPatchAPIGuildStickerJSONBody, RESTPatchAPIGuildStickerResult, RESTPatchAPIGuildTemplateJSONBody, RESTPatchAPIGuildTemplateResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPostAPIGuildScheduledEventJSONBody, RESTPostAPIGuildScheduledEventResult, RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerResult, RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsMFAJSONBody, RESTPostAPIGuildsMFAResult, RESTPostAPIGuildsResult, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberRoleResult, RESTPutAPIGuildTemplateSyncResult } from 'discord-api-types/v10';
1
+ import type { APIThreadChannel, RESTDeleteAPIAutoModerationRuleResult, RESTDeleteAPIGuildBanResult, RESTDeleteAPIGuildEmojiResult, RESTDeleteAPIGuildIntegrationResult, RESTDeleteAPIGuildMemberResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildResult, RESTDeleteAPIGuildRoleResult, RESTDeleteAPIGuildScheduledEventResult, RESTDeleteAPIGuildStickerResult, RESTDeleteAPIGuildTemplateResult, RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRuleResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPIGuildBanResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildChannelsResult, RESTGetAPIGuildEmojiResult, RESTGetAPIGuildEmojisResult, RESTGetAPIGuildIntegrationsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTGetAPIGuildPreviewResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTGetAPIGuildQuery, RESTGetAPIGuildResult, RESTGetAPIGuildRolesResult, RESTGetAPIGuildScheduledEventQuery, RESTGetAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTGetAPIGuildStickerResult, RESTGetAPIGuildStickersResult, RESTGetAPIGuildTemplatesResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIGuildWelcomeScreenResult, RESTGetAPIGuildWidgetImageQuery, RESTGetAPIGuildWidgetImageResult, RESTGetAPIGuildWidgetJSONResult, RESTGetAPIGuildWidgetSettingsResult, RESTGetAPITemplateResult, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTPatchAPICurrentGuildMemberJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPIGuildResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleResult, RESTPatchAPIGuildScheduledEventJSONBody, RESTPatchAPIGuildScheduledEventResult, RESTPatchAPIGuildStickerJSONBody, RESTPatchAPIGuildStickerResult, RESTPatchAPIGuildTemplateJSONBody, RESTPatchAPIGuildTemplateResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPostAPIGuildBulkBanJSONBody, RESTPostAPIGuildBulkBanResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPostAPIGuildScheduledEventJSONBody, RESTPostAPIGuildScheduledEventResult, RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerResult, RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsMFAJSONBody, RESTPostAPIGuildsMFAResult, RESTPostAPIGuildsResult, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberRoleResult, RESTPutAPIGuildTemplateSyncResult } from 'discord-api-types/v10';
2
2
  import type { Identify, OmitInsert } from '../../common';
3
3
  import type { ProxyRequestMethod } from '../Router';
4
4
  import type { RestArguments } from '../api';
@@ -82,6 +82,9 @@ export interface GuildRoutes {
82
82
  delete(args?: RestArguments<ProxyRequestMethod.Delete>): Promise<RESTDeleteAPIGuildBanResult>;
83
83
  };
84
84
  };
85
+ 'bulk-bans': {
86
+ post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIGuildBulkBanJSONBody>): Promise<RESTPostAPIGuildBulkBanResult>;
87
+ };
85
88
  mfa: {
86
89
  post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIGuildsMFAJSONBody>): Promise<RESTPostAPIGuildsMFAResult>;
87
90
  };
package/lib/api/api.js CHANGED
@@ -3,14 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiHandler = void 0;
4
4
  const magic_bytes_js_1 = require("magic-bytes.js");
5
5
  const node_crypto_1 = require("node:crypto");
6
- const promises_1 = require("node:timers/promises");
7
- const node_worker_threads_1 = require("node:worker_threads");
8
6
  const common_1 = require("../common");
9
7
  const functions_1 = require("../structures/extra/functions");
10
8
  const Router_1 = require("./Router");
11
9
  const bucket_1 = require("./bucket");
12
10
  const shared_1 = require("./shared");
13
11
  const utils_1 = require("./utils/utils");
12
+ let parentPort;
13
+ let workerData;
14
14
  class ApiHandler {
15
15
  options;
16
16
  globalBlock = false;
@@ -32,10 +32,16 @@ class ApiHandler {
32
32
  name: '[API]',
33
33
  });
34
34
  }
35
- if (options.workerProxy && !node_worker_threads_1.parentPort)
35
+ const worker_threads = (0, common_1.lazyLoadPackage)('node:worker_threads');
36
+ if (options.workerProxy && !worker_threads?.parentPort)
36
37
  throw new Error('Cannot use workerProxy without a parent.');
37
38
  if (options.workerProxy)
38
39
  this.workerPromises = new Map();
40
+ if (worker_threads) {
41
+ workerData = worker_threads.workerData;
42
+ if (worker_threads.parentPort)
43
+ parentPort = worker_threads.parentPort;
44
+ }
39
45
  }
40
46
  globalUnblock() {
41
47
  this.globalBlock = false;
@@ -53,11 +59,11 @@ class ApiHandler {
53
59
  async request(method, url, { auth = true, ...request } = {}) {
54
60
  if (this.options.workerProxy) {
55
61
  const nonce = this.#randomUUID();
56
- node_worker_threads_1.parentPort.postMessage({
62
+ parentPort.postMessage({
57
63
  method,
58
64
  url,
59
65
  type: 'WORKER_API_REQUEST',
60
- workerId: node_worker_threads_1.workerData.workerId,
66
+ workerId: workerData.workerId,
61
67
  nonce,
62
68
  requestOptions: { auth, ...request },
63
69
  }, request.files
@@ -182,7 +188,7 @@ class ApiHandler {
182
188
  const wait = Math.floor(Math.random() * 1900 + 100);
183
189
  this.debugger?.warn(`Handling a 50X status, retrying in ${wait}ms`);
184
190
  next();
185
- await (0, promises_1.setTimeout)(wait);
191
+ await (0, common_1.delay)(wait);
186
192
  return this.request(method, url, {
187
193
  body: request.body,
188
194
  auth: request.auth,
@@ -204,7 +210,7 @@ class ApiHandler {
204
210
  }
205
211
  this.debugger?.info(`${response.headers.get('x-ratelimit-global') ? 'Global' : 'Unexpected'} 429: ${result}\n${content} ${now} ${route} ${response.status}: ${this.ratelimits.get(route).remaining}/${this.ratelimits.get(route).limit} left | Reset ${retryAfter} (${this.ratelimits.get(route).reset - now}ms left) | Scope ${response.headers.get('x-ratelimit-scope')}`);
206
212
  if (retryAfter) {
207
- await (0, promises_1.setTimeout)(retryAfter);
213
+ await (0, common_1.delay)(retryAfter);
208
214
  next();
209
215
  return this.request(method, url, {
210
216
  body: request.body,
@@ -94,10 +94,7 @@ export declare function resolveFiles(resources: (AttachmentBuilder | RawFile | A
94
94
  */
95
95
  export declare function resolveAttachmentData(data: AttachmentResolvable, type: AttachmentDataType): Promise<{
96
96
  data: AttachmentResolvable;
97
- contentType?: undefined;
98
- } | {
99
- data: Buffer;
100
- contentType: string | null;
97
+ contentType?: string | null;
101
98
  }>;
102
99
  /**
103
100
  * Resolves a base64 data to a data URL.
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.resolveImage = exports.resolveBase64 = exports.resolveAttachmentData = exports.resolveFiles = exports.resolveAttachment = exports.AttachmentBuilder = exports.Attachment = void 0;
7
7
  const node_crypto_1 = require("node:crypto");
8
- const promises_1 = require("node:fs/promises");
9
8
  const node_path_1 = __importDefault(require("node:path"));
10
9
  const __1 = require("..");
11
10
  const Base_1 = require("../structures/extra/Base");
11
+ const node_fs_1 = require("node:fs");
12
12
  class Attachment extends Base_1.Base {
13
13
  data;
14
14
  constructor(client, data) {
@@ -24,7 +24,7 @@ class AttachmentBuilder {
24
24
  * Creates a new Attachment instance.
25
25
  * @param data - The partial attachment data.
26
26
  */
27
- constructor(data = { name: `${(0, node_crypto_1.randomBytes)(8).toString('base64url')}.jpg` }) {
27
+ constructor(data = { name: `${((0, node_crypto_1.randomBytes)?.(8))?.toString('base64url') || 'default'}.jpg` }) {
28
28
  this.data = data;
29
29
  }
30
30
  /**
@@ -163,10 +163,10 @@ async function resolveAttachmentData(data, type) {
163
163
  }
164
164
  case 'path': {
165
165
  const file = node_path_1.default.resolve(data);
166
- const stats = await (0, promises_1.stat)(file);
166
+ const stats = await node_fs_1.promises.stat(file);
167
167
  if (!stats.isFile())
168
168
  return (0, __1.throwError)(`The attachment type has been expressed as ${type.toUpperCase()} but cannot be resolved as one.`);
169
- return { data: await (0, promises_1.readFile)(file) };
169
+ return { data: await node_fs_1.promises.readFile(file) };
170
170
  }
171
171
  case 'buffer': {
172
172
  if (Buffer.isBuffer(data))
@@ -2,17 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WorkerAdapter = void 0;
4
4
  const node_crypto_1 = require("node:crypto");
5
- const node_worker_threads_1 = require("node:worker_threads");
5
+ const common_1 = require("../../common");
6
+ let parentPort;
6
7
  class WorkerAdapter {
7
8
  workerData;
8
9
  isAsync = true;
9
10
  promises = new Map();
10
11
  constructor(workerData) {
11
12
  this.workerData = workerData;
13
+ const worker_threads = (0, common_1.lazyLoadPackage)('node:worker_threads');
14
+ if (worker_threads?.parentPort)
15
+ parentPort = worker_threads.parentPort;
12
16
  }
13
17
  postMessage(body) {
14
- if (node_worker_threads_1.parentPort)
15
- return node_worker_threads_1.parentPort.postMessage(body);
18
+ if (parentPort)
19
+ return parentPort.postMessage(body);
16
20
  return process.send(body);
17
21
  }
18
22
  send(method, ...args) {
@@ -11,6 +11,7 @@ import { StageInstances } from './resources/stage-instances';
11
11
  import { Stickers } from './resources/stickers';
12
12
  import { Threads } from './resources/threads';
13
13
  import { VoiceStates } from './resources/voice-states';
14
+ import { Bans } from './resources/bans';
14
15
  import { GatewayIntentBits, type GatewayDispatchPayload } from 'discord-api-types/v10';
15
16
  import type { InternalOptions, UsingClient } from '../commands';
16
17
  import { Overwrites } from './resources/overwrites';
@@ -20,10 +21,10 @@ export type InferAsyncCache = InternalOptions extends {
20
21
  } ? P : false;
21
22
  export type ReturnCache<T> = If<InferAsyncCache, Promise<T>, T>;
22
23
  export type GuildBased = 'members' | 'voiceStates';
23
- export type GuildRelated = 'emojis' | 'roles' | 'threads' | 'channels' | 'stickers' | 'presences' | 'stageInstances' | 'overwrites' | 'messages';
24
+ export type GuildRelated = 'emojis' | 'roles' | 'threads' | 'channels' | 'stickers' | 'presences' | 'stageInstances' | 'overwrites' | 'messages' | 'bans';
24
25
  export type NonGuildBased = 'users' | 'guilds';
25
26
  export * from './adapters/index';
26
- export type CachedEvents = 'READY' | 'GUILD_CREATE' | 'GUILD_UPDATE' | 'GUILD_DELETE' | 'CHANNEL_CREATE' | 'CHANNEL_UPDATE' | 'CHANNEL_DELETE' | 'GUILD_ROLE_CREATE' | 'GUILD_ROLE_UPDATE' | 'GUILD_ROLE_DELETE' | 'GUILD_EMOJIS_UPDATE' | 'GUILD_STICKERS_UPDATE' | 'GUILD_MEMBER_ADD' | 'GUILD_MEMBER_UPDATE' | 'GUILD_MEMBER_REMOVE' | 'MESSAGE_CREATE' | 'PRESENCE_UPDATE' | 'THREAD_DELETE' | 'THREAD_CREATE' | 'THREAD_UPDATE' | 'USER_UPDATE' | 'VOICE_STATE_UPDATE' | 'STAGE_INSTANCE_CREATE' | 'STAGE_INSTANCE_UPDATE' | 'STAGE_INSTANCE_DELETE';
27
+ export type CachedEvents = 'READY' | 'GUILD_CREATE' | 'GUILD_UPDATE' | 'GUILD_DELETE' | 'CHANNEL_CREATE' | 'CHANNEL_UPDATE' | 'CHANNEL_DELETE' | 'GUILD_ROLE_CREATE' | 'GUILD_ROLE_UPDATE' | 'GUILD_ROLE_DELETE' | 'GUILD_BAN_ADD' | 'GUILD_BAN_REMOVE' | 'GUILD_EMOJIS_UPDATE' | 'GUILD_STICKERS_UPDATE' | 'GUILD_MEMBER_ADD' | 'GUILD_MEMBER_UPDATE' | 'GUILD_MEMBER_REMOVE' | 'MESSAGE_CREATE' | 'PRESENCE_UPDATE' | 'THREAD_DELETE' | 'THREAD_CREATE' | 'THREAD_UPDATE' | 'USER_UPDATE' | 'VOICE_STATE_UPDATE' | 'STAGE_INSTANCE_CREATE' | 'STAGE_INSTANCE_UPDATE' | 'STAGE_INSTANCE_DELETE';
27
28
  export declare class Cache {
28
29
  intents: number;
29
30
  adapter: Adapter;
@@ -41,6 +42,7 @@ export declare class Cache {
41
42
  presences?: Presences;
42
43
  stageInstances?: StageInstances;
43
44
  messages?: Messages;
45
+ bans?: Bans;
44
46
  constructor(intents: number, adapter: Adapter, disabledCache?: (NonGuildBased | GuildBased | GuildRelated)[], client?: UsingClient);
45
47
  flush(): ReturnCache<void>;
46
48
  hasIntent(intent: keyof typeof GatewayIntentBits): boolean;
@@ -52,6 +54,7 @@ export declare class Cache {
52
54
  get hasVoiceStatesIntent(): boolean;
53
55
  get hasPrenseceUpdates(): boolean;
54
56
  get hasDirectMessages(): boolean;
57
+ get hasBansIntent(): boolean;
55
58
  bulkGet(keys: (readonly [
56
59
  NonGuildBased | GuildRelated,
57
60
  string
@@ -74,6 +77,7 @@ export declare class Cache {
74
77
  guild_id: string;
75
78
  })[];
76
79
  threads: import("..").ThreadChannel[];
80
+ bans: import("../structures/GuildBan").GuildBan[];
77
81
  voiceStates: import("..").VoiceState[];
78
82
  stageInstances: (import("discord-api-types/v10").APIStageInstance & {
79
83
  guild_id: string;
@@ -26,6 +26,7 @@ const stage_instances_1 = require("./resources/stage-instances");
26
26
  const stickers_1 = require("./resources/stickers");
27
27
  const threads_1 = require("./resources/threads");
28
28
  const voice_states_1 = require("./resources/voice-states");
29
+ const bans_1 = require("./resources/bans");
29
30
  const v10_1 = require("discord-api-types/v10");
30
31
  const overwrites_1 = require("./resources/overwrites");
31
32
  const messages_1 = require("./resources/messages");
@@ -50,6 +51,7 @@ class Cache {
50
51
  presences;
51
52
  stageInstances;
52
53
  messages;
54
+ bans;
53
55
  constructor(intents, adapter, disabledCache = [], client) {
54
56
  this.intents = intents;
55
57
  this.adapter = adapter;
@@ -96,6 +98,9 @@ class Cache {
96
98
  if (!this.disabledCache.includes('messages')) {
97
99
  this.messages = new messages_1.Messages(this, client);
98
100
  }
101
+ if (!this.disabledCache.includes('bans')) {
102
+ this.bans = new bans_1.Bans(this, client);
103
+ }
99
104
  }
100
105
  /** @internal */
101
106
  __setClient(client) {
@@ -112,6 +117,7 @@ class Cache {
112
117
  this.threads?.__setClient(client);
113
118
  this.stageInstances?.__setClient(client);
114
119
  this.messages?.__setClient(client);
120
+ this.bans?.__setClient(client);
115
121
  }
116
122
  flush() {
117
123
  return this.adapter.flush();
@@ -144,6 +150,9 @@ class Cache {
144
150
  get hasDirectMessages() {
145
151
  return this.hasIntent('DirectMessages');
146
152
  }
153
+ get hasBansIntent() {
154
+ return this.hasIntent('GuildBans');
155
+ }
147
156
  async bulkGet(keys) {
148
157
  const allData = {};
149
158
  for (const [type, id, guildId] of keys) {
@@ -167,6 +176,7 @@ class Cache {
167
176
  case 'users':
168
177
  case 'guilds':
169
178
  case 'overwrites':
179
+ case 'bans':
170
180
  case 'messages':
171
181
  {
172
182
  if (!allData[type]) {
@@ -207,6 +217,7 @@ class Cache {
207
217
  case 'stageInstances':
208
218
  case 'emojis':
209
219
  case 'overwrites':
220
+ case 'bans':
210
221
  case 'messages':
211
222
  {
212
223
  if (!this[type]?.filter(data, id, guildId))
@@ -278,6 +289,7 @@ class Cache {
278
289
  case 'stageInstances':
279
290
  case 'emojis':
280
291
  case 'overwrites':
292
+ case 'bans':
281
293
  case 'messages':
282
294
  {
283
295
  if (!this[type]?.filter(data, id, guildId))
@@ -376,6 +388,12 @@ class Cache {
376
388
  case 'GUILD_ROLE_DELETE':
377
389
  await this.roles?.remove(event.d.role_id, event.d.guild_id);
378
390
  break;
391
+ case 'GUILD_BAN_ADD':
392
+ await this.bans?.set(event.d.user.id, event.d.guild_id, event.d);
393
+ break;
394
+ case 'GUILD_BAN_REMOVE':
395
+ await this.bans?.remove(event.d.user.id, event.d.guild_id);
396
+ break;
379
397
  case 'GUILD_EMOJIS_UPDATE':
380
398
  await this.emojis?.remove(await this.emojis?.keys(event.d.guild_id), event.d.guild_id);
381
399
  await this.emojis?.set(event.d.emojis.map(x => [x.id, x]), event.d.guild_id);
@@ -0,0 +1,12 @@
1
+ import type { APIBan } from 'discord-api-types/v10';
2
+ import type { ReturnCache } from '../..';
3
+ import { GuildBasedResource } from './default/guild-based';
4
+ import { GuildBan } from '../../structures/GuildBan';
5
+ export declare class Bans extends GuildBasedResource {
6
+ namespace: string;
7
+ filter(data: APIBan, id: string, guild_id: string): boolean;
8
+ parse(data: any, key: string, guild_id: string): any;
9
+ get(id: string, guild: string): ReturnCache<GuildBan | undefined>;
10
+ bulk(ids: string[], guild: string): ReturnCache<GuildBan[]>;
11
+ values(guild: string): ReturnCache<GuildBan[]>;
12
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Bans = void 0;
4
+ const common_1 = require("../../common");
5
+ const guild_based_1 = require("./default/guild-based");
6
+ const GuildBan_1 = require("../../structures/GuildBan");
7
+ class Bans extends guild_based_1.GuildBasedResource {
8
+ namespace = 'ban';
9
+ //@ts-expect-error
10
+ filter(data, id, guild_id) {
11
+ return true;
12
+ }
13
+ parse(data, key, guild_id) {
14
+ const { user, ...rest } = super.parse(data, data.user?.id ?? key, guild_id);
15
+ return rest;
16
+ }
17
+ get(id, guild) {
18
+ return (0, common_1.fakePromise)(super.get(id, guild)).then(rawBan => rawBan ? new GuildBan_1.GuildBan(this.client, rawBan, guild) : undefined);
19
+ }
20
+ bulk(ids, guild) {
21
+ return (0, common_1.fakePromise)(super.bulk(ids, guild)).then(bans => bans
22
+ .map(rawBan => {
23
+ return rawBan ? new GuildBan_1.GuildBan(this.client, rawBan, guild) : undefined;
24
+ })
25
+ .filter(Boolean));
26
+ }
27
+ values(guild) {
28
+ return (0, common_1.fakePromise)(super.values(guild)).then(bans => bans
29
+ .map(rawBan => {
30
+ return rawBan ? new GuildBan_1.GuildBan(this.client, rawBan, guild) : undefined;
31
+ })
32
+ .filter(Boolean));
33
+ }
34
+ }
35
+ exports.Bans = Bans;
@@ -1,10 +1,9 @@
1
1
  import type { GatewayIntentBits } from 'discord-api-types/v10';
2
- import type { BaseClient } from '../../../client/base';
3
2
  import type { UsingClient } from '../../../commands';
4
3
  import type { Cache, ReturnCache } from '../../index';
5
4
  export declare class BaseResource<T = any> {
6
5
  protected cache: Cache;
7
- client: BaseClient;
6
+ client: UsingClient;
8
7
  namespace: string;
9
8
  constructor(cache: Cache, client?: UsingClient);
10
9
  filter(data: any, id: string): boolean;
@@ -1,10 +1,9 @@
1
1
  import type { GatewayIntentBits } from 'discord-api-types/v10';
2
- import type { BaseClient } from '../../../client/base';
3
2
  import type { UsingClient } from '../../../commands';
4
3
  import type { Cache, ReturnCache } from '../../index';
5
4
  export declare class GuildBasedResource<T = any> {
6
5
  protected cache: Cache;
7
- client: BaseClient;
6
+ client: UsingClient;
8
7
  namespace: string;
9
8
  constructor(cache: Cache, client?: UsingClient);
10
9
  filter(data: any, id: string, guild_id: string): boolean;
@@ -18,17 +18,17 @@ class Members extends guild_based_1.GuildBasedResource {
18
18
  return (0, common_1.fakePromise)(super.get(id, guild)).then(rawMember => (0, common_1.fakePromise)(this.client.cache.users?.get(id)).then(user => rawMember && user ? new structures_1.GuildMember(this.client, rawMember, user, guild) : undefined));
19
19
  }
20
20
  bulk(ids, guild) {
21
- return (0, common_1.fakePromise)(super.bulk(ids, guild)).then(members => (0, common_1.fakePromise)(this.client.cache.users?.bulk(ids) ?? []).then(users => members
21
+ return (0, common_1.fakePromise)(super.bulk(ids, guild)).then(members => (0, common_1.fakePromise)(this.client.cache.users?.bulk(ids)).then(users => members
22
22
  .map(rawMember => {
23
- const user = users.find(x => x.id === rawMember.id);
23
+ const user = users?.find(x => x.id === rawMember.id);
24
24
  return user ? new structures_1.GuildMember(this.client, rawMember, user, guild) : undefined;
25
25
  })
26
26
  .filter(Boolean)));
27
27
  }
28
28
  values(guild) {
29
- return (0, common_1.fakePromise)(super.values(guild)).then(members => (0, common_1.fakePromise)(this.client.cache.users?.values() ?? []).then(users => members
29
+ return (0, common_1.fakePromise)(super.values(guild)).then(members => (0, common_1.fakePromise)(this.client.cache.users?.values()).then(users => members
30
30
  .map(rawMember => {
31
- const user = users.find(x => x.id === rawMember.id);
31
+ const user = users?.find(x => x.id === rawMember.id);
32
32
  return user ? new structures_1.GuildMember(this.client, rawMember, user, rawMember.guild_id) : undefined;
33
33
  })
34
34
  .filter(Boolean)));
@@ -18,19 +18,21 @@ class Messages extends guild_related_1.GuildRelatedResource {
18
18
  }
19
19
  get(id) {
20
20
  return (0, common_1.fakePromise)(super.get(id)).then(rawMessage => {
21
- const user = this.cache.users && rawMessage?.user_id
22
- ? this.cache.adapter.get(this.cache.users.hashId(rawMessage.user_id))
21
+ return this.cache.users && rawMessage?.user_id
22
+ ? (0, common_1.fakePromise)(this.cache.adapter.get(this.cache.users.hashId(rawMessage.user_id))).then(user => {
23
+ return user ? new structures_1.Message(this.client, { ...rawMessage, author: user }) : undefined;
24
+ })
23
25
  : undefined;
24
- return user ? new structures_1.Message(this.client, { ...rawMessage, author: user }) : undefined;
25
26
  });
26
27
  }
27
28
  bulk(ids) {
28
29
  return (0, common_1.fakePromise)(super.bulk(ids)).then(messages => messages
29
30
  .map(rawMessage => {
30
- const user = this.cache.users && rawMessage.user_id
31
- ? this.cache.adapter.get(this.cache.users.hashId(rawMessage.user_id))
31
+ return this.cache.users && rawMessage?.user_id
32
+ ? (0, common_1.fakePromise)(this.cache.adapter.get(this.cache.users.hashId(rawMessage.user_id))).then(user => {
33
+ return user ? new structures_1.Message(this.client, { ...rawMessage, author: user }) : undefined;
34
+ })
32
35
  : undefined;
33
- return user ? new structures_1.Message(this.client, { ...rawMessage, author: user }) : undefined;
34
36
  })
35
37
  .filter(Boolean));
36
38
  }
@@ -1,15 +1,17 @@
1
1
  import { ApiHandler } from '../api';
2
2
  import type { Adapter } from '../cache';
3
3
  import { Cache } from '../cache';
4
- import type { Command, RegisteredMiddlewares } from '../commands';
4
+ import type { Command, ExtraProps, RegisteredMiddlewares } from '../commands';
5
5
  import { type InferWithPrefix, type MiddlewareContext } from '../commands/applications/shared';
6
6
  import { CommandHandler } from '../commands/handler';
7
7
  import { ChannelShorter, EmojiShorter, GuildShorter, InteractionShorter, Logger, MemberShorter, MessageShorter, ReactionShorter, RoleShorter, TemplateShorter, ThreadShorter, UsersShorter, WebhookShorter, type MakeRequired } from '../common';
8
- import type { LocaleString } from 'discord-api-types/rest/v10';
9
- import type { DeepPartial, IntentStrings, OmitInsert, When } from '../common/types/util';
8
+ import type { LocaleString, RESTPostAPIChannelMessageJSONBody } from 'discord-api-types/rest/v10';
9
+ import type { Awaitable, DeepPartial, IntentStrings, OmitInsert, When } from '../common/types/util';
10
10
  import { ComponentHandler } from '../components/handler';
11
11
  import { LangsHandler } from '../langs/handler';
12
- import type { ChatInputCommandInteraction, ComponentInteraction, Message, MessageCommandInteraction, UserCommandInteraction } from '../structures';
12
+ import type { ChatInputCommandInteraction, ComponentInteraction, Message, MessageCommandInteraction, ModalSubmitInteraction, UserCommandInteraction } from '../structures';
13
+ import type { ComponentCommand, ModalCommand } from '../components';
14
+ import { BanShorter } from '../common/shorters/bans';
13
15
  export declare class BaseClient {
14
16
  rest: ApiHandler;
15
17
  cache: Cache;
@@ -24,6 +26,7 @@ export declare class BaseClient {
24
26
  reactions: ReactionShorter;
25
27
  emojis: EmojiShorter;
26
28
  threads: ThreadShorter;
29
+ bans: BanShorter;
27
30
  interactions: InteractionShorter;
28
31
  debugger?: Logger;
29
32
  logger: Logger;
@@ -35,17 +38,18 @@ export declare class BaseClient {
35
38
  middlewares?: Record<string, MiddlewareContext>;
36
39
  protected static assertString(value: unknown, message?: string): asserts value is string;
37
40
  protected static getBotIdFromToken(token: string): string;
38
- options: BaseClientOptions | undefined;
41
+ options: BaseClientOptions;
39
42
  constructor(options?: BaseClientOptions);
40
43
  set botId(id: string);
41
44
  get botId(): string;
42
45
  set applicationId(id: string);
43
46
  get applicationId(): string;
44
47
  get proxy(): import("../api").APIRoutes;
45
- setServices({ rest, cache, langs, middlewares, handlers }: ServicesOptions): void;
48
+ setServices({ rest, cache, langs, middlewares, handlers, }: ServicesOptions): void;
46
49
  protected execute(..._options: unknown[]): Promise<void>;
47
50
  start(options?: Pick<DeepPartial<StartOptions>, 'langsDir' | 'commandsDir' | 'connection' | 'token' | 'componentsDir'>): Promise<void>;
48
51
  protected onPacket(..._packet: unknown[]): Promise<void>;
52
+ shouldUploadCommands(cachePath: string): Promise<boolean>;
49
53
  uploadCommands(applicationId?: string): Promise<void>;
50
54
  loadCommands(dir?: string): Promise<void>;
51
55
  loadComponents(dir?: string): Promise<void>;
@@ -66,7 +70,7 @@ export declare class BaseClient {
66
70
  }>;
67
71
  }
68
72
  export interface BaseClientOptions {
69
- context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ComponentInteraction | When<InferWithPrefix, Message, never>) => {};
73
+ context?: (interaction: ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ComponentInteraction | ModalSubmitInteraction | When<InferWithPrefix, Message, never>) => {};
70
74
  globalMiddlewares?: readonly (keyof RegisteredMiddlewares)[];
71
75
  commands?: {
72
76
  defaults?: {
@@ -77,8 +81,29 @@ export interface BaseClientOptions {
77
81
  onMiddlewaresError?: Command['onMiddlewaresError'];
78
82
  onOptionsError?: Command['onOptionsError'];
79
83
  onAfterRun?: Command['onAfterRun'];
84
+ props?: ExtraProps;
80
85
  };
81
86
  };
87
+ components?: {
88
+ defaults?: {
89
+ onRunError?: ComponentCommand['onRunError'];
90
+ onInternalError?: ComponentCommand['onInternalError'];
91
+ onMiddlewaresError?: ComponentCommand['onMiddlewaresError'];
92
+ onAfterRun?: ComponentCommand['onAfterRun'];
93
+ };
94
+ };
95
+ modals?: {
96
+ defaults?: {
97
+ onRunError?: ModalCommand['onRunError'];
98
+ onInternalError?: ModalCommand['onInternalError'];
99
+ onMiddlewaresError?: ModalCommand['onMiddlewaresError'];
100
+ onAfterRun?: ModalCommand['onAfterRun'];
101
+ };
102
+ };
103
+ allowedMentions?: Omit<NonNullable<RESTPostAPIChannelMessageJSONBody['allowed_mentions']>, 'parse'> & {
104
+ parse?: ('everyone' | 'roles' | 'users')[];
105
+ };
106
+ getRC?(): Awaitable<InternalRuntimeConfig | InternalRuntimeConfigHTTP>;
82
107
  }
83
108
  export interface StartOptions {
84
109
  eventsDir: string;
@@ -91,6 +116,7 @@ export interface StartOptions {
91
116
  httpConnection: {
92
117
  publicKey: string;
93
118
  port: number;
119
+ useUWS: boolean;
94
120
  };
95
121
  token: string;
96
122
  }