seyfert 2.1.0 → 2.1.1-dev-11310514874.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 (240) 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 +3 -3
  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 +4 -4
  86. package/lib/commands/applications/shared.d.ts +5 -2
  87. package/lib/commands/basecontext.d.ts +1 -1
  88. package/lib/commands/decorators.d.ts +10 -10
  89. package/lib/commands/decorators.js +5 -4
  90. package/lib/commands/handle.d.ts +9 -9
  91. package/lib/commands/handle.js +94 -68
  92. package/lib/commands/handler.d.ts +5 -5
  93. package/lib/commands/handler.js +21 -17
  94. package/lib/commands/optionresolver.d.ts +4 -4
  95. package/lib/commands/optionresolver.js +3 -3
  96. package/lib/common/it/formatter.d.ts +21 -21
  97. package/lib/common/it/formatter.js +40 -41
  98. package/lib/common/it/logger.js +1 -1
  99. package/lib/common/it/utils.d.ts +4 -3
  100. package/lib/common/it/utils.js +52 -27
  101. package/lib/common/shorters/application.d.ts +2 -3
  102. package/lib/common/shorters/application.js +3 -3
  103. package/lib/common/shorters/bans.js +1 -1
  104. package/lib/common/shorters/channels.d.ts +3 -3
  105. package/lib/common/shorters/channels.js +3 -3
  106. package/lib/common/shorters/emojis.js +4 -4
  107. package/lib/common/shorters/guilds.d.ts +3 -3
  108. package/lib/common/shorters/guilds.js +5 -9
  109. package/lib/common/shorters/interaction.d.ts +3 -3
  110. package/lib/common/shorters/interaction.js +6 -5
  111. package/lib/common/shorters/members.d.ts +4 -5
  112. package/lib/common/shorters/members.js +6 -7
  113. package/lib/common/shorters/messages.d.ts +1 -1
  114. package/lib/common/shorters/messages.js +4 -4
  115. package/lib/common/shorters/reactions.d.ts +1 -1
  116. package/lib/common/shorters/reactions.js +1 -1
  117. package/lib/common/shorters/roles.js +1 -1
  118. package/lib/common/shorters/templates.js +2 -2
  119. package/lib/common/shorters/threads.d.ts +1 -1
  120. package/lib/common/shorters/threads.js +17 -11
  121. package/lib/common/shorters/webhook.d.ts +1 -1
  122. package/lib/common/shorters/webhook.js +4 -4
  123. package/lib/common/types/options.d.ts +2 -2
  124. package/lib/common/types/resolvables.d.ts +1 -1
  125. package/lib/common/types/util.d.ts +4 -1
  126. package/lib/common/types/write.d.ts +1 -1
  127. package/lib/components/BaseComponent.js +1 -1
  128. package/lib/components/ButtonComponent.d.ts +1 -1
  129. package/lib/components/componentcommand.d.ts +1 -1
  130. package/lib/components/componentcontext.d.ts +4 -4
  131. package/lib/components/componentcontext.js +1 -1
  132. package/lib/components/handler.d.ts +10 -8
  133. package/lib/components/handler.js +16 -13
  134. package/lib/components/index.js +2 -1
  135. package/lib/components/modalcontext.d.ts +2 -2
  136. package/lib/components/modalcontext.js +1 -1
  137. package/lib/deps/mixer.d.ts +1 -1
  138. package/lib/events/handler.d.ts +5 -5
  139. package/lib/events/handler.js +66 -16
  140. package/lib/events/hooks/application_command.d.ts +1 -1
  141. package/lib/events/hooks/auto_moderation.d.ts +1 -1
  142. package/lib/events/hooks/auto_moderation.js +1 -1
  143. package/lib/events/hooks/channel.d.ts +1 -1
  144. package/lib/events/hooks/dispatch.d.ts +1 -1
  145. package/lib/events/hooks/entitlement.d.ts +4 -5
  146. package/lib/events/hooks/entitlement.js +4 -4
  147. package/lib/events/hooks/guild.d.ts +3 -3
  148. package/lib/events/hooks/guild.js +1 -1
  149. package/lib/events/hooks/index.d.ts +1 -0
  150. package/lib/events/hooks/index.js +1 -0
  151. package/lib/events/hooks/integration.d.ts +1 -1
  152. package/lib/events/hooks/integration.js +1 -1
  153. package/lib/events/hooks/interactions.d.ts +3 -3
  154. package/lib/events/hooks/invite.d.ts +1 -1
  155. package/lib/events/hooks/message.d.ts +3 -3
  156. package/lib/events/hooks/message.js +1 -1
  157. package/lib/events/hooks/presence.d.ts +2 -2
  158. package/lib/events/hooks/soundboard.d.ts +155 -0
  159. package/lib/events/hooks/soundboard.js +28 -0
  160. package/lib/events/hooks/stage.d.ts +2 -2
  161. package/lib/events/hooks/thread.d.ts +2 -2
  162. package/lib/events/hooks/thread.js +2 -2
  163. package/lib/events/hooks/typing.d.ts +1 -1
  164. package/lib/events/hooks/typing.js +1 -1
  165. package/lib/events/hooks/user.d.ts +2 -2
  166. package/lib/events/hooks/voice.d.ts +2 -2
  167. package/lib/events/hooks/voice.js +1 -1
  168. package/lib/events/hooks/webhook.d.ts +1 -1
  169. package/lib/index.d.ts +2 -2
  170. package/lib/index.js +3 -5
  171. package/lib/langs/handler.d.ts +2 -2
  172. package/lib/structures/Guild.d.ts +7 -4
  173. package/lib/structures/Guild.js +1 -1
  174. package/lib/structures/GuildBan.d.ts +1 -1
  175. package/lib/structures/GuildMember.d.ts +7 -5
  176. package/lib/structures/GuildMember.js +5 -3
  177. package/lib/structures/GuildRole.d.ts +1 -1
  178. package/lib/structures/GuildTemplate.d.ts +1 -1
  179. package/lib/structures/Interaction.d.ts +17 -14
  180. package/lib/structures/Interaction.js +28 -21
  181. package/lib/structures/Message.d.ts +4 -7
  182. package/lib/structures/Message.js +5 -5
  183. package/lib/structures/Poll.d.ts +3 -3
  184. package/lib/structures/Sticker.d.ts +2 -2
  185. package/lib/structures/Sticker.js +1 -1
  186. package/lib/structures/VoiceState.d.ts +2 -1
  187. package/lib/structures/VoiceState.js +1 -1
  188. package/lib/structures/Webhook.d.ts +3 -3
  189. package/lib/structures/Webhook.js +1 -1
  190. package/lib/structures/channels.d.ts +4 -4
  191. package/lib/structures/channels.js +6 -5
  192. package/lib/structures/extra/BitField.d.ts +3 -3
  193. package/lib/structures/extra/BitField.js +34 -33
  194. package/lib/structures/extra/DiscordBase.js +1 -1
  195. package/lib/structures/extra/Permissions.d.ts +2 -0
  196. package/lib/structures/extra/Permissions.js +21 -0
  197. package/lib/types/gateway.d.ts +53 -5
  198. package/lib/types/payloads/_interactions/base.d.ts +1 -1
  199. package/lib/types/payloads/channel.d.ts +2 -2
  200. package/lib/types/payloads/guild.d.ts +9 -1
  201. package/lib/types/payloads/guild.js +8 -0
  202. package/lib/types/payloads/index.d.ts +1 -0
  203. package/lib/types/payloads/index.js +1 -0
  204. package/lib/types/payloads/soundboard.d.ts +23 -0
  205. package/lib/types/payloads/soundboard.js +5 -0
  206. package/lib/types/payloads/user.js +0 -1
  207. package/lib/types/rest/application.d.ts +3 -3
  208. package/lib/types/rest/auditLog.d.ts +1 -1
  209. package/lib/types/rest/channel.d.ts +2 -2
  210. package/lib/types/rest/guild.d.ts +2 -2
  211. package/lib/types/rest/guildScheduledEvent.d.ts +1 -1
  212. package/lib/types/rest/index.d.ts +1 -0
  213. package/lib/types/rest/index.js +1 -0
  214. package/lib/types/rest/oauth2.d.ts +1 -1
  215. package/lib/types/rest/poll.d.ts +1 -1
  216. package/lib/types/rest/soundboard.d.ts +64 -0
  217. package/lib/types/rest/soundboard.js +2 -0
  218. package/lib/types/rest/stageInstance.d.ts +1 -1
  219. package/lib/types/rest/template.d.ts +1 -1
  220. package/lib/types/rest/user.d.ts +1 -1
  221. package/lib/types/rest/webhook.d.ts +1 -1
  222. package/lib/types/utils/index.d.ts +11 -2
  223. package/lib/types/utils/index.js +10 -2
  224. package/lib/websocket/SharedTypes.d.ts +11 -2
  225. package/lib/websocket/constants/index.js +0 -10
  226. package/lib/websocket/discord/basesocket.d.ts +1 -1
  227. package/lib/websocket/discord/shard.d.ts +1 -1
  228. package/lib/websocket/discord/shard.js +25 -16
  229. package/lib/websocket/discord/sharder.d.ts +9 -6
  230. package/lib/websocket/discord/sharder.js +91 -74
  231. package/lib/websocket/discord/shared.d.ts +3 -14
  232. package/lib/websocket/discord/socket/custom.js +19 -6
  233. package/lib/websocket/discord/worker.d.ts +8 -2
  234. package/lib/websocket/discord/workermanager.d.ts +42 -17
  235. package/lib/websocket/discord/workermanager.js +144 -37
  236. package/lib/websocket/structures/timeout.d.ts +4 -5
  237. package/lib/websocket/structures/timeout.js +23 -24
  238. package/package.json +72 -70
  239. package/lib/cache/resources/threads.d.ts +0 -14
  240. package/lib/cache/resources/threads.js +0 -32
