seyfert 4.4.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/README.md +7 -1
  2. package/lib/api/Routes/cdn.d.ts +2 -2
  3. package/lib/api/Routes/guilds.d.ts +2 -2
  4. package/lib/api/Routes/invites.d.ts +2 -2
  5. package/lib/api/api.d.ts +20 -8
  6. package/lib/api/api.js +198 -44
  7. package/lib/api/shared.d.ts +30 -1
  8. package/lib/api/utils/constants.d.ts +1 -1
  9. package/lib/api/utils/constants.js +1 -1
  10. package/lib/api/utils/utils.d.ts +2 -1
  11. package/lib/api/utils/utils.js +1 -1
  12. package/lib/builders/Attachment.d.ts +1 -1
  13. package/lib/builders/Attachment.js +30 -8
  14. package/lib/builders/MediaGallery.d.ts +2 -2
  15. package/lib/builders/MediaGallery.js +10 -0
  16. package/lib/builders/Modal.d.ts +18 -8
  17. package/lib/builders/Modal.js +36 -7
  18. package/lib/builders/Poll.js +18 -0
  19. package/lib/builders/RadioGroup.d.ts +4 -3
  20. package/lib/builders/RadioGroup.js +24 -3
  21. package/lib/builders/SelectMenu.d.ts +8 -6
  22. package/lib/builders/SelectMenu.js +24 -3
  23. package/lib/builders/types.d.ts +3 -2
  24. package/lib/cache/adapters/default.d.ts +1 -1
  25. package/lib/cache/adapters/default.js +23 -26
  26. package/lib/cache/adapters/limited.d.ts +1 -0
  27. package/lib/cache/adapters/limited.js +47 -33
  28. package/lib/cache/index.d.ts +19 -25
  29. package/lib/cache/index.js +58 -6
  30. package/lib/cache/resources/bans.d.ts +1 -1
  31. package/lib/cache/resources/bans.js +4 -4
  32. package/lib/cache/resources/channels.d.ts +1 -1
  33. package/lib/cache/resources/channels.js +4 -4
  34. package/lib/cache/resources/default/base.d.ts +1 -1
  35. package/lib/cache/resources/default/base.js +8 -8
  36. package/lib/cache/resources/default/guild-based.d.ts +5 -5
  37. package/lib/cache/resources/default/guild-based.js +29 -16
  38. package/lib/cache/resources/default/guild-related.d.ts +5 -5
  39. package/lib/cache/resources/default/guild-related.js +14 -14
  40. package/lib/cache/resources/emojis.d.ts +1 -1
  41. package/lib/cache/resources/emojis.js +4 -4
  42. package/lib/cache/resources/guilds.js +28 -15
  43. package/lib/cache/resources/members.d.ts +1 -1
  44. package/lib/cache/resources/members.js +6 -6
  45. package/lib/cache/resources/messages.d.ts +7 -2
  46. package/lib/cache/resources/messages.js +43 -20
  47. package/lib/cache/resources/overwrites.d.ts +1 -1
  48. package/lib/cache/resources/overwrites.js +5 -8
  49. package/lib/cache/resources/roles.d.ts +1 -1
  50. package/lib/cache/resources/roles.js +4 -4
  51. package/lib/cache/resources/stickers.d.ts +1 -1
  52. package/lib/cache/resources/stickers.js +4 -4
  53. package/lib/cache/resources/users.js +4 -4
  54. package/lib/cache/resources/voice-states.d.ts +1 -1
  55. package/lib/cache/resources/voice-states.js +4 -4
  56. package/lib/client/base.d.ts +83 -24
  57. package/lib/client/base.js +594 -39
  58. package/lib/client/client.d.ts +29 -4
  59. package/lib/client/client.js +38 -13
  60. package/lib/client/collectors.d.ts +9 -8
  61. package/lib/client/collectors.js +19 -52
  62. package/lib/client/httpclient.d.ts +3 -0
  63. package/lib/client/index.d.ts +3 -1
  64. package/lib/client/index.js +4 -0
  65. package/lib/client/intents.d.ts +3 -0
  66. package/lib/client/intents.js +9 -0
  67. package/lib/client/plugins/api.d.ts +4 -0
  68. package/lib/client/plugins/api.js +550 -0
  69. package/lib/client/plugins/errors.d.ts +25 -0
  70. package/lib/client/plugins/errors.js +79 -0
  71. package/lib/client/plugins/order.d.ts +10 -0
  72. package/lib/client/plugins/order.js +32 -0
  73. package/lib/client/plugins/registry.d.ts +273 -0
  74. package/lib/client/plugins/registry.js +868 -0
  75. package/lib/client/plugins/shared.d.ts +23 -0
  76. package/lib/client/plugins/shared.js +193 -0
  77. package/lib/client/plugins/types.d.ts +398 -0
  78. package/lib/client/plugins/types.js +8 -0
  79. package/lib/client/plugins.d.ts +78 -0
  80. package/lib/client/plugins.js +558 -0
  81. package/lib/client/transformers.d.ts +33 -33
  82. package/lib/client/workerclient.d.ts +11 -2
  83. package/lib/client/workerclient.js +33 -22
  84. package/lib/collection.d.ts +10 -8
  85. package/lib/collection.js +19 -25
  86. package/lib/commands/applications/chat.d.ts +20 -18
  87. package/lib/commands/applications/chat.js +39 -14
  88. package/lib/commands/applications/chatcontext.d.ts +23 -15
  89. package/lib/commands/applications/chatcontext.js +23 -2
  90. package/lib/commands/applications/entryPoint.d.ts +4 -3
  91. package/lib/commands/applications/entryPoint.js +1 -1
  92. package/lib/commands/applications/entrycontext.d.ts +7 -9
  93. package/lib/commands/applications/entrycontext.js +3 -1
  94. package/lib/commands/applications/menu.d.ts +4 -3
  95. package/lib/commands/applications/menucontext.d.ts +7 -9
  96. package/lib/commands/applications/menucontext.js +3 -1
  97. package/lib/commands/applications/options.d.ts +23 -23
  98. package/lib/commands/applications/shared.d.ts +39 -17
  99. package/lib/commands/decorators.d.ts +50 -38
  100. package/lib/commands/decorators.js +15 -5
  101. package/lib/commands/handle.d.ts +19 -8
  102. package/lib/commands/handle.js +224 -143
  103. package/lib/commands/handler.d.ts +21 -8
  104. package/lib/commands/handler.js +157 -69
  105. package/lib/commands/index.d.ts +1 -0
  106. package/lib/commands/optionresolver.d.ts +2 -2
  107. package/lib/common/it/colors.js +12 -2
  108. package/lib/common/it/error.d.ts +9 -0
  109. package/lib/common/it/error.js +8 -0
  110. package/lib/common/it/fake-promise.d.ts +4 -0
  111. package/lib/common/it/fake-promise.js +10 -0
  112. package/lib/common/it/formatter.d.ts +14 -11
  113. package/lib/common/it/formatter.js +4 -3
  114. package/lib/common/it/logger.d.ts +7 -1
  115. package/lib/common/it/logger.js +24 -6
  116. package/lib/common/it/utils.d.ts +6 -8
  117. package/lib/common/it/utils.js +44 -42
  118. package/lib/common/shorters/application.d.ts +3 -3
  119. package/lib/common/shorters/application.js +3 -2
  120. package/lib/common/shorters/bans.d.ts +8 -4
  121. package/lib/common/shorters/bans.js +13 -5
  122. package/lib/common/shorters/channels.d.ts +4 -4
  123. package/lib/common/shorters/channels.js +4 -4
  124. package/lib/common/shorters/emojis.js +1 -0
  125. package/lib/common/shorters/guilds.d.ts +8 -8
  126. package/lib/common/shorters/guilds.js +14 -31
  127. package/lib/common/shorters/interaction.d.ts +1 -1
  128. package/lib/common/shorters/invites.d.ts +201 -201
  129. package/lib/common/shorters/members.d.ts +7 -7
  130. package/lib/common/shorters/members.js +13 -14
  131. package/lib/common/shorters/messages.d.ts +2 -2
  132. package/lib/common/shorters/soundboard.d.ts +5 -5
  133. package/lib/common/shorters/users.d.ts +1 -1
  134. package/lib/common/shorters/webhook.d.ts +3 -2
  135. package/lib/common/shorters/webhook.js +0 -7
  136. package/lib/common/types/options.d.ts +4 -0
  137. package/lib/common/types/util.d.ts +8 -0
  138. package/lib/common/types/write.d.ts +2 -1
  139. package/lib/components/BaseSelectMenuComponent.d.ts +1 -1
  140. package/lib/components/BaseSelectMenuComponent.js +1 -1
  141. package/lib/components/ButtonComponent.d.ts +3 -3
  142. package/lib/components/ChannelSelectMenuComponent.d.ts +2 -2
  143. package/lib/components/File.d.ts +1 -1
  144. package/lib/components/MediaGallery.d.ts +1 -1
  145. package/lib/components/MentionableSelectMenuComponent.d.ts +1 -1
  146. package/lib/components/RoleSelectMenuComponent.d.ts +1 -1
  147. package/lib/components/Separator.d.ts +1 -1
  148. package/lib/components/StringSelectMenuComponent.d.ts +1 -1
  149. package/lib/components/TextInputComponent.d.ts +1 -1
  150. package/lib/components/Thumbnail.d.ts +1 -1
  151. package/lib/components/UserSelectMenuComponent.d.ts +1 -1
  152. package/lib/components/componentcommand.d.ts +8 -7
  153. package/lib/components/componentcontext.d.ts +24 -36
  154. package/lib/components/componentcontext.js +7 -17
  155. package/lib/components/handler.d.ts +17 -7
  156. package/lib/components/handler.js +108 -49
  157. package/lib/components/index.d.ts +1 -0
  158. package/lib/components/index.js +1 -0
  159. package/lib/components/interactioncontext.d.ts +45 -0
  160. package/lib/components/interactioncontext.js +93 -0
  161. package/lib/components/modalcommand.d.ts +5 -4
  162. package/lib/components/modalcontext.d.ts +39 -20
  163. package/lib/components/modalcontext.js +59 -6
  164. package/lib/events/event.d.ts +9 -3
  165. package/lib/events/handler.d.ts +51 -6
  166. package/lib/events/handler.js +165 -36
  167. package/lib/events/hooks/application_command.d.ts +1 -1
  168. package/lib/events/hooks/auto_moderation.d.ts +2 -2
  169. package/lib/events/hooks/guild.d.ts +150 -150
  170. package/lib/events/hooks/interactions.d.ts +1 -1
  171. package/lib/events/hooks/invite.d.ts +20 -20
  172. package/lib/events/hooks/message.d.ts +27 -27
  173. package/lib/events/hooks/presence.d.ts +11 -11
  174. package/lib/events/hooks/soundboard.d.ts +6 -6
  175. package/lib/events/hooks/stage.d.ts +2 -2
  176. package/lib/events/hooks/subscriptions.d.ts +3 -3
  177. package/lib/events/hooks/thread.d.ts +30 -30
  178. package/lib/events/hooks/voice.d.ts +3 -4
  179. package/lib/events/hooks/voice.js +2 -1
  180. package/lib/events/utils.d.ts +4 -0
  181. package/lib/events/utils.js +59 -0
  182. package/lib/index.d.ts +9 -4
  183. package/lib/index.js +14 -8
  184. package/lib/langs/handler.d.ts +14 -11
  185. package/lib/langs/handler.js +46 -9
  186. package/lib/langs/router.d.ts +10 -3
  187. package/lib/structures/Application.d.ts +1 -1
  188. package/lib/structures/Emoji.d.ts +3 -3
  189. package/lib/structures/Emoji.js +2 -2
  190. package/lib/structures/Guild.d.ts +154 -154
  191. package/lib/structures/GuildBan.d.ts +4 -4
  192. package/lib/structures/GuildBan.js +3 -3
  193. package/lib/structures/GuildMember.d.ts +7 -7
  194. package/lib/structures/GuildMember.js +28 -7
  195. package/lib/structures/GuildRole.d.ts +1 -1
  196. package/lib/structures/GuildRole.js +2 -2
  197. package/lib/structures/Interaction.d.ts +11 -9
  198. package/lib/structures/Interaction.js +33 -12
  199. package/lib/structures/Message.d.ts +21 -14
  200. package/lib/structures/Message.js +29 -14
  201. package/lib/structures/User.d.ts +1 -1
  202. package/lib/structures/VoiceState.d.ts +4 -0
  203. package/lib/structures/VoiceState.js +13 -1
  204. package/lib/structures/Webhook.d.ts +9 -1
  205. package/lib/structures/Webhook.js +4 -1
  206. package/lib/structures/channels.d.ts +148 -134
  207. package/lib/structures/channels.js +27 -26
  208. package/lib/structures/extra/BitField.d.ts +4 -4
  209. package/lib/structures/extra/BitField.js +20 -4
  210. package/lib/structures/extra/DiscordBase.js +1 -1
  211. package/lib/structures/extra/Permissions.d.ts +2 -4
  212. package/lib/structures/extra/Permissions.js +1 -17
  213. package/lib/types/payloads/_interactions/responses.d.ts +2 -2
  214. package/lib/types/payloads/components.d.ts +4 -4
  215. package/lib/websocket/SharedTypes.d.ts +4 -4
  216. package/lib/websocket/constants/index.d.ts +1 -1
  217. package/lib/websocket/constants/index.js +3 -2
  218. package/lib/websocket/discord/events/memberUpdate.js +2 -2
  219. package/lib/websocket/discord/heartbeater.d.ts +1 -0
  220. package/lib/websocket/discord/heartbeater.js +7 -0
  221. package/lib/websocket/discord/shard.d.ts +2 -2
  222. package/lib/websocket/discord/shard.js +16 -14
  223. package/lib/websocket/discord/sharder.d.ts +8 -7
  224. package/lib/websocket/discord/sharder.js +26 -6
  225. package/lib/websocket/discord/shared.d.ts +19 -6
  226. package/lib/websocket/discord/socket/custom.js +5 -0
  227. package/lib/websocket/discord/worker.d.ts +1 -0
  228. package/lib/websocket/discord/worker.js +2 -0
  229. package/lib/websocket/discord/workermanager.d.ts +25 -11
  230. package/lib/websocket/discord/workermanager.js +41 -10
  231. package/package.json +13 -17
