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
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Types extracted from https://discord.com/developers/docs/resources/guild
3
3
  */
4
- import type { Permissions, Snowflake, GuildMemberFlags } from '../index';
4
+ import type { GuildMemberFlags, Permissions, Snowflake } from '../index';
5
5
  import type { APIEmoji, APIPartialEmoji } from './emoji';
6
6
  import type { PresenceUpdateReceiveStatus } from './gateway';
7
7
  import type { OAuth2Scopes } from './oauth2';
@@ -458,6 +458,10 @@ export declare enum GuildFeature {
458
458
  * Guild has enabled Membership Screening
459
459
  */
460
460
  MemberVerificationGateEnabled = "MEMBER_VERIFICATION_GATE_ENABLED",
461
+ /**
462
+ * Guild has increased custom soundboard sound slots
463
+ */
464
+ MoreSoundboard = "MORE_SOUNDBOARD",
461
465
  /**
462
466
  * Guild has enabled monetization
463
467
  *
@@ -501,6 +505,10 @@ export declare enum GuildFeature {
501
505
  * Guild has enabled role subscriptions
502
506
  */
503
507
  RoleSubscriptionsEnabled = "ROLE_SUBSCRIPTIONS_ENABLED",
508
+ /**
509
+ * Guild has created soundboard sounds
510
+ */
511
+ Soundboard = "SOUNDBOARD",
504
512
  /**
505
513
  * Guild has enabled ticketed events
506
514
  */
@@ -194,6 +194,10 @@ var GuildFeature;
194
194
  * Guild has enabled Membership Screening
195
195
  */
196
196
  GuildFeature["MemberVerificationGateEnabled"] = "MEMBER_VERIFICATION_GATE_ENABLED";
197
+ /**
198
+ * Guild has increased custom soundboard sound slots
199
+ */
200
+ GuildFeature["MoreSoundboard"] = "MORE_SOUNDBOARD";
197
201
  /**
198
202
  * Guild has enabled monetization
199
203
  *
@@ -237,6 +241,10 @@ var GuildFeature;
237
241
  * Guild has enabled role subscriptions
238
242
  */
239
243
  GuildFeature["RoleSubscriptionsEnabled"] = "ROLE_SUBSCRIPTIONS_ENABLED";
244
+ /**
245
+ * Guild has created soundboard sounds
246
+ */
247
+ GuildFeature["Soundboard"] = "SOUNDBOARD";
240
248
  /**
241
249
  * Guild has enabled ticketed events
242
250
  */
@@ -19,6 +19,7 @@ export * from './user';
19
19
  export * from './voice';
20
20
  export * from './webhook';
21
21
  export * from './monetization';
22
+ export * from './soundboard';
22
23
  import type { LocaleString } from '../rest';
23
24
  export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
24
25
  /**
@@ -35,3 +35,4 @@ __exportStar(require("./user"), exports);
35
35
  __exportStar(require("./voice"), exports);
36
36
  __exportStar(require("./webhook"), exports);
37
37
  __exportStar(require("./monetization"), exports);
38
+ __exportStar(require("./soundboard"), exports);
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Types extracted from https://discord.com/developers/docs/resources/soundboard
3
+ */
4
+ import type { APIUser } from './user';
5
+ /** https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object-soundboard-sound-structure */
6
+ export interface APISoundBoard {
7
+ /** the name of this sound */
8
+ name: string;
9
+ /** the id of this sound */
10
+ sound_id: string;
11
+ /** the volume of this sound, from 0 to 1 */
12
+ volume: number;
13
+ /** the id of this sound's custom emoji */
14
+ emoji_id: string | null;
15
+ /** the unicode character of this sound's standard emoji */
16
+ emoji_name: string | null;
17
+ /** the id of the guild this sound is in */
18
+ guild_id?: string;
19
+ /** whether this sound can be used, may be false due to loss of Server Boosts */
20
+ available: boolean;
21
+ /** the user who created this sound */
22
+ user?: APIUser;
23
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Types extracted from https://discord.com/developers/docs/resources/soundboard
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -149,7 +149,6 @@ var ConnectionService;
149
149
  /**
150
150
  * @deprecated This is the old name for {@apilink ConnectionService#X}
151
151
  */
152
- // biome-ignore lint/correctness/noUndeclaredVariables: biome bug lol
153
152
  ConnectionService["Twitter"] = "twitter";
154
153
  ConnectionService["Xbox"] = "xbox";
155
154
  ConnectionService["YouTube"] = "youtube";
@@ -1,6 +1,6 @@
1
- import type { APIApplicationRoleConnectionMetadata, APIApplication, APIEmoji } from '../payloads';
2
- import type { StrictPartial, Nullable } from '../utils';
3
- import type { RESTPostAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody } from './emoji';
1
+ import type { APIApplication, APIApplicationRoleConnectionMetadata, APIEmoji } from '../payloads';
2
+ import type { Nullable, StrictPartial } from '../utils';
3
+ import type { RESTPatchAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiJSONBody } from './emoji';
4
4
  /**
5
5
  * https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
6
6
  */
@@ -1,5 +1,5 @@
1
1
  import type { Snowflake } from '..';
2
- import type { AuditLogEvent, APIAuditLog } from '../payloads';
2
+ import type { APIAuditLog, AuditLogEvent } from '../payloads';
3
3
  /**
4
4
  * https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
5
5
  */
@@ -1,5 +1,5 @@
1
- import type { Snowflake, ChannelType, VideoQualityMode, OverwriteType, Permissions } from '..';
2
- import type { APIChannel, ThreadAutoArchiveDuration, ChannelFlags, APIGuildForumTag, APIGuildForumDefaultReactionEmoji, SortOrderType, ForumLayoutType, APIMessage, APIMessageReference, APIEmbed, APIAllowedMentions, APIActionRowComponent, APIMessageActionRowComponent, MessageFlags, APIUser, APIExtendedInvite, InviteTargetType, APIFollowedChannel, ThreadChannelType, APIThreadMember, APIThreadList, APIAttachment } from '../payloads';
1
+ import type { ChannelType, OverwriteType, Permissions, Snowflake, VideoQualityMode } from '..';
2
+ import type { APIActionRowComponent, APIAllowedMentions, APIAttachment, APIChannel, APIEmbed, APIExtendedInvite, APIFollowedChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIMessage, APIMessageActionRowComponent, APIMessageReference, APIThreadList, APIThreadMember, APIUser, ChannelFlags, ForumLayoutType, InviteTargetType, MessageFlags, SortOrderType, ThreadAutoArchiveDuration, ThreadChannelType } from '../payloads';
3
3
  import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../utils';
4
4
  import type { RESTAPIPollCreate } from './poll';
5
5
  export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
@@ -1,6 +1,6 @@
1
1
  import type { Snowflake } from '..';
2
- import type { APIChannel, APIDMChannel, APIGroupDMChannel, GuildVerificationLevel, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildSystemChannelFlags, APIGuild, GuildMFALevel, APIGuildPreview, GuildFeature, APIThreadList, APIGuildMember, APIBan, APIRole, APIVoiceRegion, APIExtendedInvite, APIGuildIntegration, APIGuildWidgetSettings, APIGuildWidget, GuildWidgetStyle, APIGuildMembershipScreening, APIGuildWelcomeScreen, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption } from '../payloads';
3
- import type { StrictPartial, DistributivePick, DistributiveOmit, StrictRequired, Nullable, AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../utils';
2
+ import type { APIBan, APIChannel, APIDMChannel, APIExtendedInvite, APIGroupDMChannel, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildMembershipScreening, APIGuildOnboarding, APIGuildOnboardingPrompt, APIGuildOnboardingPromptOption, APIGuildPreview, APIGuildWelcomeScreen, APIGuildWidget, APIGuildWidgetSettings, APIRole, APIThreadList, APIVoiceRegion, GuildDefaultMessageNotifications, GuildExplicitContentFilter, GuildFeature, GuildMFALevel, GuildSystemChannelFlags, GuildVerificationLevel, GuildWidgetStyle } from '../payloads';
3
+ import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, DistributiveOmit, DistributivePick, Nullable, StrictPartial, StrictRequired } from '../utils';
4
4
  import type { RESTPutAPIChannelPermissionJSONBody } from './channel';
5
5
  export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
6
6
  id: number | string;
@@ -1,5 +1,5 @@
1
1
  import type { Snowflake } from '..';
2
- import type { APIGuildScheduledEvent, GuildScheduledEventPrivacyLevel, GuildScheduledEventEntityType, APIGuildScheduledEventEntityMetadata, GuildScheduledEventStatus, APIGuildScheduledEventUser } from '../payloads';
2
+ import type { APIGuildScheduledEvent, APIGuildScheduledEventEntityMetadata, APIGuildScheduledEventUser, GuildScheduledEventEntityType, GuildScheduledEventPrivacyLevel, GuildScheduledEventStatus } from '../payloads';
3
3
  import type { StrictPartial } from '../utils';
4
4
  /**
5
5
  * https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
@@ -18,6 +18,7 @@ export * from './user';
18
18
  export * from './voice';
19
19
  export * from './webhook';
20
20
  export * from './monetization';
21
+ export * from './soundboard';
21
22
  export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
22
23
  export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
23
24
  export type GuildIconFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
@@ -34,6 +34,7 @@ __exportStar(require("./user"), exports);
34
34
  __exportStar(require("./voice"), exports);
35
35
  __exportStar(require("./webhook"), exports);
36
36
  __exportStar(require("./monetization"), exports);
37
+ __exportStar(require("./soundboard"), exports);
37
38
  /**
38
39
  * https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
39
40
  */
@@ -1,5 +1,5 @@
1
1
  import type { Snowflake } from '..';
2
- import type { APIApplication, OAuth2Scopes, APIUser, APIGuild, APIWebhook } from '../payloads';
2
+ import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../payloads';
3
3
  /**
4
4
  * https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information
5
5
  */
@@ -1,4 +1,4 @@
1
- import type { Snowflake, APIMessage, APIPoll, APIPollAnswer, APIUser } from '../index';
1
+ import type { APIMessage, APIPoll, APIPollAnswer, APIUser, Snowflake } from '../index';
2
2
  /**
3
3
  * https://discord.com/developers/docs/resources/poll#get-answer-voters
4
4
  */
@@ -0,0 +1,64 @@
1
+ import type { APISoundBoard } from '../payloads/soundboard';
2
+ /**
3
+ * https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
4
+ * @fires VoiceChannelEffectSend
5
+ * @requires Permissions Speak and UseSoundboard
6
+ * @satisfies VoiceState without deaf, self_deaf, mute, or suppress enabled.
7
+ */
8
+ export interface RESTPostAPISendSoundboardSound {
9
+ /** the id of the soundboard sound to play */
10
+ sound_id: string;
11
+ /** the id of the guild the soundboard sound is from, required to play sounds from different servers */
12
+ source_guild_id?: string;
13
+ }
14
+ /**
15
+ * https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds
16
+ */
17
+ export type RESTGetAPIDefaultsSoundboardSoundsResult = Omit<APISoundBoard, 'user' | 'guild_id'>[];
18
+ /**
19
+ * https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
20
+ */
21
+ export type RESTGetAPIGuildSoundboardSoundsResult = {
22
+ items: APISoundBoard[];
23
+ };
24
+ /**
25
+ * https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
26
+ *
27
+ * Soundboard sounds have a max file size of 512kb and a max duration of 5.2 seconds.
28
+ * This endpoint supports the X-Audit-Log-Reason header.
29
+ * @requires Permission CreateGuildExpressions
30
+ */
31
+ export interface RESTPostAPIGuildSoundboardSound {
32
+ /** name of the soundboard sound (2-32 characters) */
33
+ name: string;
34
+ /** the mp3 or ogg sound data, base64 encoded, similar to image data */
35
+ sound: string;
36
+ /** the volume of the soundboard sound, from 0 to 1, defaults to 1 */
37
+ volume?: number | null;
38
+ /** the id of the custom emoji for the soundboard sound */
39
+ emoji_id?: string | null;
40
+ /** the unicode character of a standard emoji for the soundboard sound */
41
+ emoji_name?: string | null;
42
+ }
43
+ export type RESTPostAPIGuildSoundboardSoundResult = APISoundBoard;
44
+ /**
45
+ * https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
46
+ * @fires GuildSoundboardSoundUpdate
47
+ */
48
+ export interface RESTPatchAPIGuildSoundboardSound {
49
+ /** name of the soundboard sound (2-32 characters) */
50
+ name?: string;
51
+ /** the volume of the soundboard sound, from 0 to 1, defaults to 1 */
52
+ volume?: number | null;
53
+ /** the id of the custom emoji for the soundboard sound */
54
+ emoji_id?: string | null;
55
+ /** the unicode character of a standard emoji for the soundboard sound */
56
+ emoji_name?: string | null;
57
+ }
58
+ export type RESTPatchAPIGuildSoundboardSoundResult = APISoundBoard;
59
+ /**
60
+ * https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
61
+ * This endpoint supports the X-Audit-Log-Reason header.
62
+ * @fires GuildSoundboardSoundDelete
63
+ */
64
+ export type RESTDeleteAPIGuildSoundboardSoundResult = never;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
1
  import type { Snowflake } from '..';
2
- import type { StageInstancePrivacyLevel, APIStageInstance } from '../payloads';
2
+ import type { APIStageInstance, StageInstancePrivacyLevel } from '../payloads';
3
3
  /**
4
4
  * https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
5
5
  */
@@ -1,4 +1,4 @@
1
- import type { APITemplate, APIGuild } from '../payloads';
1
+ import type { APIGuild, APITemplate } from '../payloads';
2
2
  import type { StrictPartial } from '../utils';
3
3
  /**
4
4
  * https://discord.com/developers/docs/resources/guild-template#get-guild-template
@@ -1,5 +1,5 @@
1
1
  import type { Snowflake } from '..';
2
- import type { APIUser, APIGuildMember, GuildFeature, APIChannel, APIConnection, APIApplicationRoleConnection } from '../payloads';
2
+ import type { APIApplicationRoleConnection, APIChannel, APIConnection, APIGuildMember, APIUser, GuildFeature } from '../payloads';
3
3
  /**
4
4
  * https://discord.com/developers/docs/resources/user#get-current-user
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import type { Snowflake } from '..';
2
- import type { APIWebhook, APIEmbed, APIAllowedMentions, APIActionRowComponent, APIMessageActionRowComponent, MessageFlags, APIMessage } from '../payloads';
2
+ import type { APIActionRowComponent, APIAllowedMentions, APIEmbed, APIMessage, APIMessageActionRowComponent, APIWebhook, MessageFlags } from '../payloads';
3
3
  import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../utils';
4
4
  import type { RESTAPIAttachment } from './channel';
5
5
  import type { RESTAPIPollCreate } from './poll';
@@ -167,7 +167,11 @@ export declare enum GatewayOpcodes {
167
167
  /**
168
168
  * Sent in response to receiving a heartbeat to acknowledge that it has been received
169
169
  */
170
- HeartbeatAck = 11
170
+ HeartbeatAck = 11,
171
+ /**
172
+ * Used to request soundboard sounds for a list of guilds. The server will send Soundboard Sounds events for each guild in response.
173
+ */
174
+ RequestSoundboardSounds = 31
171
175
  }
172
176
  /**
173
177
  * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
@@ -262,7 +266,7 @@ export declare enum GatewayIntentBits {
262
266
  * @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
263
267
  */
264
268
  GuildBans = 4,
265
- GuildEmojisAndStickers = 8,
269
+ GuildExpressions = 8,
266
270
  GuildIntegrations = 16,
267
271
  GuildWebhooks = 32,
268
272
  GuildInvites = 64,
@@ -347,6 +351,11 @@ export declare enum GatewayDispatchEvents {
347
351
  GuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE",
348
352
  GuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD",
349
353
  GuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE",
354
+ GuildSoundboardSoundCreate = "GUILD_SOUNDBOARD_SOUND_CREATE",
355
+ GuildSoundboardSoundUpdate = "GUILD_SOUNDBOARD_SOUND_UPDATE",
356
+ GuildSoundboardSoundDelete = "GUILD_SOUNDBOARD_SOUND_DELETE",
357
+ GuildSoundboardSoundsUpdate = "GUILD_SOUNDBOARD_SOUNDS_UPDATE",
358
+ SoundboardSounds = "SOUNDBOARD_SOUNDS",
350
359
  AutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE",
351
360
  AutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE",
352
361
  AutoModerationRuleDelete = "AUTO_MODERATION_RULE_DELETE",
@@ -153,6 +153,10 @@ var GatewayOpcodes;
153
153
  * Sent in response to receiving a heartbeat to acknowledge that it has been received
154
154
  */
155
155
  GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck";
156
+ /**
157
+ * Used to request soundboard sounds for a list of guilds. The server will send Soundboard Sounds events for each guild in response.
158
+ */
159
+ GatewayOpcodes[GatewayOpcodes["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds";
156
160
  })(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
157
161
  /**
158
162
  * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
@@ -248,9 +252,8 @@ var GatewayIntentBits;
248
252
  /**
249
253
  * @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
250
254
  */
251
- // biome-ignore lint/correctness/noUndeclaredVariables: no reason lmao
252
255
  GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
253
- GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers";
256
+ GatewayIntentBits[GatewayIntentBits["GuildExpressions"] = 8] = "GuildExpressions";
254
257
  GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
255
258
  GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks";
256
259
  GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites";
@@ -336,6 +339,11 @@ var GatewayDispatchEvents;
336
339
  GatewayDispatchEvents["GuildScheduledEventDelete"] = "GUILD_SCHEDULED_EVENT_DELETE";
337
340
  GatewayDispatchEvents["GuildScheduledEventUserAdd"] = "GUILD_SCHEDULED_EVENT_USER_ADD";
338
341
  GatewayDispatchEvents["GuildScheduledEventUserRemove"] = "GUILD_SCHEDULED_EVENT_USER_REMOVE";
342
+ GatewayDispatchEvents["GuildSoundboardSoundCreate"] = "GUILD_SOUNDBOARD_SOUND_CREATE";
343
+ GatewayDispatchEvents["GuildSoundboardSoundUpdate"] = "GUILD_SOUNDBOARD_SOUND_UPDATE";
344
+ GatewayDispatchEvents["GuildSoundboardSoundDelete"] = "GUILD_SOUNDBOARD_SOUND_DELETE";
345
+ GatewayDispatchEvents["GuildSoundboardSoundsUpdate"] = "GUILD_SOUNDBOARD_SOUNDS_UPDATE";
346
+ GatewayDispatchEvents["SoundboardSounds"] = "SOUNDBOARD_SOUNDS";
339
347
  GatewayDispatchEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE";
340
348
  GatewayDispatchEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE";
341
349
  GatewayDispatchEvents["AutoModerationRuleDelete"] = "AUTO_MODERATION_RULE_DELETE";
@@ -1,6 +1,7 @@
1
1
  import type { RestToKeys } from '../common';
2
- import type { GatewayActivity, PresenceUpdateStatus, GatewayPresenceUpdateData, GatewayRequestGuildMembersDataWithQuery, GatewayRequestGuildMembersDataWithUserIds, APIGuildMember, APIUser, GatewayReadyDispatchData, GatewayChannelUpdateDispatchData, GatewayAutoModerationActionExecutionDispatchData, GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSyncDispatchData, GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayGuildCreateDispatchData, APIGuild, GatewayGuildDeleteDispatchData, APIAuditLogEntry, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayIntegrationDeleteDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, GatewayMessageUpdateDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayPresenceUpdateDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, GatewayVoiceStateUpdateData, GatewayVoiceServerUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GatewayInteractionCreateDispatchData, APIStageInstance, GatewayMessagePollVoteDispatchData, GatewayIntegrationCreateDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, APIGuildScheduledEvent, APIChannel, APIAutoModerationRule, APIEntitlement, GatewayVoiceChannelEffectSendDispachData, APISubscription, GatewayEntitlementCreateDispatchData } from '../types';
2
+ import type { APIAuditLogEntry, APIAutoModerationRule, APIChannel, APIEntitlement, APIGuild, APIGuildMember, APIGuildScheduledEvent, APIStageInstance, APISubscription, APIUser, GatewayActivity, GatewayAutoModerationActionExecutionDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayChannelUpdateDispatchData, GatewayEntitlementCreateDispatchData, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, GatewayGuildCreateDispatchData, GatewayGuildDeleteDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildSoundboardSoundDeleteDispatchData, GatewayGuildSoundboardSoundsUpdateDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayInteractionCreateDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageDeleteDispatchData, GatewayMessagePollVoteDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, GatewayPresenceUpdateData, GatewayPresenceUpdateDispatchData, GatewayReadyDispatchData, GatewayRequestGuildMembersDataWithQuery, GatewayRequestGuildMembersDataWithUserIds, GatewaySoundboardSoundsDispatchData, GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSyncDispatchData, GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, GatewayVoiceChannelEffectSendDispachData, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateData, GatewayWebhooksUpdateDispatchData, PresenceUpdateStatus } from '../types';
3
3
  import { GatewayDispatchEvents } from '../types';
4
+ import type { APISoundBoard } from '../types/payloads/soundboard';
4
5
  /** https://discord.com/developers/docs/topics/gateway-events#update-presence */
5
6
  export interface StatusUpdate {
6
7
  /** The user's activities */
@@ -55,6 +56,9 @@ export interface Events {
55
56
  [GatewayDispatchEvents.GuildEmojisUpdate]: GatewayGuildEmojisUpdateDispatchData;
56
57
  [GatewayDispatchEvents.GuildStickersUpdate]: GatewayGuildStickersUpdateDispatchData;
57
58
  [GatewayDispatchEvents.GuildIntegrationsUpdate]: GatewayGuildIntegrationsUpdateDispatchData;
59
+ [GatewayDispatchEvents.GuildSoundboardSoundsUpdate]: GatewayGuildSoundboardSoundsUpdateDispatchData;
60
+ [GatewayDispatchEvents.GuildSoundboardSoundDelete]: GatewayGuildSoundboardSoundDeleteDispatchData;
61
+ [GatewayDispatchEvents.SoundboardSounds]: GatewaySoundboardSoundsDispatchData;
58
62
  [GatewayDispatchEvents.GuildMemberAdd]: GatewayGuildMemberAddDispatchData;
59
63
  [GatewayDispatchEvents.GuildMemberRemove]: GatewayGuildMemberRemoveDispatchData;
60
64
  [GatewayDispatchEvents.GuildMemberUpdate]: GatewayGuildMemberUpdateDispatchData;
@@ -133,7 +137,12 @@ export type SubscriptionEvents = RestToKeys<[
133
137
  GatewayDispatchEvents.SubscriptionDelete,
134
138
  GatewayDispatchEvents.SubscriptionUpdate
135
139
  ]>;
136
- export type NormalizeEvents = Events & AutoModetaractionRuleEvents & ChannelSameEvents & GuildScheduledSameEvents & GuildScheduledUserSameEvents & IntegrationSameEvents & EntitlementEvents & PollVoteSameEvents & StageSameEvents & SubscriptionEvents & {
140
+ export type SoundboardSoundsEvents = RestToKeys<[
141
+ APISoundBoard,
142
+ GatewayDispatchEvents.GuildSoundboardSoundCreate,
143
+ GatewayDispatchEvents.GuildSoundboardSoundUpdate
144
+ ]>;
145
+ export type NormalizeEvents = Events & AutoModetaractionRuleEvents & ChannelSameEvents & GuildScheduledSameEvents & GuildScheduledUserSameEvents & IntegrationSameEvents & EntitlementEvents & PollVoteSameEvents & StageSameEvents & SubscriptionEvents & SoundboardSoundsEvents & {
137
146
  RAW: GatewayDispatchEvents;
138
147
  };
139
148
  export type GatewayEvents = {
@@ -17,24 +17,14 @@ const ShardManagerDefaults = {
17
17
  properties,
18
18
  version: 10,
19
19
  shardStart: 0,
20
- handlePayload: (shardId, packet) => {
21
- console.info(`Packet ${packet.t} on shard ${shardId}`);
22
- },
23
20
  resharding: {
24
21
  interval: 8 * 60 * 60 * 1e3, // 8h
25
22
  percentage: 80,
26
- reloadGuilds() {
27
- throw new Error('Unexpected to run <reloadGuilds>');
28
- },
29
- onGuild() {
30
- throw new Error('Unexpected to run <onGuild>');
31
- },
32
23
  },
33
24
  };
34
25
  exports.ShardManagerDefaults = ShardManagerDefaults;
35
26
  const WorkerManagerDefaults = {
36
27
  ...ShardManagerDefaults,
37
28
  shardsPerWorker: 16,
38
- handlePayload: (_shardId, _workerId, _packet) => { },
39
29
  };
40
30
  exports.WorkerManagerDefaults = WorkerManagerDefaults;
@@ -1,7 +1,7 @@
1
1
  import { SeyfertWebSocket } from './socket/custom';
2
2
  export declare class BaseSocket {
3
3
  private internal;
4
- ping?: () => Promise<number>;
4
+ ping: () => Promise<number>;
5
5
  constructor(kind: 'ws' | 'bun', url: string);
6
6
  set onopen(callback: SeyfertWebSocket['onopen']);
7
7
  set onmessage(callback: SeyfertWebSocket['onmessage']);
@@ -1,9 +1,9 @@
1
1
  import { Logger, type MakeRequired } from '../../common';
2
+ import { type GatewayReceivePayload, type GatewaySendPayload } from '../../types';
2
3
  import { DynamicBucket } from '../structures';
3
4
  import { ConnectTimeout } from '../structures/timeout';
4
5
  import { BaseSocket } from './basesocket';
5
6
  import type { ShardData, ShardOptions } from './shared';
6
- import { type GatewaySendPayload, type GatewayReceivePayload } from '../../types';
7
7
  export interface ShardHeart {
8
8
  interval: number;
9
9
  nodeInterval?: NodeJS.Timeout;
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Shard = void 0;
4
4
  const node_zlib_1 = require("node:zlib");
5
5
  const common_1 = require("../../common");
6
+ const types_1 = require("../../types");
6
7
  const constants_1 = require("../constants");
7
8
  const structures_1 = require("../structures");
8
9
  const timeout_1 = require("../structures/timeout");
9
10
  const basesocket_1 = require("./basesocket");
10
11
  const shared_1 = require("./shared");
11
- const types_1 = require("../../types");
12
12
  class Shard {
13
13
  id;
14
14
  logger;
@@ -65,7 +65,6 @@ class Shard {
65
65
  ping() {
66
66
  if (!this.websocket)
67
67
  return Promise.resolve(Number.POSITIVE_INFINITY);
68
- //@ts-expect-error
69
68
  return this.websocket.ping();
70
69
  }
71
70
  async connect() {
@@ -171,8 +170,10 @@ class Shard {
171
170
  }
172
171
  break;
173
172
  case types_1.GatewayOpcodes.HeartbeatAck:
174
- this.heart.ack = true;
175
- this.heart.lastAck = Date.now();
173
+ {
174
+ this.heart.ack = true;
175
+ this.heart.lastAck = Date.now();
176
+ }
176
177
  break;
177
178
  case types_1.GatewayOpcodes.Heartbeat:
178
179
  this.heartbeat(true);
@@ -197,8 +198,10 @@ class Shard {
197
198
  {
198
199
  switch (packet.t) {
199
200
  case types_1.GatewayDispatchEvents.Resumed:
200
- this.offlineSendQueue.map((resolve) => resolve());
201
- this.options.handlePayload(this.id, packet);
201
+ {
202
+ this.offlineSendQueue.map((resolve) => resolve());
203
+ this.options.handlePayload(this.id, packet);
204
+ }
202
205
  break;
203
206
  case types_1.GatewayDispatchEvents.Ready: {
204
207
  this.data.resume_gateway_url = packet.d.resume_gateway_url;
@@ -226,10 +229,12 @@ class Shard {
226
229
  case types_1.GatewayCloseCodes.UnknownOpcode:
227
230
  case types_1.GatewayCloseCodes.InvalidSeq:
228
231
  case types_1.GatewayCloseCodes.SessionTimedOut:
229
- this.data.resume_seq = 0;
230
- this.data.session_id = undefined;
231
- this.data.resume_gateway_url = undefined;
232
- await this.reconnect();
232
+ {
233
+ this.data.resume_seq = 0;
234
+ this.data.session_id = undefined;
235
+ this.data.resume_gateway_url = undefined;
236
+ await this.reconnect();
237
+ }
233
238
  break;
234
239
  case 1001:
235
240
  case 1006:
@@ -239,8 +244,10 @@ class Shard {
239
244
  case types_1.GatewayCloseCodes.NotAuthenticated:
240
245
  case types_1.GatewayCloseCodes.AlreadyAuthenticated:
241
246
  case types_1.GatewayCloseCodes.RateLimited:
242
- this.logger.info('Trying to reconnect');
243
- await this.reconnect();
247
+ {
248
+ this.logger.info('Trying to reconnect');
249
+ await this.reconnect();
250
+ }
244
251
  break;
245
252
  case types_1.GatewayCloseCodes.AuthenticationFailed:
246
253
  case types_1.GatewayCloseCodes.DisallowedIntents:
@@ -251,17 +258,19 @@ class Shard {
251
258
  this.logger.fatal('Cannot reconnect');
252
259
  break;
253
260
  default:
254
- this.logger.warn('Unknown close code, trying to reconnect anyways');
255
- await this.reconnect();
261
+ {
262
+ this.logger.warn('Unknown close code, trying to reconnect anyways');
263
+ await this.reconnect();
264
+ }
256
265
  break;
257
266
  }
258
267
  }
259
268
  async close(code, reason) {
260
269
  clearInterval(this.heart.nodeInterval);
261
270
  if (!this.isOpen) {
262
- return this.debugger?.warn(`[Shard #${this.id}] Is not open`);
271
+ return this.debugger?.warn(`[Shard #${this.id}] Is not open, reason:`, reason);
263
272
  }
264
- this.debugger?.debug(`[Shard #${this.id}] Called close`);
273
+ this.debugger?.debug(`[Shard #${this.id}] Called close with reason:`, reason);
265
274
  this.websocket?.close(code, reason);
266
275
  }
267
276
  handleMessage(data) {
@@ -1,14 +1,15 @@
1
1
  import { Logger, type MakeRequired } from '../../common';
2
- import { type GatewayUpdatePresence, type GatewayVoiceStateUpdate, type GatewaySendPayload } from '../../types';
2
+ import type { MakeDeepPartial } from '../../common/types/util';
3
+ import { type GatewaySendPayload, type GatewayUpdatePresence, type GatewayVoiceStateUpdate } from '../../types';
3
4
  import { ShardManagerDefaults } from '../constants';
4
5
  import { ConnectQueue } from '../structures/timeout';
5
6
  import { Shard } from './shard';
6
- import type { ShardManagerOptions } from './shared';
7
+ import type { ShardData, ShardManagerOptions } from './shared';
7
8
  export declare class ShardManager extends Map<number, Shard> {
8
9
  connectQueue: ConnectQueue;
9
10
  options: MakeRequired<ShardManagerOptions, keyof typeof ShardManagerDefaults>;
10
11
  debugger?: Logger;
11
- constructor(options: ShardManagerOptions);
12
+ constructor(options: MakeDeepPartial<ShardManagerOptions, 'resharding'>);
12
13
  get totalShards(): number;
13
14
  get shardStart(): number;
14
15
  get shardEnd(): number;
@@ -16,15 +17,17 @@ export declare class ShardManager extends Map<number, Shard> {
16
17
  get concurrency(): number;
17
18
  get latency(): number;
18
19
  calculateShardId(guildId: string): number;
19
- spawn(shardId: number): Shard;
20
+ create(shardId: number): Shard;
20
21
  spawnShards(): Promise<void>;
22
+ startResharder(): Promise<void>;
21
23
  spawnBuckets(): Shard[][];
22
24
  forceIdentify(shardId: number): Promise<void>;
23
25
  disconnect(shardId: number): Promise<void> | undefined;
24
- disconnectAll(): Promise<unknown>;
26
+ disconnectAll(): void;
25
27
  setShardPresence(shardId: number, payload: GatewayUpdatePresence['d']): void;
26
- setPresence(payload: GatewayUpdatePresence['d']): Promise<void>;
28
+ setPresence(payload: GatewayUpdatePresence['d']): void;
27
29
  joinVoice(guild_id: string, channel_id: string, options: Pick<GatewayVoiceStateUpdate['d'], 'self_deaf' | 'self_mute'>): void;
28
30
  leaveVoice(guild_id: string): void;
29
31
  send<T extends GatewaySendPayload>(shardId: number, payload: T): void;
32
+ resume(shardId: number, shardData: MakeRequired<ShardData>): unknown;
30
33
  }