@@ -9,13 +9,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.ModalSubmitInteraction = exports.MessageCommandInteraction = exports.UserCommandInteraction = exports.ChatInputCommandInteraction = exports.UserSelectMenuInteraction = exports.RoleSelectMenuInteraction = exports.MentionableSelectMenuInteraction = exports.ChannelSelectMenuInteraction = exports.StringSelectMenuInteraction = exports.SelectMenuInteraction = exports.ButtonInteraction = exports.ComponentInteraction = exports.EntryPointInteraction = exports.ApplicationCommandInteraction = exports.Interaction = exports.AutocompleteInteraction = exports.BaseInteraction = void 0;
10
10
  const types_1 = require("../types");
11
11
  const builders_1 = require("../builders");
12
+ const transformers_1 = require("../client/transformers");
12
13
  const common_1 = require("../common");
14
+ const mixer_1 = require("../deps/mixer");
13
15
  const _1 = require("./");
14
16
  const DiscordBase_1 = require("./extra/DiscordBase");
15
17
  const Permissions_1 = require("./extra/Permissions");
16
- const transformers_1 = require("../client/transformers");
17
- const mixer_1 = require("../deps/mixer");
18
- const Entitlement_1 = require("./Entitlement");
19
18
  class BaseInteraction extends DiscordBase_1.DiscordBase {
20
19
  client;
21
20
  __reply;
@@ -25,6 +24,7 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
25
24
  message;
26
25
  replied;
27
26
  appPermissions;
27
+ entitlements;
28
28
  constructor(client, interaction, __reply) {
29
29
  super(client, interaction);
30
30
  this.client = client;
@@ -42,7 +42,7 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
42
42
  this.channel = (0, _1.channelFrom)(interaction.channel, client);
43
43
  }
44
44
  this.user = this.member?.user ?? transformers_1.Transformers.User(client, interaction.user);
45
- this.entitlements = interaction.entitlements.map(e => new Entitlement_1.Entitlement(this.client, e));
45
+ this.entitlements = interaction.entitlements.map(e => transformers_1.Transformers.Entitlement(this.client, e));
46
46
  }