@@ -1,6 +1,7 @@
1
1
  import { type GuildMemberStructure, type GuildRoleStructure, type VoiceStateStructure } from '../../client/transformers';
2
2
  import { PermissionsBitField } from '../../structures/extra/Permissions';
3
- import { type APIGuildMember, type RESTGetAPIGuildMembersQuery, type RESTGetAPIGuildMembersSearchQuery, type RESTPatchAPICurrentGuildMemberJSONBody, type RESTPatchAPIGuildMemberJSONBody, type RESTPutAPIGuildBanJSONBody, type RESTPutAPIGuildMemberJSONBody } from '../../types';
3
+ import { type APIGuildMember, type RESTGetAPIGuildMembersQuery, type RESTGetAPIGuildMembersSearchQuery, type RESTPatchAPICurrentGuildMemberJSONBody, type RESTPatchAPIGuildMemberJSONBody, type RESTPutAPIGuildMemberJSONBody } from '../../types';
4
+ import type { BanOptions } from '../types/options';
4
5
  import type { GuildMemberResolvable } from '../types/resolvables';
5
6
  import { BaseShorter } from './base';
6
7
  export declare class MemberShorter extends BaseShorter {
@@ -17,7 +18,7 @@ export declare class MemberShorter extends BaseShorter {
17
18
  * @param query The query parameters for searching members.
18
19
  * @returns A Promise that resolves to an array of matched members.
19
20
  */
20
- search(guildId: string, query?: RESTGetAPIGuildMembersSearchQuery): Promise<GuildMemberStructure[]>;
21
+ search(guildId: string, query: RESTGetAPIGuildMembersSearchQuery): Promise<GuildMemberStructure[]>;
21
22
  /**
22
23
  * Unbans a member from the guild.
23
24
  * @param guildId The ID of the guild.
@@ -29,10 +30,9 @@ export declare class MemberShorter extends BaseShorter {
29
30
  * Bans a member from the guild.
30
31
  * @param guildId The ID of the guild.
31
32
  * @param memberId The ID of the member to ban.
32
- * @param body The request body for banning the member.
33
- * @param reason The reason for banning the member.
33
+ * @param options The options for banning the member.
34
34
  */
35
- ban(guildId: string, memberId: string, body?: RESTPutAPIGuildBanJSONBody, reason?: string): Promise<void>;
35
+ ban(guildId: string, memberId: string, options?: BanOptions): Promise<void>;
36
36
  /**
37
37
  * Kicks a member from the guild.
38
38
  * @param guildId The ID of the guild.
@@ -91,7 +91,7 @@ export declare class MemberShorter extends BaseShorter {
91
91
  listRoles(guildId: string, memberId: string, force?: boolean): Promise<GuildRoleStructure[]>;
92
92
  sortRoles(guildId: string, memberId: string, force?: boolean): Promise<GuildRoleStructure[]>;
93
93
  permissions(guildId: string, memberId: string, force?: boolean): Promise<PermissionsBitField>;
94
- presence(memberId: string): import("../../cache").ReturnCache<(Omit<import("../../types").GatewayPresenceUpdate, "user"> & {
94
+ presence(memberId: string): import("../..").ReturnCache<(Omit<import("../..").GatewayPresenceUpdate, "user"> & {
95
95
  id: string;
96
96
  user_id: string;
97
97
  } & {
@@ -102,7 +102,7 @@ export declare class MemberShorter extends BaseShorter {
102
102
  * Timeouts a member from the guild.
103
103
  * @param guildId The ID of the guild.
104
104
  * @param memberId The ID of the member to timeout.
105
- * @param time The time in seconds to timeout the member for.
105
+ * @param time The time in milliseconds to timeout the member for.
106
106
  * @param reason The reason for the timeout.
107
107
  */
108
108
  timeout(guildId: string, memberId: string, time: number | null, reason?: string): Promise<GuildMemberStructure>;
@@ -5,6 +5,7 @@ const cache_1 = require("../../cache");
5
5
  const transformers_1 = require("../../client/transformers");
6
6
  const Permissions_1 = require("../../structures/extra/Permissions");
7
7
  const types_1 = require("../../types");
8
+ const bans_1 = require("./bans");
8
9
  const base_1 = require("./base");
9
10
  class MemberShorter extends base_1.BaseShorter {
10
11
  /**
@@ -57,11 +58,10 @@ class MemberShorter extends base_1.BaseShorter {
57
58
  * Bans a member from the guild.
58
59
  * @param guildId The ID of the guild.
59
60
  * @param memberId The ID of the member to ban.
60
- * @param body The request body for banning the member.
61
- * @param reason The reason for banning the member.
61
+ * @param options The options for banning the member.
62
62
  */
63
- async ban(guildId, memberId, body, reason) {
64
- await this.client.proxy.guilds(guildId).bans(memberId).put({ reason, body });
63
+ async ban(guildId, memberId, options) {
64
+ await this.client.proxy.guilds(guildId).bans(memberId).put((0, bans_1.resolveBanOptions)(options));
65
65
  await this.client.cache.members?.removeIfNI('GuildModeration', memberId, guildId);
66
66
  }
67
67
  /**
@@ -83,8 +83,8 @@ class MemberShorter extends base_1.BaseShorter {
83
83
  * @returns A Promise that resolves to the edited member.
84
84
  */
85
85
  async edit(guildId, memberId, body, reason) {
86
- memberId = memberId === this.client.botId && 'nick' in body ? '@me' : memberId;
87
- const member = await this.client.proxy.guilds(guildId).members(memberId).patch({ body, reason });
86
+ const apiMemberId = memberId === this.client.botId && 'nick' in body ? '@me' : memberId;
87
+ const member = await this.client.proxy.guilds(guildId).members(apiMemberId).patch({ body, reason });
88
88
  await this.client.cache.members?.setIfNI(cache_1.CacheFrom.Rest, 'GuildMembers', memberId, guildId, member);
89
89
  return transformers_1.Transformers.GuildMember(this.client, member, member.user, guildId);
90
90
  }
@@ -136,13 +136,12 @@ class MemberShorter extends base_1.BaseShorter {
136
136
  * @returns A Promise that resolves to an array of listed members.
137
137
  */
138
138
  async list(guildId, query, force = false) {
139
- let members;
140
139
  if (!force) {
141
- members = (await this.client.cache.members?.values(guildId)) ?? [];
142
- if (members.length)
143
- return members;
140
+ const cachedMembers = (await this.client.cache.members?.values(guildId)) ?? [];
141
+ if (cachedMembers.length)
142
+ return cachedMembers;
144
143
  }
145
- members = await this.client.proxy.guilds(guildId).members.get({
144
+ const members = await this.client.proxy.guilds(guildId).members.get({
146
145
  query,
147
146
  });
148
147
  await this.client.cache.members?.set(cache_1.CacheFrom.Rest, members.map(x => [x.user.id, x]), guildId);
@@ -170,7 +169,7 @@ class MemberShorter extends base_1.BaseShorter {
170
169
  if (!force) {
171
170
  const member = await this.client.cache.members?.get(memberId, guildId);
172
171
  if (member) {
173
- const roles = (await this.client.cache.roles?.bulk(member.roles.keys)) ?? [];
172
+ const roles = (await this.client.cache.roles?.bulk([...member.roles.keys])) ?? [];
174
173
  if (roles.length)
175
174
  return roles;
176
175
  }
@@ -205,12 +204,12 @@ class MemberShorter extends base_1.BaseShorter {
205
204
  * Timeouts a member from the guild.
206
205
  * @param guildId The ID of the guild.
207
206
  * @param memberId The ID of the member to timeout.
208
- * @param time The time in seconds to timeout the member for.
207
+ * @param time The time in milliseconds to timeout the member for.
209
208
  * @param reason The reason for the timeout.
210
209
  */
211
210
  timeout(guildId, memberId, time, reason) {
212
211
  return this.edit(guildId, memberId, {
213
- communication_disabled_until: time ? new Date(Date.now() + time * 1000).toISOString() : null,
212
+ communication_disabled_until: time === null ? null : new Date(Date.now() + time).toISOString(),
214
213
  }, reason);
215
214
  }
216
215
  /**
@@ -8,7 +8,7 @@ export declare class MessageShorter extends BaseShorter {
8
8
  edit(messageId: string, channelId: string, { files, ...body }: MessageUpdateBodyRequest): Promise<MessageStructure>;
9
9
  crosspost(messageId: string, channelId: string, reason?: string): Promise<MessageStructure>;
10
10
  delete(messageId: string, channelId: string, reason?: string): Promise<void>;
11
- raw(messageId: string, channelId: string, force?: boolean): Promise<import("../../types").APIMessage | import("../../cache/resources/messages").APIMessageResource>;
11
+ raw(messageId: string, channelId: string, force?: boolean): Promise<import("../..").APIMessage | import("../../cache/resources/messages").APIMessageResource>;
12
12
  fetch(messageId: string, channelId: string, force?: boolean): Promise<MessageStructure>;
13
13
  purge(messages: string[], channelId: string, reason?: string): Promise<void | undefined>;
14
14
  thread(channelId: string, messageId: string, options: RESTPostAPIChannelMessagesThreadsJSONBody & {
@@ -16,5 +16,5 @@ export declare class MessageShorter extends BaseShorter {
16
16
  }): Promise<ThreadChannelStructure>;
17
17
  endPoll(channelId: string, messageId: string): Promise<MessageStructure>;
18
18
  getAnswerVoters(channelId: string, messageId: string, answerId: ValidAnswerId): Promise<UserStructure[]>;
19
- list(channelId: string, fetchOptions: RESTGetAPIChannelMessagesQuery): Promise<MessageStructure[]>;
19
+ list(channelId: string, fetchOptions?: RESTGetAPIChannelMessagesQuery): Promise<MessageStructure[]>;
20
20
  }
@@ -1,11 +1,11 @@
1
1
  import type { RESTPatchAPIGuildSoundboardSoundJSONBody, RESTPostAPIGuildSoundboardSoundJSONBody, RESTPostAPISoundboardSendSoundJSONBody } from '../../types';
2
2
  import { BaseShorter } from './base';
3
3
  export declare class SoundboardShorter extends BaseShorter {
4
- getDefaults(): Promise<import("../../types").RESTGetAPISoundboardDefaultSoundsResult>;
4
+ getDefaults(): Promise<import("../..").RESTGetAPISoundboardDefaultSoundsResult>;
5
5
  send(channelId: string, body: RESTPostAPISoundboardSendSoundJSONBody): Promise<undefined>;
6
- list(guildId: string): Promise<import("../../types").RESTGetAPIGuildSoundboardSoundsResult>;
7
- get(guildId: string, soundID: string): Promise<import("../../types").APISoundboardSound>;
8
- create(guildId: string, body: RESTPostAPIGuildSoundboardSoundJSONBody): Promise<import("../../types").APISoundboardSound>;
9
- edit(guildId: string, soundID: string, body: RESTPatchAPIGuildSoundboardSoundJSONBody): Promise<import("../../types").APISoundboardSound>;
6
+ list(guildId: string): Promise<import("../..").RESTGetAPIGuildSoundboardSoundsResult>;
7
+ get(guildId: string, soundID: string): Promise<import("../..").APISoundboardSound>;
8
+ create(guildId: string, body: RESTPostAPIGuildSoundboardSoundJSONBody): Promise<import("../..").APISoundboardSound>;
9
+ edit(guildId: string, soundID: string, body: RESTPatchAPIGuildSoundboardSoundJSONBody): Promise<import("../..").APISoundboardSound>;
10
10
  delete(guildId: string, soundID: string, reason?: string): Promise<undefined>;
11
11
  }
@@ -5,6 +5,6 @@ export declare class UsersShorter extends BaseShorter {
5
5
  createDM(userId: string, force?: boolean): Promise<DMChannelStructure>;
6
6
  deleteDM(userId: string, reason?: string): Promise<DMChannelStructure>;
7
7
  fetch(userId: string, force?: boolean): Promise<UserStructure>;
8
- raw(userId: string, force?: boolean): Promise<import("../../types").APIUser>;
8
+ raw(userId: string, force?: boolean): Promise<import("../..").APIUser>;
9
9
  write(userId: string, body: MessageCreateBodyRequest): Promise<MessageStructure>;
10
10
  }
@@ -1,5 +1,5 @@
1
1
  import { type WebhookMessageStructure, type WebhookStructure } from '../../client/transformers';
2
- import { type MessageWebhookMethodEditParams, type MessageWebhookMethodWriteParams } from '../../structures';
2
+ import { type MessageWebhookMethodEditParams, type MessageWebhookMethodWriteParams, type MessageWebhookMethodWriteWaitParams } from '../../structures';
3
3
  import type { RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIChannelWebhookJSONBody, RESTPostAPIWebhookWithTokenQuery } from '../../types';
4
4
  import type { MakeRequired, OmitInsert } from '../types/util';
5
5
  import { BaseShorter } from './base';
@@ -34,7 +34,8 @@ export declare class WebhookShorter extends BaseShorter {
34
34
  * @param data The data for writing the message.
35
35
  * @returns A Promise that resolves to the written message.
36
36
  */
37
- writeMessage(webhookId: string, token: string, { body: data, ...payload }: MessageWebhookMethodWriteParams): Promise<WebhookMessageStructure | null>;
37
+ writeMessage(webhookId: string, token: string, payload: MessageWebhookMethodWriteWaitParams): Promise<WebhookMessageStructure>;
38
+ writeMessage(webhookId: string, token: string, payload: MessageWebhookMethodWriteParams): Promise<WebhookMessageStructure | null>;
38
39
  /**
39
40
  * Edits a message sent by the webhook.
40
41
  * @param webhookId The ID of the webhook.
@@ -59,13 +59,6 @@ class WebhookShorter extends base_1.BaseShorter {
59
59
  }
60
60
  return transformers_1.Transformers.Webhook(this.client, webhook);
61
61
  }
62
- /**
63
- * Writes a message using the webhook.
64
- * @param webhookId The ID of the webhook.
65
- * @param token The token of the webhook.
66
- * @param data The data for writing the message.
67
- * @returns A Promise that resolves to the written message.
68
- */
69
62
  async writeMessage(webhookId, token, { body: data, ...payload }) {
70
63
  const { files, ...body } = data;
71
64
  const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) : undefined;
@@ -2,6 +2,10 @@ import type { CDNUrlOptions } from '../../api';
2
2
  import type { UsingClient } from '../../commands';
3
3
  import type { Identify } from '..';
4
4
  export type ImageOptions = CDNUrlOptions;
5
+ export interface BanOptions {
6
+ deleteMessageSeconds?: number;
7
+ reason?: string;
8
+ }
5
9
  export type MethodContext<T = object> = Identify<{
6
10
  client: UsingClient;
7
11
  } & T>;
@@ -26,6 +26,7 @@ export interface StructWhen<Prop = any, State extends keyof StructWhen = 'cached
26
26
  }
27
27
  export type StructStates = keyof StructWhen;
28
28
  export type StructPropState<Prop, State extends StructStates, Select extends StructStates> = StructWhen<Prop, Select>[State];
29
+ export type PropWhen<Select extends StructStates, Prop, State extends StructStates = StructStates> = StructPropState<Prop, State, Select>;
29
30
  export type WithID<More> = {
30
31
  id: string;
31
32
  } & More;
@@ -51,7 +52,14 @@ export type MakeRequired<T, K extends keyof T = keyof T> = T & {
51
52
  export type PickRequired<T, K extends keyof T> = Omit<T, K> & {
52
53
  [P in K]: NonFalsy<T[P]>;
53
54
  };
55
+ export type MakePresent<T, K extends keyof T = keyof T> = T & {
56
+ [P in K]-?: NonNullish<T[P]>;
57
+ };
58
+ export type PickPresent<T, K extends keyof T> = Omit<T, K> & {
59
+ [P in K]-?: NonNullish<T[P]>;
60
+ };
54
61
  export type NonFalsy<T> = T extends false | 0 | '' | null | undefined | 0n ? never : T;
62
+ export type NonNullish<T> = T extends null | undefined ? never : T;
55
63
  export type CamelCase<S extends string> = S extends `${infer P1}_${infer P2}${infer P3}` ? `${Lowercase<P1>}${Uppercase<P2>}${CamelCase<P3>}` : Lowercase<S>;
56
64
  export type SnakeCase<S extends string> = S extends `${infer A}${infer Rest}` ? A extends Uppercase<A> ? `_${Lowercase<A>}${SnakeCase<Rest>}` : `${A}${SnakeCase<Rest>}` : Lowercase<S>;
57
65
  export type ObjectToLower<T> = T extends unknown[] ? ObjectToLower<T[0]>[] : Identify<{
@@ -1,10 +1,11 @@
1
1
  import type { RawFile } from '../../api';
2
2
  import type { Attachment, AttachmentBuilder, Embed, Modal, PollBuilder, TopLevelBuilders } from '../../builders';
3
+ import type { InMessageEmbed } from '../../structures/Message';
3
4
  import type { APIEmbed, APIInteractionResponseCallbackData, APIInteractionResponseChannelMessageWithSource, APIModalInteractionResponse, MessageFlags, RESTAPIPollCreate, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIWebhookWithTokenJSONBody } from '../../types';
4
5
  import type { OmitInsert, RequireAtLeastOne } from './util';
5
6
  export interface ResolverProps {
6
7
  content?: string | undefined | null;
7
- embeds?: Embed[] | APIEmbed[] | undefined;
8
+ embeds?: (Embed | APIEmbed | InMessageEmbed)[] | undefined;
8
9
  components?: TopLevelBuilders[] | ReturnType<TopLevelBuilders['toJSON']>[];
9
10
  files?: AttachmentBuilder[] | Attachment[] | RawFile[] | undefined;
10
11
  }
@@ -3,7 +3,7 @@ import { BaseComponent } from './BaseComponent';
3
3
  export type APISelectMenuComponentTypes = ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect;
4
4
  export declare class BaseSelectMenuComponent<T extends APISelectMenuComponentTypes> extends BaseComponent<T> {
5
5
  get customId(): string;
6
- get disabed(): boolean | undefined;
6
+ get disabled(): boolean | undefined;
7
7
  get max(): number | undefined;
8
8
  get min(): number | undefined;
9
9
  get placeholder(): string | undefined;
@@ -6,7 +6,7 @@ class BaseSelectMenuComponent extends BaseComponent_1.BaseComponent {
6
6
  get customId() {
7
7
  return this.data.custom_id;
8
8
  }
9
- get disabed() {
9
+ get disabled() {
10
10
  return this.data.disabled;
11
11
  }
12
12
  get max() {
@@ -7,17 +7,17 @@ export declare class LinkButtonComponent extends BaseComponent<ComponentType.But
7
7
  get url(): string;
8
8
  get label(): string | undefined;
9
9
  get disabled(): boolean | undefined;
10
- get emoji(): import("../types").APIMessageComponentEmoji | undefined;
10
+ get emoji(): import("..").APIMessageComponentEmoji | undefined;
11
11
  toBuilder(): Button;
12
12
  }
13
- export type ButtonStyleExludeLink = Exclude<ButtonStyle, ButtonStyle.Link>;
13
+ export type ButtonStyleExcludeLink = Exclude<ButtonStyle, ButtonStyle.Link>;
14
14
  export declare class ButtonComponent extends BaseComponent<ComponentType.Button> {
15
15
  data: APIButtonComponentWithCustomId;
16
16
  get style(): ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger;
17
17
  get customId(): string;
18
18
  get label(): string | undefined;
19
19
  get disabled(): boolean | undefined;
20
- get emoji(): import("../types").APIMessageComponentEmoji | undefined;
20
+ get emoji(): import("..").APIMessageComponentEmoji | undefined;
21
21
  toBuilder(): Button;
22
22
  }
23
23
  export declare class SKUButtonComponent extends BaseComponent<ComponentType.Button> {
@@ -1,6 +1,6 @@
1
1
  import type { ComponentType } from '../types';
2
2
  import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
3
3
  export declare class ChannelSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.ChannelSelect> {
4
- get channelsTypes(): import("../types").ChannelType[] | undefined;
5
- get defaultValues(): import("../types").APISelectMenuDefaultValue<import("../types").SelectMenuDefaultValueType.Channel>[] | undefined;
4
+ get channelsTypes(): import("..").ChannelType[] | undefined;
5
+ get defaultValues(): import("..").APISelectMenuDefaultValue<import("..").SelectMenuDefaultValueType.Channel>[] | undefined;
6
6
  }
@@ -2,6 +2,6 @@ import type { ComponentType } from '../types';
2
2
  import { BaseComponent } from './BaseComponent';
3
3
  export declare class FileComponent extends BaseComponent<ComponentType.File> {
4
4
  get spoiler(): boolean | undefined;
5
- get file(): import("../types").APIUnfurledMediaItem;
5
+ get file(): import("..").APIUnfurledMediaItem;
6
6
  get id(): number | undefined;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import type { ComponentType } from '../types';
2
2
  import { BaseComponent } from './BaseComponent';
3
3
  export declare class MediaGalleryComponent extends BaseComponent<ComponentType.MediaGallery> {
4
- get items(): import("../types").APIMediaGalleryItems[];
4
+ get items(): import("..").APIMediaGalleryItems[];
5
5
  get id(): number | undefined;
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from '../types';
2
2
  import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
3
3
  export declare class MentionableSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.MentionableSelect> {
4
- get defaultValues(): import("../types").APISelectMenuDefaultValue<import("../types").SelectMenuDefaultValueType>[] | undefined;
4
+ get defaultValues(): import("..").APISelectMenuDefaultValue<import("..").SelectMenuDefaultValueType>[] | undefined;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from '../types';
2
2
  import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
3
3
  export declare class RoleSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.RoleSelect> {
4
- get defaultValues(): import("../types").APISelectMenuDefaultValue<import("../types").SelectMenuDefaultValueType.Role>[] | undefined;
4
+ get defaultValues(): import("..").APISelectMenuDefaultValue<import("..").SelectMenuDefaultValueType.Role>[] | undefined;
5
5
  }
@@ -2,6 +2,6 @@ import type { ComponentType } from '../types';
2
2
  import { BaseComponent } from './BaseComponent';
3
3
  export declare class SeparatorComponent extends BaseComponent<ComponentType.Separator> {
4
4
  get id(): number | undefined;
5
- get spacing(): import("../types").Spacing | undefined;
5
+ get spacing(): import("..").Spacing | undefined;
6
6
  get divider(): boolean | undefined;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from '../types';
2
2
  import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
3
3
  export declare class StringSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.StringSelect> {
4
- get options(): import("../types").APISelectMenuOption[];
4
+ get options(): import("..").APISelectMenuOption<string>[];
5
5
  }
@@ -3,7 +3,7 @@ import { BaseComponent } from './BaseComponent';
3
3
  export declare class TextInputComponent extends BaseComponent<ComponentType.TextInput> {
4
4
  get customId(): string;
5
5
  get value(): string | undefined;
6
- get style(): import("../types").TextInputStyle;
6
+ get style(): import("..").TextInputStyle;
7
7
  get max(): number | undefined;
8
8
  get min(): number | undefined;
9
9
  get required(): boolean | undefined;
@@ -2,7 +2,7 @@ import type { ComponentType } from '../types';
2
2
  import { BaseComponent } from './BaseComponent';
3
3
  export declare class ThumbnailComponent extends BaseComponent<ComponentType.Thumbnail> {
4
4
  get id(): number | undefined;
5
- get media(): import("../types").APIUnfurledMediaItem;
5
+ get media(): import("..").APIUnfurledMediaItem;
6
6
  get description(): string | undefined;
7
7
  get spoiler(): boolean | undefined;
8
8
  }
@@ -1,5 +1,5 @@
1
1
  import type { ComponentType } from '../types';
2
2
  import { BaseSelectMenuComponent } from './BaseSelectMenuComponent';
3
3
  export declare class UserSelectMenuComponent extends BaseSelectMenuComponent<ComponentType.UserSelect> {
4
- get defaultValues(): import("../types").APISelectMenuDefaultValue<import("../types").SelectMenuDefaultValueType.User>[] | undefined;
4
+ get defaultValues(): import("..").APISelectMenuDefaultValue<import("..").SelectMenuDefaultValueType.User>[] | undefined;
5
5
  }
@@ -1,4 +1,5 @@
1
- import type { ExtraProps, RegisteredMiddlewares, UsingClient } from '../commands';
1
+ import type { PluginMiddlewareDenialMetadata } from '../client/plugins/types';
2
+ import type { ExtraProps, ResolvedRegisteredMiddlewares, UsingClient } from '../commands';
2
3
  import type { ComponentContext, ContextComponentCommandInteractionMap } from './componentcontext';
3
4
  export declare const InteractionCommandType: {
4
5
  readonly COMPONENT: 0;
@@ -13,12 +14,12 @@ export declare abstract class ComponentCommand {
13
14
  customId?: string | RegExp;
14
15
  filter?(context: ComponentContext<typeof this.componentType>): Promise<boolean> | boolean;
15
16
  abstract run(context: ComponentContext<typeof this.componentType>): any;
16
- middlewares: (keyof RegisteredMiddlewares)[];
17
+ middlewares: readonly (keyof ResolvedRegisteredMiddlewares)[];
17
18
  props: ExtraProps;
18
19
  get cType(): number;
19
- onBeforeMiddlewares?(context: ComponentContext): any;
20
- onAfterRun?(context: ComponentContext, error: unknown | undefined): any;
21
- onRunError?(context: ComponentContext, error: unknown): any;
22
- onMiddlewaresError?(context: ComponentContext, error: string): any;
23
- onInternalError?(client: UsingClient, error?: unknown): any;
20
+ onBeforeMiddlewares?(context: ComponentContext<typeof this.componentType>): any;
21
+ onAfterRun?(context: ComponentContext<typeof this.componentType>, error: unknown | undefined): any;
22
+ onRunError?(context: ComponentContext<typeof this.componentType>, error: unknown): any;
23
+ onMiddlewaresError?(context: ComponentContext<typeof this.componentType>, error: string, metadata: PluginMiddlewareDenialMetadata): any;
24
+ onInternalError?(client: UsingClient, component: ComponentCommand, error?: unknown): any;
24
25
  }
@@ -1,38 +1,34 @@
1
- import type { AllChannels, ButtonInteraction, ChannelSelectMenuInteraction, ComponentCommand, MentionableSelectMenuInteraction, ReturnCache, RoleSelectMenuInteraction, StringSelectMenuInteraction, UserSelectMenuInteraction } from '..';
2
- import type { GuildMemberStructure, GuildStructure, InteractionGuildMemberStructure, UserStructure, WebhookMessageStructure } from '../client/transformers';
3
- import type { CommandMetadata, ExtendContext, GlobalMetadata, RegisteredMiddlewares, UsingClient } from '../commands';
1
+ import type { AllChannels, ButtonInteraction, ChannelSelectMenuInteraction, ComponentCommand, MentionableSelectMenuInteraction, RoleSelectMenuInteraction, StringSelectMenuInteraction, UserSelectMenuInteraction } from '..';
2
+ import type { ReturnCache } from '../cache';
3
+ import type { GuildMemberStructure, GuildStructure, InteractionGuildMemberStructure, MessageStructure, UserStructure, WebhookMessageStructure } from '../client/transformers';
4
+ import type { CommandMetadata, ExtendContext, GlobalMetadata, ResolvedRegisteredMiddlewares, UsingClient } from '../commands';
4
5
  import { BaseContext } from '../commands/basecontext';
5
- import type { ComponentInteractionMessageUpdate, InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, MessageWebhookCreateBodyRequest, ModalCreateBodyRequest, ModalCreateOptions, UnionToTuple, When } from '../common';
6
+ import type { ComponentInteractionMessageUpdate, InteractionCreateBodyRequest, InteractionMessageUpdateBodyRequest, MakeRequired, MessageWebhookCreateBodyRequest, ModalCreateBodyRequest, ModalCreateOptions, When } from '../common';
6
7
  import type { ModalSubmitInteraction } from '../structures';
7
8
  import { type RESTGetAPIGuildQuery } from '../types';
8
- export interface ComponentContext<Type extends keyof ContextComponentCommandInteractionMap = keyof ContextComponentCommandInteractionMap> extends BaseContext, ExtendContext {
9
+ export interface ComponentContext<Type extends keyof ContextComponentCommandInteractionMap = keyof ContextComponentCommandInteractionMap, M extends keyof ResolvedRegisteredMiddlewares = never, StringSelectValues extends string[] = string[]> extends BaseContext, ExtendContext {
9
10
  }
10
- /**
11
- * Represents a context for interacting with components in a Discord bot.
12
- * @template Type - The type of component interaction.
13
- */
14
- export declare class ComponentContext<Type extends keyof ContextComponentCommandInteractionMap, M extends keyof RegisteredMiddlewares = never> extends BaseContext {
11
+ export declare class ComponentContext<Type extends keyof ContextComponentCommandInteractionMap, M extends keyof ResolvedRegisteredMiddlewares = never, StringSelectValues extends string[] = string[]> extends BaseContext {
15
12
  readonly client: UsingClient;
16
- interaction: ContextComponentCommandInteractionMap[Type];
13
+ interaction: ContextComponentCommandInteractionMap<StringSelectValues>[Type];
17
14
  /**
18
15
  * Creates a new instance of the ComponentContext class.
19
16
  * @param client - The UsingClient instance.
20
17
  * @param interaction - The component interaction object.
21
18
  */
22
- constructor(client: UsingClient, interaction: ContextComponentCommandInteractionMap[Type]);
19
+ constructor(client: UsingClient, interaction: ContextComponentCommandInteractionMap<StringSelectValues>[Type]);
23
20
  command: ComponentCommand;
24
- metadata: CommandMetadata<UnionToTuple<M>>;
21
+ metadata: CommandMetadata<M>;
25
22
  globalMetadata: GlobalMetadata;
26
23
  /**
27
24
  * Gets the language object for the interaction's locale.
28
25
  */
29
- get t(): import("..").__InternalParseLocale<import("..").DefaultLocale> & {
30
- get(locale?: string): import("..").DefaultLocale;
31
- };
26
+ get t(): import("..").SeyfertLocale;
32
27
  /**
33
28
  * Gets the custom ID of the interaction.
34
29
  */
35
30
  get customId(): string;
31
+ get message(): MessageStructure;
36
32
  /**
37
33
  * Writes a response to the interaction.
38
34
  * @param body - The body of the response.
@@ -48,15 +44,6 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
48
44
  * ACK an interaction and edit the original message later; the user does not see a loading state
49
45
  */
50
46
  deferUpdate(): Promise<undefined>;
51
- /**
52
- * Edits the response of the interaction.
53
- * @param body - The updated body of the response.
54
- */
55
- editResponse(body: InteractionMessageUpdateBodyRequest): Promise<WebhookMessageStructure>;
56
- /**
57
- * Updates the interaction with new data.
58
- * @param body - The updated body of the interaction.
59
- */
60
47
  update(body: ComponentInteractionMessageUpdate): Promise<undefined>;
61
48
  /**
62
49
  * Edits the response or replies to the interaction.
@@ -93,6 +80,7 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
93
80
  /**
94
81
  * Gets the guild of the interaction.
95
82
  * @param mode - The mode to fetch the guild.
83
+ * @param query - Optional query used in fetch mode.
96
84
  * @returns A promise that resolves to the guild.
97
85
  */
98
86
  guild(mode?: 'rest' | 'flow', query?: RESTGetAPIGuildQuery): Promise<GuildStructure<'cached' | 'api'> | undefined>;
@@ -113,24 +101,24 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
113
101
  * Gets the member of the interaction.
114
102
  */
115
103
  get member(): InteractionGuildMemberStructure | undefined;
116
- isComponent(): this is ComponentContext<keyof ContextComponentCommandInteractionMap>;
117
- isButton(): this is ComponentContext<'Button', M>;
118
- isChannelSelectMenu(): this is ComponentContext<'ChannelSelect', M>;
119
- isRoleSelectMenu(): this is ComponentContext<'RoleSelect', M>;
120
- isMentionableSelectMenu(): this is ComponentContext<'MentionableSelect', M>;
121
- isUserSelectMenu(): this is ComponentContext<'UserSelect', M>;
122
- isStringSelectMenu(): this is ComponentContext<'StringSelect', M>;
123
- inGuild(): this is GuildComponentContext<Type, M>;
104
+ isComponent(): this is ComponentContext<keyof ContextComponentCommandInteractionMap, M, StringSelectValues>;
105
+ isButton(): this is ComponentContext<'Button', M, StringSelectValues>;
106
+ isChannelSelectMenu(): this is ComponentContext<'ChannelSelect', M, StringSelectValues>;
107
+ isRoleSelectMenu(): this is ComponentContext<'RoleSelect', M, StringSelectValues>;
108
+ isMentionableSelectMenu(): this is ComponentContext<'MentionableSelect', M, StringSelectValues>;
109
+ isUserSelectMenu(): this is ComponentContext<'UserSelect', M, StringSelectValues>;
110
+ isStringSelectMenu(): this is ComponentContext<'StringSelect', M, StringSelectValues>;
111
+ inGuild(): this is GuildComponentContext<Type, M, StringSelectValues>;
124
112
  }
125
- export interface ContextComponentCommandInteractionMap {
113
+ export interface ContextComponentCommandInteractionMap<StringSelectValues extends string[] = string[]> {
126
114
  Button: ButtonInteraction;
127
- StringSelect: StringSelectMenuInteraction;
115
+ StringSelect: StringSelectMenuInteraction<StringSelectValues>;
128
116
  UserSelect: UserSelectMenuInteraction;
129
117
  RoleSelect: RoleSelectMenuInteraction;
130
118
  MentionableSelect: MentionableSelectMenuInteraction;
131
119
  ChannelSelect: ChannelSelectMenuInteraction;
132
120
  }
133
- export interface GuildComponentContext<Type extends keyof ContextComponentCommandInteractionMap, M extends keyof RegisteredMiddlewares = never> extends Omit<MakeRequired<ComponentContext<Type, M>, 'guildId' | 'member'>, 'guild' | 'me'> {
121
+ export interface GuildComponentContext<Type extends keyof ContextComponentCommandInteractionMap, M extends keyof ResolvedRegisteredMiddlewares = never, StringSelectValues extends string[] = string[]> extends Omit<MakeRequired<ComponentContext<Type, M, StringSelectValues>, 'guildId' | 'member'>, 'guild' | 'me'> {
134
122
  guild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'>>;
135
123
  guild(mode: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>;
136
124
  me(mode?: 'rest' | 'flow'): Promise<GuildMemberStructure>;
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ComponentContext = void 0;
4
4
  const basecontext_1 = require("../commands/basecontext");
5
5
  const types_1 = require("../types");
6
- /**
7
- * Represents a context for interacting with components in a Discord bot.
8
- * @template Type - The type of component interaction.
9
- */
10
6
  class ComponentContext extends basecontext_1.BaseContext {
11
7
  client;
12
8
  interaction;
@@ -27,7 +23,9 @@ class ComponentContext extends basecontext_1.BaseContext {
27
23
  * Gets the language object for the interaction's locale.
28
24
  */
29
25
  get t() {
30
- return this.client.t(this.interaction.locale ?? this.client.langs?.defaultLang ?? 'en-US');
26
+ return this.client.t(this.client.langs.preferGuildLocale
27
+ ? (this.interaction.guildLocale ?? this.interaction.locale ?? this.client.langs.defaultLang ?? 'en-US')
28
+ : (this.interaction.locale ?? this.client.langs.defaultLang ?? 'en-US'));
31
29
  }
32
30
  /**
33
31
  * Gets the custom ID of the interaction.
@@ -35,6 +33,9 @@ class ComponentContext extends basecontext_1.BaseContext {
35
33
  get customId() {
36
34
  return this.interaction.customId;
37
35
  }
36
+ get message() {
37
+ return this.interaction.message;
38
+ }
38
39
  /**
39
40
  * Writes a response to the interaction.
40
41
  * @param body - The body of the response.
@@ -56,17 +57,6 @@ class ComponentContext extends basecontext_1.BaseContext {
56
57
  deferUpdate() {
57
58
  return this.interaction.deferUpdate();
58
59
  }
59
- /**
60
- * Edits the response of the interaction.
61
- * @param body - The updated body of the response.
62
- */
63
- editResponse(body) {
64
- return this.interaction.editResponse(body);
65
- }
66
- /**
67
- * Updates the interaction with new data.
68
- * @param body - The updated body of the interaction.
69
- */
70
60
  update(body) {
71
61
  return this.interaction.update(body);
72
62
  }
@@ -153,7 +143,7 @@ class ComponentContext extends basecontext_1.BaseContext {
153
143
  return true;
154
144
  }
155
145
  isButton() {
156
- return this.interaction.data.componentType === types_1.ComponentType.Button;
146
+ return this.interaction.componentType === types_1.ComponentType.Button;
157
147
  }
158
148
  isChannelSelectMenu() {
159
149
  return this.interaction.componentType === types_1.ComponentType.ChannelSelect;