47
47
  static transformBodyRequest(body, files, self) {
48
48
  switch (body.type) {
@@ -52,9 +52,9 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
52
52
  return body;
53
53
  case types_1.InteractionResponseType.ChannelMessageWithSource:
54
54
  case types_1.InteractionResponseType.UpdateMessage: {
55
+ //@ts-ignore
55
56
  return {
56
57
  type: body.type,
57
- //@ts-ignore
58
58
  data: BaseInteraction.transformBody(body.data ?? {}, files, self),
59
59
  };
60
60
  }
@@ -102,37 +102,47 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
102
102
  }
103
103
  return payload;
104
104
  }
105
- async matchReplied(body) {
105
+ async matchReplied(body, withResponse = false) {
106
106
  if (this.__reply) {
107
107
  //@ts-expect-error
108
108
  const { files, ...rest } = body.data ?? {};
109
109
  //@ts-expect-error
110
110
  const data = body.data instanceof builders_1.Modal ? body.data : rest;
111
111
  const parsedFiles = files ? await (0, builders_1.resolveFiles)(files) : undefined;
112
- return (this.replied = this.__reply({
112
+ await (this.replied = this.__reply({
113
113
  body: BaseInteraction.transformBodyRequest({ data, type: body.type }, parsedFiles, this.client),
114
114
  files: parsedFiles,
115
115
  }).then(() => (this.replied = true)));
116
+ return;
116
117
  }
117
- return (this.replied = this.client.interactions.reply(this.id, this.token, body).then(() => (this.replied = true)));
118
+ const result = await (this.replied = this.client.interactions.reply(this.id, this.token, body, withResponse));
119
+ this.replied = true;
120
+ return result?.resource?.message
121
+ ? transformers_1.Transformers.WebhookMessage(this.client, result.resource.message, this.id, this.token)
122
+ : undefined;
118
123
  }
119
- async reply(body) {
124
+ async reply(body, withResponse) {
120
125
  if (this.replied) {
121
126
  throw new Error('Interaction already replied');
122
127
  }
123
- await this.matchReplied(body);
128
+ const result = await this.matchReplied(body, withResponse);
124
129
  // @ts-expect-error
125
- if (body.data instanceof builders_1.Modal && body.data.__exec)
130
+ if (body.data instanceof builders_1.Modal) {
126
131
  // @ts-expect-error
127
- this.client.components.modals.set(this.user.id, body.data.__exec);
132
+ if (body.data.__exec)
133
+ this.client.components.modals.set(this.user.id, body.data.__exec);
134
+ else if (this.client.components?.modals.has(this.user.id))
135
+ this.client.components.modals.delete(this.user.id);
136
+ }
137
+ return result;
128
138
  }
129
- deferReply(flags) {
139
+ deferReply(flags, withResponse = false) {
130
140
  return this.reply({
131
141
  type: types_1.InteractionResponseType.DeferredChannelMessageWithSource,
132
142
  data: {
133
143
  flags,
134
144
  },
135
- });
145
+ }, withResponse);
136
146
  }
137
147
  isButton() {
138
148
  return false;
@@ -245,14 +255,11 @@ class Interaction extends BaseInteraction {
245
255
  fetchResponse() {
246
256
  return this.fetchMessage('@original');
247
257
  }
248
- async write(body, fetchReply) {
249
- (await this.reply({
258
+ async write(body, withResponse) {
259
+ return this.reply({
250
260
  type: types_1.InteractionResponseType.ChannelMessageWithSource,
251
261
  data: body,
252
- }));
253
- if (fetchReply)
254
- return this.fetchResponse();
255
- return undefined;
262
+ }, withResponse);
256
263
  }
257
264
  modal(body) {
258
265
  return this.reply({
@@ -277,7 +284,7 @@ class Interaction extends BaseInteraction {
277
284
  return this.deleteMessage('@original');
278
285
  }
279
286
  deleteMessage(messageId) {
280
- return this.client.interactions.deleteResponse(this.id, this.token, messageId);
287
+ return this.client.interactions.deleteResponse(this.token, messageId);
281
288
  }
282
289
  followup(body) {
283
290
  return this.client.interactions.followup(this.token, body);
@@ -1,15 +1,15 @@
1
- import type { APIChannelMention, APIEmbed, APIMessage, GatewayMessageCreateDispatchData } from '../types';
1
+ import { Embed } from '..';
2
2
  import type { ListenerOptions } from '../builders';
3
+ import { type GuildMemberStructure, type PollStructure, type UserStructure } from '../client/transformers';
3
4
  import type { UsingClient } from '../commands';
4
5
  import { type ObjectToLower } from '../common';
5
6
  import type { EmojiResolvable } from '../common/types/resolvables';
6
7
  import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write';
7
8
  import type { ActionRowMessageComponents } from '../components';
8
9
  import { MessageActionRowComponent } from '../components/ActionRow';
10
+ import type { APIChannelMention, APIEmbed, APIMessage, GatewayMessageCreateDispatchData } from '../types';
9
11
  import type { MessageWebhookMethodEditParams, MessageWebhookMethodWriteParams } from './Webhook';
10
12
  import { DiscordBase } from './extra/DiscordBase';
11
- import { Embed } from '..';
12
- import { type PollStructure, type GuildMemberStructure, type UserStructure } from '../client/transformers';
13
13
  export type MessageData = APIMessage | GatewayMessageCreateDispatchData;
14
14
  export interface BaseMessage extends DiscordBase, ObjectToLower<Omit<MessageData, 'timestamp' | 'author' | 'mentions' | 'components' | 'poll' | 'embeds'>> {
15
15
  timestamp?: number;
@@ -28,10 +28,7 @@ export declare class BaseMessage extends DiscordBase {
28
28
  embeds: InMessageEmbed[];
29
29
  constructor(client: UsingClient, data: MessageData);
30
30
  get user(): import("./User").User;
31
- createComponentCollector(options?: ListenerOptions): {
32
- run<T extends import("../components/handler").CollectorInteraction = import("../components/handler").CollectorInteraction>(customId: string | string[] | RegExp, callback: import("..").ComponentCallback<T>): any;
33
- stop(reason?: string): any;
34
- };
31
+ createComponentCollector(options?: ListenerOptions): import("../components/handler").CreateComponentCollectorResult;
35
32
  get url(): `https://discord.com/channels/${string}/${string}/${string}`;
36
33
  guild(force?: boolean): Promise<import("./Guild").Guild<"api">> | undefined;
37
34
  channel(force?: boolean): Promise<import("./channels").AllChannels>;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InMessageEmbed = exports.WebhookMessage = exports.Message = exports.BaseMessage = void 0;
4
+ const __1 = require("..");
5
+ const transformers_1 = require("../client/transformers");
4
6
  const common_1 = require("../common");
7
+ const common_2 = require("../common");
5
8
  const ActionRow_1 = require("../components/ActionRow");
6
9
  const DiscordBase_1 = require("./extra/DiscordBase");
7
- const common_2 = require("../common");
8
- const __1 = require("..");
9
- const transformers_1 = require("../client/transformers");
10
10
  class BaseMessage extends DiscordBase_1.DiscordBase {
11
11
  embeds;
12
12
  constructor(client, data) {
@@ -24,7 +24,7 @@ class BaseMessage extends DiscordBase_1.DiscordBase {
24
24
  return this.author;
25
25
  }
26
26
  createComponentCollector(options) {
27
- return this.client.components.createComponentCollector(this.id, options);
27
+ return this.client.components.createComponentCollector(this.id, this.channelId, this.guildId, options);
28
28
  }
29
29
  get url() {
30
30
  return common_2.Formatter.messageLink(this.guildId, this.channelId, this.id);
@@ -105,7 +105,7 @@ class WebhookMessage extends BaseMessage {
105
105
  this.webhookToken = webhookToken;
106
106
  }
107
107
  fetch() {
108
- return this.api.webhooks(this.webhookId)(this.webhookToken).get({ query: this.thread?.id });
108
+ return this.api.webhooks(this.webhookId)(this.webhookToken).get();
109
109
  }
110
110
  edit(body) {
111
111
  const { query, ...rest } = body;
@@ -1,8 +1,8 @@
1
- import type { APIPoll } from '../types';
1
+ import type { ValidAnswerId } from '../api/Routes/channels';
2
+ import type { UsingClient } from '../commands';
2
3
  import { type ObjectToLower } from '../common';
4
+ import type { APIPoll } from '../types';
3
5
  import { Base } from './extra/Base';
4
- import type { UsingClient } from '../commands';
5
- import type { ValidAnswerId } from '../api/Routes/channels';
6
6
  export interface Poll extends ObjectToLower<APIPoll> {
7
7
  }
8
8
  export declare class Poll extends Base {
@@ -1,9 +1,9 @@
1
- import type { APISticker, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIGuildStickerFormDataBody } from '../types';
2
1
  import type { RawFile, UsingClient } from '..';
3
2
  import type { Attachment, AttachmentBuilder } from '../builders';
3
+ import { type UserStructure } from '../client/transformers';
4
4
  import type { MethodContext, ObjectToLower } from '../common';
5
+ import type { APISticker, RESTPatchAPIGuildStickerJSONBody, RESTPostAPIGuildStickerFormDataBody } from '../types';
5
6
  import { DiscordBase } from './extra/DiscordBase';
6
- import { type UserStructure } from '../client/transformers';
7
7
  export interface Sticker extends DiscordBase, ObjectToLower<Omit<APISticker, 'user'>> {
8
8
  }
9
9
  export declare class Sticker extends DiscordBase {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Sticker = void 0;
4
- const DiscordBase_1 = require("./extra/DiscordBase");
5
4
  const transformers_1 = require("../client/transformers");
5
+ const DiscordBase_1 = require("./extra/DiscordBase");
6
6
  class Sticker extends DiscordBase_1.DiscordBase {
7
7
  user;
8
8
  constructor(client, data) {
@@ -3,6 +3,7 @@ import type { VoiceStateResource } from '../cache/resources/voice-states';
3
3
  import { type GuildMemberStructure } from '../client/transformers';
4
4
  import type { ObjectToLower } from '../common';
5
5
  import type { APIVoiceState } from '../types';
6
+ import type { AllGuildVoiceChannels } from './channels';
6
7
  import { Base } from './extra/Base';
7
8
  export interface VoiceState extends Base, ObjectToLower<Omit<VoiceStateResource, 'member'>> {
8
9
  }
@@ -12,7 +13,7 @@ export declare class VoiceState extends Base {
12
13
  get isMuted(): boolean;
13
14
  member(force?: boolean): Promise<import("./GuildMember").GuildMember>;
14
15
  user(force?: boolean): Promise<import("./User").User>;
15
- channel(force?: boolean): Promise<import("./channels").BaseChannel<import("../types").ChannelType> | import("./channels").DMChannel | import("./channels").CategoryChannel | undefined>;
16
+ channel(force?: boolean): Promise<AllGuildVoiceChannels> | undefined;
16
17
  setMute(mute?: boolean, reason?: string): Promise<import("./GuildMember").GuildMember>;
17
18
  setDeaf(deaf?: boolean, reason?: string): Promise<import("./GuildMember").GuildMember>;
18
19
  setSuppress(suppress?: boolean): Promise<void>;
@@ -21,7 +21,7 @@ class VoiceState extends Base_1.Base {
21
21
  user(force) {
22
22
  return this.client.users.fetch(this.userId, force);
23
23
  }
24
- async channel(force) {
24
+ channel(force) {
25
25
  if (!this.channelId)
26
26
  return;
27
27
  return this.client.channels.fetch(this.channelId, force);
@@ -1,11 +1,11 @@
1
+ import { type AnonymousGuildStructure, type UserStructure } from '../client/transformers';
2
+ import type { UsingClient } from '../commands';
3
+ import type { ImageOptions, MessageWebhookCreateBodyRequest, MessageWebhookPayload, MessageWebhookUpdateBodyRequest, MethodContext, ObjectToLower } from '../common';
1
4
  /**
2
5
  * Represents a Discord webhook.
3
6
  */
4
7
  import type { APIWebhook, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery } from '../types';
5
- import type { UsingClient } from '../commands';
6
- import type { ImageOptions, MessageWebhookCreateBodyRequest, MessageWebhookPayload, MessageWebhookUpdateBodyRequest, MethodContext, ObjectToLower } from '../common';
7
8
  import { DiscordBase } from './extra/DiscordBase';
8
- import { type AnonymousGuildStructure, type UserStructure } from '../client/transformers';
9
9
  export interface Webhook extends DiscordBase, ObjectToLower<Omit<APIWebhook, 'user' | 'source_guild'>> {
10
10
  }
11
11
  /**
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Webhook = void 0;
4
- const DiscordBase_1 = require("./extra/DiscordBase");
5
4
  const transformers_1 = require("../client/transformers");
5
+ const DiscordBase_1 = require("./extra/DiscordBase");
6
6
  /**
7
7
  * Represents a Discord webhook.
8
8
  */
@@ -1,11 +1,11 @@
1
- import { type APIChannelBase, type RESTPatchAPIChannelJSONBody, type RESTPostAPIGuildChannelJSONBody, type RESTPatchAPIGuildChannelPositionsJSONBody, type APIGuildChannel, type RESTGetAPIChannelMessageReactionUsersQuery, type APITextChannel, type APIGuildForumTag, type ThreadAutoArchiveDuration, type APIGuildForumDefaultReactionEmoji, type SortOrderType, type RESTPostAPIGuildForumThreadsJSONBody, type RESTPostAPIChannelWebhookJSONBody, type APIDMChannel, type APIGuildVoiceChannel, type APIGuildStageVoiceChannel, type APIGuildMediaChannel, type APIGuildForumChannel, type APIThreadChannel, type APIGuildCategoryChannel, type APINewsChannel, ChannelType, VideoQualityMode } from '../types';
1
+ import { Collection, type RawFile } from '..';
2
+ import { type BaseChannelStructure, type BaseGuildChannelStructure, type CategoryChannelStructure, type DMChannelStructure, type DirectoryChannelStructure, type ForumChannelStructure, type MediaChannelStructure, type NewsChannelStructure, type StageChannelStructure, type TextGuildChannelStructure, type ThreadChannelStructure, type VoiceChannelStructure } from '../client/transformers';
2
3
  import type { UsingClient } from '../commands';
3
4
  import type { EmojiResolvable, MessageCreateBodyRequest, MessageUpdateBodyRequest, MethodContext, ObjectToLower, StringToNumber, ToClass } from '../common';
5
+ import { type APIChannelBase, type APIDMChannel, type APIGuildCategoryChannel, type APIGuildChannel, type APIGuildForumChannel, type APIGuildForumDefaultReactionEmoji, type APIGuildForumTag, type APIGuildMediaChannel, type APIGuildStageVoiceChannel, type APIGuildVoiceChannel, type APINewsChannel, type APITextChannel, type APIThreadChannel, ChannelType, type RESTGetAPIChannelMessageReactionUsersQuery, type RESTPatchAPIChannelJSONBody, type RESTPatchAPIGuildChannelPositionsJSONBody, type RESTPostAPIChannelWebhookJSONBody, type RESTPostAPIGuildChannelJSONBody, type RESTPostAPIGuildForumThreadsJSONBody, type SortOrderType, type ThreadAutoArchiveDuration, VideoQualityMode } from '../types';
4
6
  import type { GuildMember } from './GuildMember';
5
7
  import type { GuildRole } from './GuildRole';
6
8
  import { DiscordBase } from './extra/DiscordBase';
7
- import { Collection, type RawFile } from '..';
8
- import { type BaseChannelStructure, type BaseGuildChannelStructure, type CategoryChannelStructure, type DMChannelStructure, type DirectoryChannelStructure, type ForumChannelStructure, type MediaChannelStructure, type NewsChannelStructure, type StageChannelStructure, type TextGuildChannelStructure, type ThreadChannelStructure, type VoiceChannelStructure } from '../client/transformers';
9
9
  export declare class BaseChannel<T extends ChannelType> extends DiscordBase<APIChannelBase<ChannelType>> {
10
10
  type: T;
11
11
  constructor(client: UsingClient, data: APIChannelBase<ChannelType>);
@@ -35,7 +35,7 @@ export declare class BaseChannel<T extends ChannelType> extends DiscordBase<APIC
35
35
  guildId: string;
36
36
  }>): {
37
37
  list: (force?: boolean) => Promise<AllChannels[]>;
38
- fetch: (id: string, force?: boolean) => Promise<AllChannels>;
38
+ fetch: (id: string, force?: boolean) => Promise<APIGuildCategoryChannel | APIGuildStageVoiceChannel | APIGuildVoiceChannel | APINewsChannel | APITextChannel | BaseChannel<ChannelType> | DMChannel | CategoryChannel>;
39
39
  create: (body: RESTPostAPIGuildChannelJSONBody) => Promise<AllChannels>;
40
40
  delete: (id: string, reason?: string) => Promise<AllChannels>;
41
41
  edit: (id: string, body: RESTPatchAPIChannelJSONBody, reason?: string) => Promise<AllChannels>;
@@ -8,12 +8,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.DirectoryChannel = exports.NewsChannel = exports.CategoryChannel = exports.ThreadChannel = exports.ForumChannel = exports.MediaChannel = exports.StageChannel = exports.VoiceChannel = exports.DMChannel = exports.TextGuildChannel = exports.WebhookChannelMethods = exports.WebhookGuildMethods = exports.VoiceChannelMethods = exports.ThreadOnlyMethods = exports.TopicableGuildChannel = exports.TextBaseGuildChannel = exports.MessagesMethods = exports.BaseGuildChannel = exports.BaseChannel = void 0;
10
10
  exports.channelFrom = channelFrom;
11
- const types_1 = require("../types");
12
- const builders_1 = require("../builders");
13
- const DiscordBase_1 = require("./extra/DiscordBase");
14
11
  const __1 = require("..");
12
+ const builders_1 = require("../builders");
15
13
  const transformers_1 = require("../client/transformers");
16
14
  const mixer_1 = require("../deps/mixer");
15
+ const types_1 = require("../types");
16
+ const DiscordBase_1 = require("./extra/DiscordBase");
17
17
  class BaseChannel extends DiscordBase_1.DiscordBase {
18
18
  constructor(client, data) {
19
19
  super(client, data);
@@ -101,7 +101,7 @@ class BaseGuildChannel extends BaseChannel {
101
101
  }
102
102
  permissionOverwrites = {
103
103
  fetch: () => this.client.cache.overwrites?.get(this.id),
104
- values: () => (this.guildId ? this.client.cache.overwrites?.values(this.guildId) ?? [] : []),
104
+ values: () => (this.guildId ? (this.client.cache.overwrites?.values(this.guildId) ?? []) : []),
105
105
  };
106
106
  memberPermissions(member, checkAdmin = true) {
107
107
  return this.client.channels.memberPermissions(this.id, member, checkAdmin);
@@ -223,11 +223,12 @@ function channelFrom(data, client) {
223
223
  return transformers_1.Transformers.CategoryChannel(client, data);
224
224
  case types_1.ChannelType.GuildAnnouncement:
225
225
  return transformers_1.Transformers.NewsChannel(client, data);
226
- default:
226
+ default: {
227
227
  if ('guild_id' in data) {
228
228
  return transformers_1.Transformers.BaseGuildChannel(client, data);
229
229
  }
230
230
  return transformers_1.Transformers.BaseChannel(client, data);
231
+ }
231
232
  }
232
233
  }
233
234
  class TopicableGuildChannel extends DiscordBase_1.DiscordBase {
@@ -6,12 +6,12 @@ export declare class BitField<T extends object> {
6
6
  constructor(bitfields?: BitFieldResolvable<T>);
7
7
  set bits(bits: BitFieldResolvable<T>);
8
8
  get bits(): bigint;
9
- add(...bits: BitFieldResolvable<T>[]): bigint;
10
- remove(...bits: BitFieldResolvable<T>[]): bigint;
11
9
  has(...bits: BitFieldResolvable<T>[]): boolean;
12
10
  missings(...bits: BitFieldResolvable<T>[]): bigint[];
13
11
  equals(other: BitFieldResolvable<T>): boolean;
14
- resolve(bits?: BitFieldResolvable<T>): bigint;
15
12
  keys(bits?: BitFieldResolvable<T>[]): string[];
16
13
  values(bits?: BitFieldResolvable<T>[]): bigint[];
14
+ add(...bits: (BitFieldResolvable<T> | undefined)[]): bigint;
15
+ remove(...bits: BitFieldResolvable<T>[]): bigint;
16
+ resolve(bits: BitFieldResolvable<T>): bigint;
17
17
  }
@@ -15,20 +15,6 @@ class BitField {
15
15
  get bits() {
16
16
  return this.bit;
17
17
  }
18
- add(...bits) {
19
- let reduced = BitField.None;
20
- for (const bit of bits) {
21
- reduced |= this.resolve(bit);
22
- }
23
- return (this.bit |= reduced);
24
- }
25
- remove(...bits) {
26
- let reduced = BitField.None;
27
- for (const bit of bits) {
28
- reduced |= this.resolve(bit);
29
- }
30
- return (this.bit &= ~reduced);
31
- }
32
18
  has(...bits) {
33
19
  const bitsResolved = bits.map(bit => this.resolve(bit));
34
20
  return bitsResolved.every(bit => (this.bits & bit) === bit);
@@ -40,25 +26,8 @@ class BitField {
40
26
  equals(other) {
41
27
  return this.bits === this.resolve(other);
42
28
  }
43
- resolve(bits) {
44
- switch (typeof bits) {
45
- case 'number':
46
- return BigInt(bits);
47
- case 'string':
48
- return this.resolve(this.Flags[bits]);
49
- case 'bigint':
50
- return bits;
51
- case 'object':
52
- if (!Array.isArray(bits)) {
53
- throw new TypeError(`Cannot resolve permission: ${bits}`);
54
- }
55
- return bits.map(x => this.resolve(x)).reduce((acc, cur) => acc | cur, BitField.None);
56
- default:
57
- throw new TypeError(`Cannot resolve permission: ${typeof bits === 'symbol' ? String(bits) : bits}`);
58
- }
59
- }
60
29
  keys(bits = [this.bits]) {
61
- const bitsResolved = bits.map(bit => BigInt(this.resolve(bit)));
30
+ const bitsResolved = bits.map(bit => this.resolve(bit));
62
31
  return Object.entries(this.Flags).reduce((acc, value) => {
63
32
  if (bitsResolved.some(bit => (bit & value[1]) === value[1])) {
64
33
  acc.push(value[0]);
@@ -68,7 +37,7 @@ class BitField {
68
37
  }, []);
69
38
  }
70
39
  values(bits = [this.bits]) {
71
- const bitsResolved = bits.map(bit => BigInt(this.resolve(bit)));
40
+ const bitsResolved = bits.map(bit => this.resolve(bit));
72
41
  return Object.entries(this.Flags).reduce((acc, value) => {
73
42
  if (bitsResolved.some(bit => (bit & value[1]) === value[1])) {
74
43
  acc.push(value[1]);
@@ -77,5 +46,37 @@ class BitField {
77
46
  return acc;
78
47
  }, []);
79
48
  }
49
+ add(...bits) {
50
+ for (const bit of bits) {
51
+ if (!bit)
52
+ continue;
53
+ this.bits |= this.resolve(bit);
54
+ }
55
+ return this.bits;
56
+ }
57
+ remove(...bits) {
58
+ for (const bit of bits) {
59
+ this.bits &= ~this.resolve(bit);
60
+ }
61
+ return this.bits;
62
+ }
63
+ resolve(bits) {
64
+ switch (typeof bits) {
65
+ case 'string':
66
+ return this.resolve(this.Flags[bits]);
67
+ case 'number':
68
+ return BigInt(bits);
69
+ case 'bigint':
70
+ return bits;
71
+ case 'object': {
72
+ if (!Array.isArray(bits)) {
73
+ throw new TypeError(`Cannot resolve permission: ${bits}`);
74
+ }
75
+ return bits.map(x => this.resolve(x)).reduce((acc, cur) => acc | cur, BitField.None);
76
+ }
77
+ default:
78
+ throw new TypeError(`Cannot resolve permission: ${typeof bits === 'symbol' ? String(bits) : bits}`);
79
+ }
80
+ }
80
81
  }
81
82
  exports.BitField = BitField;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DiscordBase = void 0;
4
- const Base_1 = require("./Base");
5
4
  const utils_1 = require("../../common/it/utils");
5
+ const Base_1 = require("./Base");
6
6
  class DiscordBase extends Base_1.Base {
7
7
  id;
8
8
  constructor(client,
@@ -59,4 +59,6 @@ export declare class PermissionsBitField extends BitField<typeof PermissionFlags
59
59
  keys: (bits?: BitFieldResolvable<typeof PermissionFlagsBits>[]) => PermissionStrings;
60
60
  has(...bits: BitFieldResolvable<typeof PermissionFlagsBits>[]): boolean;
61
61
  strictHas(...bits: BitFieldResolvable<typeof PermissionFlagsBits>[]): boolean;
62
+ resolve<T extends typeof PermissionFlagsBits>(bits: BitFieldResolvable<T>): bigint;
63
+ static resolve<T extends typeof PermissionFlagsBits>(bits: BitFieldResolvable<T>): bigint;
62
64
  }
@@ -17,5 +17,26 @@ class PermissionsBitField extends BitField_1.BitField {
17
17
  strictHas(...bits) {
18
18
  return super.has(...bits);
19
19
  }
20
+ resolve(bits) {
21
+ return PermissionsBitField.resolve(bits);
22
+ }
23
+ static resolve(bits) {
24
+ switch (typeof bits) {
25
+ case 'string':
26
+ return PermissionsBitField.resolve(types_1.PermissionFlagsBits[bits]);
27
+ case 'number':
28
+ return BigInt(bits);
29
+ case 'bigint':
30
+ return bits;
31
+ case 'object': {
32
+ if (!Array.isArray(bits)) {
33
+ throw new TypeError(`Cannot resolve permission: ${bits}`);
34
+ }
35
+ return bits.map(x => PermissionsBitField.resolve(x)).reduce((acc, cur) => acc | cur, BitField_1.BitField.None);
36
+ }
37
+ default:
38
+ throw new TypeError(`Cannot resolve permission: ${typeof bits === 'symbol' ? String(bits) : bits}`);
39
+ }
40
+ }
20
41
  }
21
42
  exports.PermissionsBitField = PermissionsBitField;
@@ -1,6 +1,7 @@
1
- import type { Snowflake, ChannelType, GatewayDispatchEvents, GatewayOpcodes } from './index';
1
+ import type { ChannelType, GatewayDispatchEvents, GatewayOpcodes, Snowflake } from './index';
2
2
  import type { GatewayPresenceUpdate } from './payloads/gateway';
3
- import type { APIApplication, APIApplicationCommandPermission, APIAutoModerationRule, APIAutoModerationAction, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, APIRole, APIStageInstance, APISticker, APIThreadChannel, APIThreadMember, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayThreadListSync as RawGatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate, APIVoiceState, InviteTargetType, PresenceUpdateStatus, AutoModerationRuleTriggerType, APIAuditLogEntry, APIEntitlement, APIPartialEmoji, APISubscription } from './payloads/index';
3
+ import type { APIApplication, APIApplicationCommandPermission, APIAuditLogEntry, APIAutoModerationAction, APIAutoModerationRule, APIChannel, APIEmoji, APIEntitlement, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, APIPartialEmoji, APIRole, APIStageInstance, APISticker, APISubscription, APIThreadChannel, APIThreadMember, APIUnavailableGuild, APIUser, APIVoiceState, AutoModerationRuleTriggerType, GatewayActivity, InviteTargetType, PresenceUpdateStatus, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayThreadListSync as RawGatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate } from './payloads/index';
4
+ import type { APISoundBoard } from './payloads/soundboard';
4
5
  import type { ReactionType } from './rest/index';
5
6
  import type { AnimationTypes, Nullable } from './utils';
6
7
  /**
@@ -14,9 +15,9 @@ export interface GatewayURLQuery {
14
15
  /**
15
16
  * Types extracted from https://discord.com/developers/docs/topics/gateway
16
17
  */
17
- export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate;
18
+ export type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayRequestGuildMembers | GatewayResume | GatewayUpdatePresence | GatewayVoiceStateUpdate | GatewayRequestSoundboardSounds;
18
19
  export type GatewayReceivePayload = GatewayDispatchPayload | GatewayHeartbeatAck | GatewayHeartbeatRequest | GatewayHello | GatewayInvalidSession | GatewayReconnect;
19
- export type GatewayDispatchPayload = GatewayApplicationCommandPermissionsUpdateDispatch | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayEntitlementModifyDispatch | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch | GatewayGuildScheduledEventDeleteDispatch | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessagePollVoteAddDispatch | GatewayMessagePollVoteRemoveDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewayThreadCreateDispatch | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch;
20
+ export type GatewayDispatchPayload = GatewayApplicationCommandPermissionsUpdateDispatch | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayEntitlementModifyDispatch | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch | GatewayGuildScheduledEventDeleteDispatch | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessagePollVoteAddDispatch | GatewayMessagePollVoteRemoveDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewayThreadCreateDispatch | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch | GatewayGuildSoundboardSoundCreateDispatch | GatewayGuildSoundboardSoundDeleteDispatch | GatewayGuildSoundboardSoundUpdateDispatch | GatewayGuildSoundboardSoundsUpdateDispatch | GatewaySoundboardSoundsDispatch;
20
21
  /**
21
22
  * https://discord.com/developers/docs/topics/gateway-events#hello
22
23
  */
@@ -403,7 +404,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
403
404
  *
404
405
  * See https://discord.com/developers/docs/resources/channel#channel-object
405
406
  */
406
- threads: APIChannel[];
407
+ threads: APIThreadChannel[];
407
408
  /**
408
409
  * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
409
410
  *
@@ -428,6 +429,14 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
428
429
  * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
429
430
  */
430
431
  guild_scheduled_events: APIGuildScheduledEvent[];
432
+ /**
433
+ * Soundboard sounds in the guild
434
+ *
435
+ * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
436
+ *
437
+ * https://discord.com/developers/docs/resources/soundboard
438
+ */
439
+ soundboard_sounds: APISoundBoard[];
431
440
  }
432
441
  /**
433
442
  * https://discord.com/developers/docs/topics/gateway-events#guild-update
@@ -697,6 +706,31 @@ export interface GatewayGuildScheduledEventUserRemoveDispatchData {
697
706
  user_id: Snowflake;
698
707
  guild_id: Snowflake;
699
708
  }
709
+ export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundBoard;
710
+ export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<GatewayDispatchEvents.GuildSoundboardSoundCreate, GatewayGuildSoundboardSoundCreateDispatchData>;
711
+ export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundBoard;
712
+ export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildSoundboardSoundUpdate, GatewayGuildSoundboardSoundUpdateDispatchData>;
713
+ export interface GatewayGuildSoundboardSoundDeleteDispatchData {
714
+ /** ID of the sound that was deleted */
715
+ sound_id: string;
716
+ /** ID of the guild the sound was in */
717
+ guild_id: string;
718
+ }
719
+ export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildSoundboardSoundDelete, GatewayGuildSoundboardSoundDeleteDispatchData>;
720
+ export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
721
+ /** The guild's soundboard sound */
722
+ soundboard_sounds: APISoundBoard[];
723
+ /** ID of the guild */
724
+ guild_id: string;
725
+ }
726
+ export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<GatewayDispatchEvents.GuildSoundboardSoundsUpdate, GatewayGuildSoundboardSoundsUpdateDispatchData>;
727
+ export interface GatewaySoundboardSoundsDispatchData {
728
+ /** The guild's soundboard sounds */
729
+ soundboard_sounds: APISoundBoard[];
730
+ /** ID of the guild */
731
+ guild_id: string;
732
+ }
733
+ export type GatewaySoundboardSoundsDispatch = DataPayload<GatewayDispatchEvents.SoundboardSounds, GatewaySoundboardSoundsDispatchData>;
700
734
  /**
701
735
  * https://discord.com/developers/docs/topics/gateway-events#integration-create
702
736
  */
@@ -1400,6 +1434,20 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG
1400
1434
  * https://discord.com/developers/docs/topics/gateway-events#request-guild-members
1401
1435
  */
1402
1436
  export type GatewayRequestGuildMembersData = GatewayRequestGuildMembersDataWithQuery | GatewayRequestGuildMembersDataWithUserIds;
1437
+ /**
1438
+ * https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
1439
+ */
1440
+ export interface GatewayRequestSoundboardSounds {
1441
+ op: GatewayOpcodes.RequestSoundboardSounds;
1442
+ d: GatewayRequestSoundboardSoundsData;
1443
+ }
1444
+ /**
1445
+ * https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds-request-soundboard-sounds-structure
1446
+ */
1447
+ export interface GatewayRequestSoundboardSoundsData {
1448
+ /** IDs of the guilds to get soundboard sounds for */
1449
+ guild_ids: string[];
1450
+ }
1403
1451
  /**
1404
1452
  * https://discord.com/developers/docs/topics/gateway-events#update-voice-state
1405
1453
  */
@@ -1,4 +1,4 @@
1
- import type { InteractionContextType, ApplicationIntegrationType } from '..';
1
+ import type { ApplicationIntegrationType, InteractionContextType } from '..';
2
2
  import type { ChannelType, Snowflake } from '../..';
3
3
  import type { LocaleString } from '../../rest';
4
4
  import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadChannel, ThreadChannelType } from '../channel';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Types extracted from https://discord.com/developers/docs/resources/channel
3
3
  */
4
- import type { Permissions, Snowflake, ChannelType, OverwriteType, VideoQualityMode } from '../index';
4
+ import type { ChannelType, OverwriteType, Permissions, Snowflake, VideoQualityMode } from '../index';
5
5
  import type { APIApplication } from './application';
6
6
  import type { APIPartialEmoji } from './emoji';
7
7
  import type { APIGuildMember } from './guild';
@@ -520,7 +520,7 @@ export interface APIMessage {
520
520
  /**
521
521
  * Sent if a thread was started from this message
522
522
  */
523
- thread?: APIChannel;
523
+ thread?: APIThreadChannel;
524
524
  /**
525
525
  * Sent if the message contains components like buttons, action rows, or other interactive components
526
526
  *