seyfert 1.5.0 → 2.1.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.
- package/LICENSE +21 -190
- package/README.md +18 -10
- package/lib/api/Router.js +2 -2
- package/lib/api/Routes/applications.d.ts +23 -1
- package/lib/api/Routes/channels.d.ts +1 -1
- package/lib/api/Routes/gateway.d.ts +1 -1
- package/lib/api/Routes/guilds.d.ts +5 -2
- package/lib/api/Routes/interactions.d.ts +8 -2
- package/lib/api/Routes/invites.d.ts +1 -1
- package/lib/api/Routes/skus.d.ts +11 -0
- package/lib/api/Routes/skus.js +2 -0
- package/lib/api/Routes/stage-instances.d.ts +1 -1
- package/lib/api/Routes/stickers.d.ts +2 -2
- package/lib/api/Routes/users.d.ts +1 -1
- package/lib/api/Routes/voice.d.ts +1 -1
- package/lib/api/Routes/webhooks.d.ts +2 -2
- package/lib/api/api.d.ts +3 -3
- package/lib/api/api.js +15 -25
- package/lib/api/bucket.d.ts +0 -1
- package/lib/api/shared.d.ts +1 -2
- package/lib/api/utils/constants.d.ts +2 -5
- package/lib/api/utils/constants.js +3 -7
- package/lib/api/utils/utils.d.ts +1 -2
- package/lib/api/utils/utils.js +2 -3
- package/lib/builders/ActionRow.d.ts +1 -1
- package/lib/builders/ActionRow.js +3 -3
- package/lib/builders/Attachment.d.ts +3 -4
- package/lib/builders/Attachment.js +24 -25
- package/lib/builders/Base.d.ts +2 -2
- package/lib/builders/Base.js +1 -1
- package/lib/builders/Button.d.ts +7 -7
- package/lib/builders/Button.js +11 -9
- package/lib/builders/Embed.d.ts +1 -1
- package/lib/builders/Modal.d.ts +1 -1
- package/lib/builders/Modal.js +2 -2
- package/lib/builders/Poll.d.ts +2 -2
- package/lib/builders/Poll.js +5 -6
- package/lib/builders/SelectMenu.d.ts +1 -1
- package/lib/builders/SelectMenu.js +17 -18
- package/lib/builders/index.d.ts +1 -1
- package/lib/builders/index.js +10 -11
- package/lib/cache/adapters/default.d.ts +16 -9
- package/lib/cache/adapters/default.js +42 -31
- package/lib/cache/adapters/index.d.ts +0 -1
- package/lib/cache/adapters/index.js +0 -1
- package/lib/cache/adapters/limited.d.ts +17 -12
- package/lib/cache/adapters/limited.js +80 -36
- package/lib/cache/adapters/types.d.ts +6 -7
- package/lib/cache/adapters/workeradapter.d.ts +6 -6
- package/lib/cache/adapters/workeradapter.js +13 -0
- package/lib/cache/index.d.ts +20 -8
- package/lib/cache/index.js +328 -22
- package/lib/cache/resources/bans.d.ts +9 -6
- package/lib/cache/resources/bans.js +13 -4
- package/lib/cache/resources/channels.d.ts +6 -4
- package/lib/cache/resources/channels.js +13 -7
- package/lib/cache/resources/default/base.d.ts +7 -7
- package/lib/cache/resources/default/base.js +2 -2
- package/lib/cache/resources/default/guild-based.d.ts +6 -6
- package/lib/cache/resources/default/guild-based.js +6 -6
- package/lib/cache/resources/default/guild-related.d.ts +7 -7
- package/lib/cache/resources/default/guild-related.js +10 -8
- package/lib/cache/resources/emojis.d.ts +15 -6
- package/lib/cache/resources/emojis.js +13 -4
- package/lib/cache/resources/guilds.d.ts +9 -6
- package/lib/cache/resources/guilds.js +27 -6
- package/lib/cache/resources/members.d.ts +9 -6
- package/lib/cache/resources/members.js +22 -6
- package/lib/cache/resources/messages.d.ts +11 -7
- package/lib/cache/resources/messages.js +19 -7
- package/lib/cache/resources/overwrites.d.ts +11 -2
- package/lib/cache/resources/overwrites.js +9 -0
- package/lib/cache/resources/presence.d.ts +3 -2
- package/lib/cache/resources/roles.d.ts +9 -6
- package/lib/cache/resources/roles.js +13 -4
- package/lib/cache/resources/stage-instances.d.ts +2 -2
- package/lib/cache/resources/stickers.d.ts +9 -6
- package/lib/cache/resources/stickers.js +13 -4
- package/lib/cache/resources/threads.d.ts +9 -6
- package/lib/cache/resources/threads.js +13 -4
- package/lib/cache/resources/users.d.ts +9 -6
- package/lib/cache/resources/users.js +13 -4
- package/lib/cache/resources/voice-states.d.ts +11 -8
- package/lib/cache/resources/voice-states.js +15 -4
- package/lib/client/base.d.ts +29 -21
- package/lib/client/base.js +64 -57
- package/lib/client/client.d.ts +11 -16
- package/lib/client/client.js +51 -37
- package/lib/client/collectors.d.ts +10 -10
- package/lib/client/collectors.js +26 -1
- package/lib/client/httpclient.d.ts +8 -13
- package/lib/client/httpclient.js +27 -218
- package/lib/client/index.d.ts +1 -0
- package/lib/client/index.js +1 -0
- package/lib/client/transformers.d.ts +68 -0
- package/lib/client/transformers.js +99 -0
- package/lib/client/types.d.ts +5 -0
- package/lib/client/types.js +2 -0
- package/lib/client/workerclient.d.ts +16 -15
- package/lib/client/workerclient.js +130 -72
- package/lib/commands/applications/chat.d.ts +35 -34
- package/lib/commands/applications/chat.js +5 -9
- package/lib/commands/applications/chatcontext.d.ts +17 -17
- package/lib/commands/applications/chatcontext.js +5 -5
- package/lib/commands/applications/entryPoint.d.ts +46 -0
- package/lib/commands/applications/entryPoint.js +56 -0
- package/lib/commands/applications/entrycontext.d.ts +40 -0
- package/lib/commands/applications/entrycontext.js +85 -0
- package/lib/commands/applications/menu.d.ts +2 -3
- package/lib/commands/applications/menu.js +2 -5
- package/lib/commands/applications/menucontext.d.ts +14 -13
- package/lib/commands/applications/menucontext.js +9 -9
- package/lib/commands/applications/options.d.ts +4 -3
- package/lib/commands/applications/options.js +20 -21
- package/lib/commands/applications/shared.d.ts +3 -1
- package/lib/commands/decorators.d.ts +47 -35
- package/lib/commands/decorators.js +20 -18
- package/lib/commands/handle.d.ts +65 -0
- package/lib/commands/handle.js +727 -0
- package/lib/commands/handler.d.ts +29 -18
- package/lib/commands/handler.js +295 -164
- package/lib/commands/index.d.ts +2 -0
- package/lib/commands/index.js +2 -0
- package/lib/commands/optionresolver.d.ts +13 -13
- package/lib/commands/optionresolver.js +24 -29
- package/lib/common/bot/watcher.d.ts +4 -33
- package/lib/common/bot/watcher.js +0 -109
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.js +1 -0
- package/lib/common/it/colors.js +48 -49
- package/lib/common/it/formatter.d.ts +32 -0
- package/lib/common/it/formatter.js +42 -0
- package/lib/common/it/logger.d.ts +0 -1
- package/lib/common/it/logger.js +3 -3
- package/lib/common/it/utils.d.ts +24 -4
- package/lib/common/it/utils.js +88 -17
- package/lib/common/shorters/application.d.ts +56 -0
- package/lib/common/shorters/application.js +81 -0
- package/lib/common/shorters/bans.d.ts +4 -5
- package/lib/common/shorters/bans.js +3 -3
- package/lib/common/shorters/channels.d.ts +7 -6
- package/lib/common/shorters/channels.js +19 -15
- package/lib/common/shorters/emojis.d.ts +5 -6
- package/lib/common/shorters/emojis.js +5 -5
- package/lib/common/shorters/guilds.d.ts +18 -16
- package/lib/common/shorters/guilds.js +31 -26
- package/lib/common/shorters/interaction.d.ts +7 -7
- package/lib/common/shorters/interaction.js +3 -2
- package/lib/common/shorters/members.d.ts +29 -12
- package/lib/common/shorters/members.js +55 -16
- package/lib/common/shorters/messages.d.ts +7 -8
- package/lib/common/shorters/messages.js +8 -7
- package/lib/common/shorters/reactions.d.ts +3 -3
- package/lib/common/shorters/reactions.js +11 -11
- package/lib/common/shorters/roles.d.ts +9 -7
- package/lib/common/shorters/roles.js +26 -7
- package/lib/common/shorters/templates.d.ts +7 -8
- package/lib/common/shorters/templates.js +7 -7
- package/lib/common/shorters/threads.d.ts +6 -7
- package/lib/common/shorters/threads.js +6 -9
- package/lib/common/shorters/users.d.ts +4 -4
- package/lib/common/shorters/users.js +8 -4
- package/lib/common/shorters/webhook.d.ts +10 -10
- package/lib/common/shorters/webhook.js +10 -9
- package/lib/common/types/resolvables.d.ts +2 -2
- package/lib/common/types/util.d.ts +4 -2
- package/lib/common/types/write.d.ts +3 -3
- package/lib/components/ActionRow.d.ts +1 -1
- package/lib/components/BaseComponent.d.ts +1 -1
- package/lib/components/BaseComponent.js +1 -1
- package/lib/components/BaseSelectMenuComponent.d.ts +1 -1
- package/lib/components/ButtonComponent.d.ts +17 -7
- package/lib/components/ButtonComponent.js +19 -2
- package/lib/components/ChannelSelectMenuComponent.d.ts +3 -3
- package/lib/components/MentionableSelectMenuComponent.d.ts +2 -2
- package/lib/components/RoleSelectMenuComponent.d.ts +2 -2
- package/lib/components/StringSelectMenuComponent.d.ts +2 -2
- package/lib/components/TextInputComponent.d.ts +2 -2
- package/lib/components/UserSelectMenuComponent.d.ts +2 -2
- package/lib/components/componentcommand.js +2 -2
- package/lib/components/componentcontext.d.ts +10 -9
- package/lib/components/componentcontext.js +8 -8
- package/lib/components/handler.d.ts +15 -14
- package/lib/components/handler.js +89 -93
- package/lib/components/index.d.ts +3 -3
- package/lib/components/index.js +12 -10
- package/lib/components/modalcontext.d.ts +12 -11
- package/lib/components/modalcontext.js +2 -2
- package/lib/deps/mixer.d.ts +8 -0
- package/lib/deps/mixer.js +71 -0
- package/lib/events/handler.d.ts +35 -13
- package/lib/events/handler.js +57 -24
- package/lib/events/hooks/application_command.d.ts +2 -2
- package/lib/events/hooks/auto_moderation.d.ts +6 -7
- package/lib/events/hooks/auto_moderation.js +4 -4
- package/lib/events/hooks/channel.d.ts +2 -2
- package/lib/events/hooks/channel.js +4 -7
- package/lib/events/hooks/custom.d.ts +4 -3
- package/lib/events/hooks/custom.js +5 -1
- package/lib/events/hooks/dispatch.d.ts +3 -4
- package/lib/events/hooks/dispatch.js +2 -2
- package/lib/events/hooks/entitlement.d.ts +5 -37
- package/lib/events/hooks/entitlement.js +7 -7
- package/lib/events/hooks/guild.d.ts +125 -125
- package/lib/events/hooks/guild.js +13 -15
- package/lib/events/hooks/integration.d.ts +27 -28
- package/lib/events/hooks/integration.js +3 -3
- package/lib/events/hooks/interactions.d.ts +2 -2
- package/lib/events/hooks/invite.d.ts +18 -17
- package/lib/events/hooks/message.d.ts +69 -54
- package/lib/events/hooks/message.js +4 -8
- package/lib/events/hooks/presence.d.ts +17 -16
- package/lib/events/hooks/stage.d.ts +4 -4
- package/lib/events/hooks/subscriptions.d.ts +35 -0
- package/lib/events/hooks/subscriptions.js +16 -0
- package/lib/events/hooks/thread.d.ts +132 -63
- package/lib/events/hooks/thread.js +4 -4
- package/lib/events/hooks/typing.d.ts +28 -6
- package/lib/events/hooks/typing.js +2 -2
- package/lib/events/hooks/user.d.ts +3 -3
- package/lib/events/hooks/user.js +2 -2
- package/lib/events/hooks/voice.d.ts +28 -3
- package/lib/events/hooks/voice.js +8 -4
- package/lib/events/hooks/webhook.d.ts +1 -1
- package/lib/index.d.ts +5 -14
- package/lib/index.js +7 -12
- package/lib/langs/handler.d.ts +14 -10
- package/lib/langs/handler.js +40 -9
- package/lib/structures/AutoModerationRule.d.ts +4 -4
- package/lib/structures/AutoModerationRule.js +1 -2
- package/lib/structures/ClientUser.d.ts +1 -1
- package/lib/structures/Entitlement.d.ts +10 -0
- package/lib/structures/Entitlement.js +16 -0
- package/lib/structures/Guild.d.ts +33 -34
- package/lib/structures/Guild.js +5 -2
- package/lib/structures/GuildBan.d.ts +6 -6
- package/lib/structures/GuildBan.js +2 -1
- package/lib/structures/GuildEmoji.d.ts +4 -4
- package/lib/structures/GuildEmoji.js +3 -2
- package/lib/structures/GuildMember.d.ts +20 -17
- package/lib/structures/GuildMember.js +18 -8
- package/lib/structures/GuildPreview.d.ts +1 -1
- package/lib/structures/GuildRole.d.ts +5 -3
- package/lib/structures/GuildRole.js +8 -1
- package/lib/structures/GuildTemplate.d.ts +2 -2
- package/lib/structures/GuildTemplate.js +1 -1
- package/lib/structures/Interaction.d.ts +76 -39
- package/lib/structures/Interaction.js +179 -94
- package/lib/structures/Message.d.ts +29 -33
- package/lib/structures/Message.js +8 -12
- package/lib/structures/Poll.d.ts +4 -3
- package/lib/structures/Poll.js +6 -2
- package/lib/structures/Sticker.d.ts +7 -7
- package/lib/structures/Sticker.js +7 -7
- package/lib/structures/User.d.ts +5 -4
- package/lib/structures/User.js +2 -1
- package/lib/structures/VoiceState.d.ts +15 -11
- package/lib/structures/VoiceState.js +35 -17
- package/lib/structures/Webhook.d.ts +6 -7
- package/lib/structures/Webhook.js +6 -7
- package/lib/structures/channels.d.ts +11 -10
- package/lib/structures/channels.js +70 -65
- package/lib/structures/extra/BaseGuild.d.ts +12 -2
- package/lib/structures/extra/BaseGuild.js +30 -3
- package/lib/structures/extra/BitField.d.ts +1 -1
- package/lib/structures/extra/BitField.js +3 -2
- package/lib/structures/extra/DiscordBase.js +2 -2
- package/lib/structures/extra/Permissions.d.ts +3 -1
- package/lib/structures/extra/Permissions.js +8 -3
- package/lib/types/gateway.d.ts +1554 -0
- package/lib/types/gateway.js +4 -0
- package/lib/types/index.d.ts +9 -1
- package/lib/types/index.js +28 -1
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/attachment.d.ts +5 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/attachment.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/base.d.ts +22 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/base.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/boolean.d.ts +4 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/boolean.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/channel.d.ts +7 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/channel.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/integer.d.ts +17 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/integer.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/mentionable.d.ts +5 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/mentionable.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/number.d.ts +17 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/number.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/role.d.ts +5 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/role.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.d.ts +25 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/shared.js +20 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/string.d.ts +17 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/string.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommand.d.ts +11 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommand.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommandGroup.d.ts +11 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/subcommandGroup.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/user.d.ts +5 -0
- package/lib/types/payloads/_interactions/_applicationCommands/_chatInput/user.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/chatInput.d.ts +65 -0
- package/lib/types/payloads/_interactions/_applicationCommands/chatInput.js +29 -0
- package/lib/types/payloads/_interactions/_applicationCommands/contextMenu.d.ts +65 -0
- package/lib/types/payloads/_interactions/_applicationCommands/contextMenu.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/internals.d.ts +8 -0
- package/lib/types/payloads/_interactions/_applicationCommands/internals.js +2 -0
- package/lib/types/payloads/_interactions/_applicationCommands/permissions.d.ts +54 -0
- package/lib/types/payloads/_interactions/_applicationCommands/permissions.js +20 -0
- package/lib/types/payloads/_interactions/applicationCommands.d.ts +188 -0
- package/lib/types/payloads/_interactions/applicationCommands.js +88 -0
- package/lib/types/payloads/_interactions/autocomplete.d.ts +10 -0
- package/lib/types/payloads/_interactions/autocomplete.js +2 -0
- package/lib/types/payloads/_interactions/base.d.ts +197 -0
- package/lib/types/payloads/_interactions/base.js +2 -0
- package/lib/types/payloads/_interactions/messageComponents.d.ts +41 -0
- package/lib/types/payloads/_interactions/messageComponents.js +2 -0
- package/lib/types/payloads/_interactions/modalSubmit.d.ts +35 -0
- package/lib/types/payloads/_interactions/modalSubmit.js +2 -0
- package/lib/types/payloads/_interactions/ping.d.ts +3 -0
- package/lib/types/payloads/_interactions/ping.js +2 -0
- package/lib/types/payloads/_interactions/responses.d.ts +184 -0
- package/lib/types/payloads/_interactions/responses.js +58 -0
- package/lib/types/payloads/application.d.ts +292 -0
- package/lib/types/payloads/application.js +117 -0
- package/lib/types/payloads/auditLog.d.ts +644 -0
- package/lib/types/payloads/auditLog.js +80 -0
- package/lib/types/payloads/autoModeration.d.ts +219 -0
- package/lib/types/payloads/autoModeration.js +87 -0
- package/lib/types/payloads/channel.d.ts +1748 -0
- package/lib/types/payloads/channel.js +376 -0
- package/lib/types/payloads/emoji.d.ts +48 -0
- package/lib/types/payloads/emoji.js +5 -0
- package/lib/types/payloads/gateway.d.ts +373 -0
- package/lib/types/payloads/gateway.js +82 -0
- package/lib/types/payloads/guild.d.ts +1060 -0
- package/lib/types/payloads/guild.js +324 -0
- package/lib/types/payloads/guildScheduledEvent.d.ts +138 -0
- package/lib/types/payloads/guildScheduledEvent.js +32 -0
- package/lib/types/payloads/index.d.ts +64 -0
- package/lib/types/payloads/index.js +37 -0
- package/lib/types/payloads/interactions.d.ts +24 -0
- package/lib/types/payloads/interactions.js +23 -0
- package/lib/types/payloads/invite.d.ts +121 -0
- package/lib/types/payloads/invite.js +23 -0
- package/lib/types/payloads/monetization.d.ts +178 -0
- package/lib/types/payloads/monetization.js +88 -0
- package/lib/types/payloads/oauth2.d.ts +131 -0
- package/lib/types/payloads/oauth2.js +135 -0
- package/lib/types/payloads/permissions.d.ts +97 -0
- package/lib/types/payloads/permissions.js +16 -0
- package/lib/types/payloads/poll.d.ts +104 -0
- package/lib/types/payloads/poll.js +16 -0
- package/lib/types/payloads/stageInstance.d.ts +77 -0
- package/lib/types/payloads/stageInstance.js +19 -0
- package/lib/types/payloads/sticker.d.ts +123 -0
- package/lib/types/payloads/sticker.js +30 -0
- package/lib/types/payloads/teams.d.ts +78 -0
- package/lib/types/payloads/teams.js +23 -0
- package/lib/types/payloads/template.d.ts +62 -0
- package/lib/types/payloads/template.js +5 -0
- package/lib/types/payloads/user.d.ts +337 -0
- package/lib/types/payloads/user.js +167 -0
- package/lib/types/payloads/voice.d.ts +89 -0
- package/lib/types/payloads/voice.js +5 -0
- package/lib/types/payloads/webhook.d.ts +76 -0
- package/lib/types/payloads/webhook.js +21 -0
- package/lib/types/rest/application.d.ts +57 -0
- package/lib/types/rest/application.js +2 -0
- package/lib/types/rest/auditLog.d.ts +30 -0
- package/lib/types/rest/auditLog.js +2 -0
- package/lib/types/rest/autoModeration.d.ts +66 -0
- package/lib/types/rest/autoModeration.js +2 -0
- package/lib/types/rest/channel.d.ts +699 -0
- package/lib/types/rest/channel.js +11 -0
- package/lib/types/rest/emoji.d.ts +54 -0
- package/lib/types/rest/emoji.js +2 -0
- package/lib/types/rest/gateway.d.ts +9 -0
- package/lib/types/rest/gateway.js +2 -0
- package/lib/types/rest/guild.d.ts +865 -0
- package/lib/types/rest/guild.js +2 -0
- package/lib/types/rest/guildScheduledEvent.d.ts +126 -0
- package/lib/types/rest/guildScheduledEvent.js +2 -0
- package/lib/types/rest/index.d.ts +296 -0
- package/lib/types/rest/index.js +292 -0
- package/lib/types/rest/interactions.d.ts +216 -0
- package/lib/types/rest/interactions.js +2 -0
- package/lib/types/rest/invite.d.ts +24 -0
- package/lib/types/rest/invite.js +2 -0
- package/lib/types/rest/monetization.d.ts +103 -0
- package/lib/types/rest/monetization.js +11 -0
- package/lib/types/rest/oauth2.d.ts +172 -0
- package/lib/types/rest/oauth2.js +2 -0
- package/lib/types/rest/poll.d.ts +44 -0
- package/lib/types/rest/poll.js +2 -0
- package/lib/types/rest/stageInstance.d.ts +58 -0
- package/lib/types/rest/stageInstance.js +2 -0
- package/lib/types/rest/sticker.d.ts +77 -0
- package/lib/types/rest/sticker.js +2 -0
- package/lib/types/rest/template.d.ts +62 -0
- package/lib/types/rest/template.js +2 -0
- package/lib/types/rest/user.d.ts +120 -0
- package/lib/types/rest/user.js +2 -0
- package/lib/types/rest/voice.d.ts +17 -0
- package/lib/types/rest/voice.js +2 -0
- package/lib/types/rest/webhook.d.ts +250 -0
- package/lib/types/rest/webhook.js +2 -0
- package/lib/types/utils/index.d.ts +808 -0
- package/lib/types/utils/index.js +810 -0
- package/lib/websocket/SharedTypes.d.ts +12 -5
- package/lib/websocket/SharedTypes.js +1 -1
- package/lib/websocket/constants/index.d.ts +3 -3
- package/lib/websocket/constants/index.js +11 -1
- package/lib/websocket/discord/basesocket.d.ts +7 -7
- package/lib/websocket/discord/basesocket.js +34 -22
- package/lib/websocket/discord/events/memberUpdate.d.ts +1 -6
- package/lib/websocket/discord/events/memberUpdate.js +2 -1
- package/lib/websocket/discord/events/presenceUpdate.d.ts +5 -18
- package/lib/websocket/discord/events/presenceUpdate.js +5 -6
- package/lib/websocket/discord/shard.d.ts +9 -8
- package/lib/websocket/discord/shard.js +83 -57
- package/lib/websocket/discord/sharder.d.ts +6 -5
- package/lib/websocket/discord/sharder.js +70 -11
- package/lib/websocket/discord/shared.d.ts +34 -6
- package/lib/websocket/discord/socket/custom.d.ts +52 -0
- package/lib/websocket/discord/socket/custom.js +300 -0
- package/lib/websocket/discord/worker.d.ts +6 -10
- package/lib/websocket/discord/workermanager.d.ts +10 -16
- package/lib/websocket/discord/workermanager.js +63 -50
- package/lib/websocket/structures/index.d.ts +0 -1
- package/lib/websocket/structures/index.js +1 -1
- package/lib/websocket/structures/timeout.d.ts +0 -1
- package/package.json +70 -74
- package/lib/cache/adapters/redis.d.ts +0 -37
- package/lib/cache/adapters/redis.js +0 -218
- package/lib/client/oninteractioncreate.d.ts +0 -4
- package/lib/client/oninteractioncreate.js +0 -198
- package/lib/client/onmessagecreate.d.ts +0 -13
- package/lib/client/onmessagecreate.js +0 -410
- package/lib/structures/extra/functions.d.ts +0 -12
- package/lib/structures/extra/functions.js +0 -70
package/LICENSE
CHANGED
|
@@ -1,190 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
Copyright 2021 Alan Delgado
|
|
179
|
-
|
|
180
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
-
you may not use this file except in compliance with the License.
|
|
182
|
-
You may obtain a copy of the License at
|
|
183
|
-
|
|
184
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
-
|
|
186
|
-
Unless required by applicable law or agreed to in writing, software
|
|
187
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
-
See the License for the specific language governing permissions and
|
|
190
|
-
limitations under the License.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 socram03
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
<div align='center'>
|
|
2
|
-
|
|
3
|
-
# **Seyfert**
|
|
4
|
-
|
|
5
2
|
<img src="./assets/icon.png" alt="seyfert" width="200px" />
|
|
6
3
|
|
|
7
|
-
**Discord
|
|
4
|
+
**Seyfert is a brand-new Discord framework to take the bot development to a next level**
|
|
8
5
|
|
|
9
6
|
[](https://github.com/tiramisulabs/seyfert/blob/main/LICENSE)
|
|
10
7
|
[](https://www.npmjs.com/package/seyfert)
|
|
@@ -12,11 +9,11 @@
|
|
|
12
9
|
|
|
13
10
|
</div>
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
## FAQ
|
|
13
|
+
### So, what is `seyfert`?
|
|
17
14
|
Seyfert is the ultimate Discord framework! We make it easy to interact with the Discord API, big cache control, scalable code and a pretty dev experience.
|
|
18
15
|
|
|
19
|
-
|
|
16
|
+
### Why should I use it?
|
|
20
17
|
There are many reasons to use Seyfert, but they dont all fit in this tiny readme, so here is a list of the most awesome reasons!
|
|
21
18
|
|
|
22
19
|
- **Low RAM Usage**
|
|
@@ -30,14 +27,25 @@ There are many reasons to use Seyfert, but they dont all fit in this tiny readme
|
|
|
30
27
|
|
|
31
28
|
## Installation
|
|
32
29
|
> [!NOTE]
|
|
33
|
-
>
|
|
30
|
+
> Node v18>= is required (or v16 with `--experimental-fetch` flag), Bun/Node LTS recommended.
|
|
31
|
+
|
|
34
32
|
```sh
|
|
35
33
|
pnpm add seyfert
|
|
36
34
|
```
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
```sh
|
|
37
|
+
bun add seyfert
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
npm i seyfert
|
|
42
|
+
```
|
|
43
|
+
> Or other package manager.
|
|
44
|
+
|
|
45
|
+
## Contributing
|
|
46
|
+
We are open to contributions, fork the repo and make your changes!
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
## Useful links
|
|
41
49
|
|
|
42
50
|
- [GitHub Repository](https://github.com/tiramisulabs/seyfert)
|
|
43
51
|
- [Discord server](https://discord.com/invite/XNw2RZFzaP)
|
package/lib/api/Router.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CDNRouter = exports.Router = exports.ProxyRequestMethod = void 0;
|
|
4
|
+
exports.parseCDNURL = parseCDNURL;
|
|
4
5
|
const common_1 = require("../common");
|
|
5
6
|
var ProxyRequestMethod;
|
|
6
7
|
(function (ProxyRequestMethod) {
|
|
@@ -70,4 +71,3 @@ function parseCDNURL(route, options = {}) {
|
|
|
70
71
|
url.searchParams.set('size', `${options.size}`);
|
|
71
72
|
return url.toString();
|
|
72
73
|
}
|
|
73
|
-
exports.parseCDNURL = parseCDNURL;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTGetAPIApplicationCommandResult, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIApplicationGuildCommandsResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPatchAPIApplicationCommandJSONBody, RESTPatchAPIApplicationCommandResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIApplicationCommandsResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTPutAPIGuildApplicationCommandsPermissionsResult } from '
|
|
1
|
+
import type { RESTGetAPIApplicationCommandResult, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIApplicationGuildCommandsResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPatchAPIApplicationCommandJSONBody, RESTPatchAPIApplicationCommandResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIApplicationCommandsResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTPutAPIGuildApplicationCommandsPermissionsResult, RESTGetAPIApplicationEmojiResult, RESTGetAPIApplicationEmojisResult, RESTPostAPIApplicationEmojiJSONBody, RESTPatchAPIApplicationEmojiJSONBody, RESTPostAPIApplicationEmojiResult, RESTPatchAPIApplicationEmojiResult, RESTDeleteAPIApplicationEmojiResult, RESTGetAPIEntitlementsResult, RESTGetAPIEntitlementsQuery, RESTPostAPIEntitlementBody, RESTPostAPIEntitlementResult, RESTGetAPISKUsResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface ApplicationRoutes {
|
|
@@ -38,5 +38,27 @@ export interface ApplicationRoutes {
|
|
|
38
38
|
put(args: RestArguments<ProxyRequestMethod.Put, RESTPutAPIApplicationRoleConnectionMetadataJSONBody>): Promise<RESTPutAPIApplicationRoleConnectionMetadataResult>;
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
+
emojis: {
|
|
42
|
+
(id: string): {
|
|
43
|
+
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPIApplicationEmojiResult>;
|
|
44
|
+
patch(args?: RestArguments<ProxyRequestMethod.Patch, RESTPatchAPIApplicationEmojiJSONBody>): Promise<RESTPatchAPIApplicationEmojiResult>;
|
|
45
|
+
delete(args?: RestArguments<ProxyRequestMethod.Delete>): Promise<RESTDeleteAPIApplicationEmojiResult>;
|
|
46
|
+
};
|
|
47
|
+
get(args?: RestArguments<ProxyRequestMethod.Get, Pick<RESTGetAPIApplicationEmojiResult, 'id'>>): Promise<RESTGetAPIApplicationEmojisResult>;
|
|
48
|
+
post(args?: RestArguments<ProxyRequestMethod.Post, RESTPostAPIApplicationEmojiJSONBody>): Promise<RESTPostAPIApplicationEmojiResult>;
|
|
49
|
+
};
|
|
50
|
+
entitlements: {
|
|
51
|
+
get(args?: RestArguments<ProxyRequestMethod.Get, RESTGetAPIEntitlementsQuery>): Promise<RESTGetAPIEntitlementsResult>;
|
|
52
|
+
post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIEntitlementBody>): Promise<RESTPostAPIEntitlementResult>;
|
|
53
|
+
(id: string): {
|
|
54
|
+
delete(args?: RestArguments<ProxyRequestMethod.Delete>): Promise<never>;
|
|
55
|
+
consume: {
|
|
56
|
+
post(args?: RestArguments<ProxyRequestMethod.Post>): Promise<never>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
skus: {
|
|
61
|
+
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPISKUsResult>;
|
|
62
|
+
};
|
|
41
63
|
};
|
|
42
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTDeleteAPIChannelAllMessageReactionsResult, RESTDeleteAPIChannelMessageReactionResult, RESTDeleteAPIChannelMessageResult, RESTDeleteAPIChannelPermissionResult, RESTDeleteAPIChannelPinResult, RESTDeleteAPIChannelRecipientResult, RESTDeleteAPIChannelResult, RESTDeleteAPIChannelThreadMembersResult, RESTGetAPIChannelInvitesResult, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTGetAPIChannelMessageResult, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTGetAPIChannelResult, RESTGetAPIChannelThreadMemberQuery, RESTGetAPIChannelThreadMemberResult, RESTGetAPIChannelThreadMembersQuery, RESTGetAPIChannelThreadMembersResult, RESTGetAPIChannelThreadsArchivedPrivateResult, RESTGetAPIChannelThreadsArchivedPublicResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIPollAnswerVotersQuery, RESTGetAPIPollAnswerVotersResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageResult, RESTPatchAPIChannelResult, RESTPostAPIChannelFollowersJSONBody, RESTPostAPIChannelFollowersResult, RESTPostAPIChannelInviteJSONBody, RESTPostAPIChannelInviteResult, RESTPostAPIChannelMessageCrosspostResult, RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessageResult, RESTPostAPIChannelMessagesBulkDeleteJSONBody, RESTPostAPIChannelMessagesBulkDeleteResult, RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelMessagesThreadsResult, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIChannelThreadsResult, RESTPostAPIChannelTypingResult, RESTPostAPIChannelWebhookJSONBody, RESTPostAPIChannelWebhookResult, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIPollExpireResult, RESTPutAPIChannelMessageReactionResult, RESTPutAPIChannelPermissionJSONBody, RESTPutAPIChannelPermissionResult, RESTPutAPIChannelPinResult, RESTPutAPIChannelRecipientJSONBody, RESTPutAPIChannelRecipientResult, RESTPutAPIChannelThreadMembersResult } from '
|
|
1
|
+
import type { RESTDeleteAPIChannelAllMessageReactionsResult, RESTDeleteAPIChannelMessageReactionResult, RESTDeleteAPIChannelMessageResult, RESTDeleteAPIChannelPermissionResult, RESTDeleteAPIChannelPinResult, RESTDeleteAPIChannelRecipientResult, RESTDeleteAPIChannelResult, RESTDeleteAPIChannelThreadMembersResult, RESTGetAPIChannelInvitesResult, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTGetAPIChannelMessageResult, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTGetAPIChannelResult, RESTGetAPIChannelThreadMemberQuery, RESTGetAPIChannelThreadMemberResult, RESTGetAPIChannelThreadMembersQuery, RESTGetAPIChannelThreadMembersResult, RESTGetAPIChannelThreadsArchivedPrivateResult, RESTGetAPIChannelThreadsArchivedPublicResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIPollAnswerVotersQuery, RESTGetAPIPollAnswerVotersResult, RESTPatchAPIChannelJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageResult, RESTPatchAPIChannelResult, RESTPostAPIChannelFollowersJSONBody, RESTPostAPIChannelFollowersResult, RESTPostAPIChannelInviteJSONBody, RESTPostAPIChannelInviteResult, RESTPostAPIChannelMessageCrosspostResult, RESTPostAPIChannelMessageJSONBody, RESTPostAPIChannelMessageResult, RESTPostAPIChannelMessagesBulkDeleteJSONBody, RESTPostAPIChannelMessagesBulkDeleteResult, RESTPostAPIChannelMessagesThreadsJSONBody, RESTPostAPIChannelMessagesThreadsResult, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIChannelThreadsResult, RESTPostAPIChannelTypingResult, RESTPostAPIChannelWebhookJSONBody, RESTPostAPIChannelWebhookResult, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIPollExpireResult, RESTPutAPIChannelMessageReactionResult, RESTPutAPIChannelPermissionJSONBody, RESTPutAPIChannelPermissionResult, RESTPutAPIChannelPinResult, RESTPutAPIChannelRecipientJSONBody, RESTPutAPIChannelRecipientResult, RESTPutAPIChannelThreadMembersResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface ChannelRoutes {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTGetAPIGatewayBotResult, RESTGetAPIGatewayResult } from '
|
|
1
|
+
import type { RESTGetAPIGatewayBotResult, RESTGetAPIGatewayResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface GatewayRoutes {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIThreadChannel, RESTDeleteAPIAutoModerationRuleResult, RESTDeleteAPIGuildBanResult, RESTDeleteAPIGuildEmojiResult, RESTDeleteAPIGuildIntegrationResult, RESTDeleteAPIGuildMemberResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildResult, RESTDeleteAPIGuildRoleResult, RESTDeleteAPIGuildScheduledEventResult, RESTDeleteAPIGuildStickerResult, RESTDeleteAPIGuildTemplateResult, RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRuleResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPIGuildBanResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildChannelsResult, RESTGetAPIGuildEmojiResult, RESTGetAPIGuildEmojisResult, RESTGetAPIGuildIntegrationsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTGetAPIGuildPreviewResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTGetAPIGuildQuery, RESTGetAPIGuildResult, RESTGetAPIGuildRolesResult, RESTGetAPIGuildScheduledEventQuery, RESTGetAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTGetAPIGuildStickerResult, RESTGetAPIGuildStickersResult, RESTGetAPIGuildTemplatesResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIGuildWelcomeScreenResult, RESTGetAPIGuildWidgetImageQuery, RESTGetAPIGuildWidgetImageResult, RESTGetAPIGuildWidgetJSONResult, RESTGetAPIGuildWidgetSettingsResult, RESTGetAPITemplateResult, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTPatchAPICurrentGuildMemberJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPIGuildResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleResult, RESTPatchAPIGuildScheduledEventJSONBody, RESTPatchAPIGuildScheduledEventResult, RESTPatchAPIGuildStickerJSONBody, RESTPatchAPIGuildStickerResult, RESTPatchAPIGuildTemplateJSONBody, RESTPatchAPIGuildTemplateResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPostAPIGuildBulkBanJSONBody, RESTPostAPIGuildBulkBanResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPostAPIGuildScheduledEventJSONBody, RESTPostAPIGuildScheduledEventResult, RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerResult, RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsMFAJSONBody, RESTPostAPIGuildsMFAResult, RESTPostAPIGuildsResult, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberRoleResult, RESTPutAPIGuildTemplateSyncResult } from '
|
|
1
|
+
import type { APIThreadChannel, RESTDeleteAPIAutoModerationRuleResult, RESTDeleteAPIGuildBanResult, RESTDeleteAPIGuildEmojiResult, RESTDeleteAPIGuildIntegrationResult, RESTDeleteAPIGuildMemberResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildResult, RESTDeleteAPIGuildRoleResult, RESTDeleteAPIGuildScheduledEventResult, RESTDeleteAPIGuildStickerResult, RESTDeleteAPIGuildTemplateResult, RESTGetAPIAuditLogQuery, RESTGetAPIAuditLogResult, RESTGetAPIAutoModerationRuleResult, RESTGetAPIAutoModerationRulesResult, RESTGetAPICurrentUserVoiceState, RESTGetAPIGuildBanResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildChannelsResult, RESTGetAPIGuildEmojiResult, RESTGetAPIGuildEmojisResult, RESTGetAPIGuildIntegrationsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTGetAPIGuildPreviewResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTGetAPIGuildQuery, RESTGetAPIGuildResult, RESTGetAPIGuildRoleResult, RESTGetAPIGuildRolesResult, RESTGetAPIGuildScheduledEventQuery, RESTGetAPIGuildScheduledEventResult, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTGetAPIGuildStickerResult, RESTGetAPIGuildStickersResult, RESTGetAPIGuildTemplatesResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildWebhooksResult, RESTGetAPIGuildWelcomeScreenResult, RESTGetAPIGuildWidgetImageQuery, RESTGetAPIGuildWidgetImageResult, RESTGetAPIGuildWidgetJSONResult, RESTGetAPIGuildWidgetSettingsResult, RESTGetAPITemplateResult, RESTGetAPIUserVoiceState, RESTPatchAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleResult, RESTPatchAPICurrentGuildMemberJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTPatchAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPIGuildResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleResult, RESTPatchAPIGuildScheduledEventJSONBody, RESTPatchAPIGuildScheduledEventResult, RESTPatchAPIGuildStickerJSONBody, RESTPatchAPIGuildStickerResult, RESTPatchAPIGuildTemplateJSONBody, RESTPatchAPIGuildTemplateResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPostAPIAutoModerationRuleResult, RESTPostAPIGuildBulkBanJSONBody, RESTPostAPIGuildBulkBanResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPostAPIGuildEmojiJSONBody, RESTPostAPIGuildEmojiResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPostAPIGuildScheduledEventJSONBody, RESTPostAPIGuildScheduledEventResult, RESTPostAPIGuildStickerFormDataBody, RESTPostAPIGuildStickerResult, RESTPostAPIGuildTemplatesJSONBody, RESTPostAPIGuildTemplatesResult, RESTPostAPIGuildsJSONBody, RESTPostAPIGuildsMFAJSONBody, RESTPostAPIGuildsMFAResult, RESTPostAPIGuildsResult, RESTPostAPITemplateCreateGuildJSONBody, RESTPostAPITemplateCreateGuildResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberRoleResult, RESTPutAPIGuildTemplateSyncResult } from '../../types';
|
|
2
2
|
import type { Identify, OmitInsert } from '../../common';
|
|
3
3
|
import type { ProxyRequestMethod } from '../Router';
|
|
4
4
|
import type { RestArguments } from '../api';
|
|
@@ -70,6 +70,7 @@ export interface GuildRoutes {
|
|
|
70
70
|
post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIGuildRoleJSONBody>): Promise<RESTPostAPIGuildRoleResult>;
|
|
71
71
|
patch(args: RestArguments<ProxyRequestMethod.Patch, RESTPatchAPIGuildRolePositionsJSONBody>): Promise<RESTPatchAPIGuildRolePositionsResult>;
|
|
72
72
|
(id: string): {
|
|
73
|
+
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPIGuildRoleResult>;
|
|
73
74
|
patch(args: RestArguments<ProxyRequestMethod.Patch, RESTPatchAPIGuildRoleJSONBody>): Promise<RESTPatchAPIGuildRoleResult>;
|
|
74
75
|
delete(args?: RestArguments<ProxyRequestMethod.Delete>): Promise<RESTDeleteAPIGuildRoleResult>;
|
|
75
76
|
};
|
|
@@ -133,9 +134,11 @@ export interface GuildRoutes {
|
|
|
133
134
|
'voice-states': {
|
|
134
135
|
'@me': {
|
|
135
136
|
patch(args: RestArguments<ProxyRequestMethod.Patch, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody>): Promise<RESTPatchAPIGuildVoiceStateCurrentMemberResult>;
|
|
137
|
+
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPICurrentUserVoiceState>;
|
|
136
138
|
};
|
|
137
|
-
(
|
|
139
|
+
(userId: string): {
|
|
138
140
|
patch(args: RestArguments<ProxyRequestMethod.Patch, RESTPatchAPIGuildVoiceStateUserJSONBody>): Promise<RESTPatchAPIGuildVoiceStateUserResult>;
|
|
141
|
+
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPIUserVoiceState>;
|
|
139
142
|
};
|
|
140
143
|
};
|
|
141
144
|
stickers: {
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type { RESTPostAPIInteractionCallbackJSONBody } from '
|
|
1
|
+
import type { RESTPostAPIInteractionCallbackJSONBody, RESTPostAPIInteractionCallbackQuery, RESTPostAPIInteractionCallbackResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface InteractionRoutes {
|
|
5
5
|
interactions: (id: string) => (token: string) => {
|
|
6
6
|
callback: {
|
|
7
|
-
post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIInteractionCallbackJSONBody>
|
|
7
|
+
post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIInteractionCallbackJSONBody, Omit<RESTPostAPIInteractionCallbackQuery, 'with_response'> & {
|
|
8
|
+
with_response: true;
|
|
9
|
+
}>): Promise<RESTPostAPIInteractionCallbackResult>;
|
|
10
|
+
post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIInteractionCallbackJSONBody, Omit<RESTPostAPIInteractionCallbackQuery, 'with_response'> & {
|
|
11
|
+
with_response: false;
|
|
12
|
+
}>): Promise<undefined>;
|
|
13
|
+
post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIInteractionCallbackJSONBody, RESTPostAPIInteractionCallbackQuery>): Promise<RESTPostAPIInteractionCallbackResult | undefined>;
|
|
8
14
|
};
|
|
9
15
|
};
|
|
10
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTDeleteAPIInviteResult, RESTGetAPIInviteQuery, RESTGetAPIInviteResult } from '
|
|
1
|
+
import type { RESTDeleteAPIInviteResult, RESTGetAPIInviteQuery, RESTGetAPIInviteResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface InviteRoutes {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RESTGetAPISKUSubscriptionsResult, RESTGetAPISKUSubscriptionsQuery, RESTGetAPISKUSubscriptionResult } from '../../types';
|
|
2
|
+
import type { RestArguments } from '../api';
|
|
3
|
+
import type { ProxyRequestMethod } from '../Router';
|
|
4
|
+
export interface SKuRoutes {
|
|
5
|
+
skus(id: string): {
|
|
6
|
+
get: (args?: RestArguments<ProxyRequestMethod.Get, RESTGetAPISKUSubscriptionsQuery>) => Promise<RESTGetAPISKUSubscriptionsResult>;
|
|
7
|
+
subscriptions(id: string): {
|
|
8
|
+
get: (args?: RestArguments<ProxyRequestMethod.Get>) => Promise<RESTGetAPISKUSubscriptionResult>;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTDeleteAPIStageInstanceResult, RESTGetAPIStageInstanceResult, RESTPatchAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceResult, RESTPostAPIStageInstanceJSONBody, RESTPostAPIStageInstanceResult } from '
|
|
1
|
+
import type { RESTDeleteAPIStageInstanceResult, RESTGetAPIStageInstanceResult, RESTPatchAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceResult, RESTPostAPIStageInstanceJSONBody, RESTPostAPIStageInstanceResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface StageInstanceRoutes {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTGetAPIStickerResult,
|
|
1
|
+
import type { RESTGetAPIStickerResult, RESTGetStickerPacksResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface StickerRoutes {
|
|
@@ -6,6 +6,6 @@ export interface StickerRoutes {
|
|
|
6
6
|
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPIStickerResult>;
|
|
7
7
|
};
|
|
8
8
|
'sticker-packs': {
|
|
9
|
-
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<
|
|
9
|
+
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetStickerPacksResult>;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIDMChannel, RESTDeleteAPIGuildResult, RESTGetAPICurrentUserApplicationRoleConnectionResult, RESTGetAPICurrentUserConnectionsResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTGetAPICurrentUserResult, RESTGetAPIUserResult, RESTGetCurrentUserGuildMemberResult, RESTPatchAPICurrentUserJSONBody, RESTPatchAPICurrentUserResult, RESTPostAPICurrentUserCreateDMChannelJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionResult } from '
|
|
1
|
+
import type { APIDMChannel, RESTDeleteAPIGuildResult, RESTGetAPICurrentUserApplicationRoleConnectionResult, RESTGetAPICurrentUserConnectionsResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTGetAPICurrentUserResult, RESTGetAPIUserResult, RESTGetCurrentUserGuildMemberResult, RESTPatchAPICurrentUserJSONBody, RESTPatchAPICurrentUserResult, RESTPostAPICurrentUserCreateDMChannelJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTPutAPICurrentUserApplicationRoleConnectionResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface UserRoutes {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTGetAPIVoiceRegionsResult } from '
|
|
1
|
+
import type { RESTGetAPIVoiceRegionsResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface VoiceRoutes {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESTDeleteAPIWebhookResult, RESTDeleteAPIWebhookWithTokenMessageResult, RESTDeleteAPIWebhookWithTokenResult, RESTGetAPIWebhookResult, RESTGetAPIWebhookWithTokenMessageResult, RESTGetAPIWebhookWithTokenResult, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookResult, RESTPatchAPIWebhookWithTokenJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageResult, RESTPatchAPIWebhookWithTokenResult, RESTPostAPIWebhookWithTokenGitHubQuery, RESTPostAPIWebhookWithTokenGitHubResult, RESTPostAPIWebhookWithTokenGitHubWaitResult, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenSlackResult, RESTPostAPIWebhookWithTokenSlackWaitResult, RESTPostAPIWebhookWithTokenWaitResult } from '
|
|
1
|
+
import type { RESTDeleteAPIWebhookResult, RESTDeleteAPIWebhookWithTokenMessageResult, RESTDeleteAPIWebhookWithTokenResult, RESTGetAPIWebhookResult, RESTGetAPIWebhookWithTokenMessageResult, RESTGetAPIWebhookWithTokenResult, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookResult, RESTPatchAPIWebhookWithTokenJSONBody, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageResult, RESTPatchAPIWebhookWithTokenResult, RESTPostAPIWebhookWithTokenGitHubQuery, RESTPostAPIWebhookWithTokenGitHubResult, RESTPostAPIWebhookWithTokenGitHubWaitResult, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenSlackResult, RESTPostAPIWebhookWithTokenSlackWaitResult, RESTPostAPIWebhookWithTokenWaitResult } from '../../types';
|
|
2
2
|
import type { ProxyRequestMethod } from '../Router';
|
|
3
3
|
import type { RestArguments } from '../api';
|
|
4
4
|
export interface WebhookRoutes {
|
|
@@ -17,7 +17,7 @@ export interface WebhookRoutes {
|
|
|
17
17
|
github: {
|
|
18
18
|
post(args: RestArguments<ProxyRequestMethod.Post, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenGitHubQuery>): Promise<RESTPostAPIWebhookWithTokenGitHubResult | RESTPostAPIWebhookWithTokenGitHubWaitResult>;
|
|
19
19
|
};
|
|
20
|
-
messages: (id: string | '@original') => {
|
|
20
|
+
messages: (id: (string & {}) | '@original') => {
|
|
21
21
|
get(args?: RestArguments<ProxyRequestMethod.Get>): Promise<RESTGetAPIWebhookWithTokenMessageResult>;
|
|
22
22
|
patch(args: RestArguments<ProxyRequestMethod.Patch, RESTPatchAPIWebhookWithTokenMessageJSONBody>): Promise<RESTPatchAPIWebhookWithTokenMessageResult>;
|
|
23
23
|
delete(args?: RestArguments<ProxyRequestMethod.Delete>): Promise<RESTDeleteAPIWebhookWithTokenMessageResult>;
|
package/lib/api/api.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare class ApiHandler {
|
|
|
8
8
|
globalBlock: boolean;
|
|
9
9
|
ratelimits: Map<string, Bucket>;
|
|
10
10
|
readyQueue: (() => void)[];
|
|
11
|
-
cdn: import("
|
|
11
|
+
cdn: import("./Routes").CDNRoute;
|
|
12
12
|
debugger?: Logger;
|
|
13
13
|
workerPromises?: Map<string, {
|
|
14
14
|
resolve: (value: any) => any;
|
|
@@ -19,7 +19,7 @@ export declare class ApiHandler {
|
|
|
19
19
|
request<T = any>(method: HttpMethods, url: `/${string}`, { auth, ...request }?: ApiRequestOptions): Promise<T>;
|
|
20
20
|
parseError(response: Response, result: unknown): Error;
|
|
21
21
|
handle50X(method: HttpMethods, url: `/${string}`, request: ApiRequestOptions, next: () => void): Promise<any>;
|
|
22
|
-
handle429(route: string, method: HttpMethods, url: `/${string}`, request: ApiRequestOptions, response: Response, result:
|
|
22
|
+
handle429(route: string, method: HttpMethods, url: `/${string}`, request: ApiRequestOptions, response: Response, result: string, next: () => void, reject: (err: unknown) => void, now: number): Promise<any>;
|
|
23
23
|
clearResetInterval(route: string): void;
|
|
24
24
|
setResetBucket(route: string, resp: Response, now: number, headerNow: number): void;
|
|
25
25
|
setRatelimitsBucket(route: string, resp: Response): void;
|
|
@@ -33,7 +33,7 @@ export declare class ApiHandler {
|
|
|
33
33
|
};
|
|
34
34
|
routefy(url: string, method: HttpMethods): `/${string}`;
|
|
35
35
|
}
|
|
36
|
-
export type RequestOptions = Pick<ApiRequestOptions, 'reason' | 'auth' | 'appendToFormData'>;
|
|
36
|
+
export type RequestOptions = Pick<ApiRequestOptions, 'reason' | 'auth' | 'appendToFormData' | 'token'>;
|
|
37
37
|
export type RequestObject<M extends ProxyRequestMethod, B = Record<string, any>, Q = Record<string, any>, F extends RawFile[] = RawFile[]> = {
|
|
38
38
|
query?: Q;
|
|
39
39
|
} & RequestOptions & (M extends `${ProxyRequestMethod.Get}` ? unknown : {
|
package/lib/api/api.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ApiHandler = void 0;
|
|
4
|
-
const magic_bytes_js_1 = require("magic-bytes.js");
|
|
5
4
|
const node_crypto_1 = require("node:crypto");
|
|
6
5
|
const common_1 = require("../common");
|
|
7
|
-
const functions_1 = require("../structures/extra/functions");
|
|
8
6
|
const Router_1 = require("./Router");
|
|
9
7
|
const bucket_1 = require("./bucket");
|
|
10
8
|
const shared_1 = require("./shared");
|
|
@@ -198,17 +196,19 @@ class ApiHandler {
|
|
|
198
196
|
});
|
|
199
197
|
}
|
|
200
198
|
async handle429(route, method, url, request, response, result, next, reject, now) {
|
|
201
|
-
const content =
|
|
202
|
-
let retryAfter;
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
199
|
+
const content = `${JSON.stringify(request)} `;
|
|
200
|
+
let retryAfter = Number(response.headers.get('x-ratelimit-reset-after') || response.headers.get('retry-after')) * 1000;
|
|
201
|
+
if (Number.isNaN(retryAfter)) {
|
|
202
|
+
try {
|
|
203
|
+
retryAfter = JSON.parse(result).retry_after * 1000;
|
|
204
|
+
}
|
|
205
|
+
catch (err) {
|
|
206
|
+
this.debugger?.warn(`Unexpected error: ${err}`);
|
|
207
|
+
reject(err);
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
210
|
}
|
|
211
|
-
this.debugger?.info(`${response.headers.get('x-ratelimit-global') ? 'Global' : 'Unexpected'} 429: ${result}\n${content} ${now} ${route} ${response.status}: ${this.ratelimits.get(route).remaining}/${this.ratelimits.get(route).limit} left | Reset ${retryAfter} (${this.ratelimits.get(route).reset - now}ms left) | Scope ${response.headers.get('x-ratelimit-scope')}`);
|
|
211
|
+
this.debugger?.info(`${response.headers.get('x-ratelimit-global') ? 'Global' : 'Unexpected'} 429: ${result.slice(0, 256)}\n${content} ${now} ${route} ${response.status}: ${this.ratelimits.get(route).remaining}/${this.ratelimits.get(route).limit} left | Reset ${retryAfter} (${this.ratelimits.get(route).reset - now}ms left) | Scope ${response.headers.get('x-ratelimit-scope')}`);
|
|
212
212
|
if (retryAfter) {
|
|
213
213
|
await (0, common_1.delay)(retryAfter);
|
|
214
214
|
next();
|
|
@@ -287,20 +287,10 @@ class ApiHandler {
|
|
|
287
287
|
for (const [index, file] of options.request.files.entries()) {
|
|
288
288
|
const fileKey = file.key ?? `files[${index}]`;
|
|
289
289
|
if ((0, utils_1.isBufferLike)(file.data)) {
|
|
290
|
-
|
|
291
|
-
if (!contentType) {
|
|
292
|
-
const [parsedType] = (0, magic_bytes_js_1.filetypeinfo)(file.data);
|
|
293
|
-
if (parsedType) {
|
|
294
|
-
contentType =
|
|
295
|
-
shared_1.OverwrittenMimeTypes[parsedType.mime] ??
|
|
296
|
-
parsedType.mime ??
|
|
297
|
-
'application/octet-stream';
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
formData.append(fileKey, new Blob([file.data], { type: contentType }), file.name);
|
|
290
|
+
formData.append(fileKey, new Blob([file.data], { type: file.contentType }), file.filename);
|
|
301
291
|
}
|
|
302
292
|
else {
|
|
303
|
-
formData.append(fileKey, new Blob([`${file.data}`], { type: file.contentType }), file.
|
|
293
|
+
formData.append(fileKey, new Blob([`${file.data}`], { type: file.contentType }), file.filename);
|
|
304
294
|
}
|
|
305
295
|
}
|
|
306
296
|
if (options.request.body) {
|
|
@@ -335,7 +325,7 @@ class ApiHandler {
|
|
|
335
325
|
.replace(/^\/webhooks\/(\d+)\/[A-Za-z0-9-_]{64,}/, '/webhooks/$1/:token');
|
|
336
326
|
if (method === 'DELETE' && route.endsWith('/messages/:id')) {
|
|
337
327
|
const messageID = url.slice(url.lastIndexOf('/') + 1);
|
|
338
|
-
const createdAt = Number((0,
|
|
328
|
+
const createdAt = Number((0, common_1.snowflakeToTimestamp)(messageID));
|
|
339
329
|
if (Date.now() - createdAt >= 1000 * 60 * 60 * 24 * 14) {
|
|
340
330
|
method += '_OLD';
|
|
341
331
|
}
|
package/lib/api/bucket.d.ts
CHANGED
package/lib/api/shared.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { MakeRequired } from '../common';
|
|
3
2
|
export * from './api';
|
|
4
3
|
export * from './utils/constants';
|
|
@@ -21,7 +20,7 @@ export interface RawFile {
|
|
|
21
20
|
contentType?: string;
|
|
22
21
|
data: Buffer | Uint8Array | boolean | number | string;
|
|
23
22
|
key?: string;
|
|
24
|
-
|
|
23
|
+
filename: string;
|
|
25
24
|
}
|
|
26
25
|
export interface ApiRequestOptions {
|
|
27
26
|
body?: Record<string, any>;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
export declare const DefaultUserAgent = "DiscordBot (https://seyfert.dev)";
|
|
1
|
+
export declare const DefaultUserAgent = "DiscordBot (https://seyfert.dev, v2.1.0)";
|
|
2
2
|
export declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
|
|
3
3
|
export declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
|
|
4
|
-
export declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096];
|
|
4
|
+
export declare const ALLOWED_SIZES: readonly [16, 32, 64, 100, 128, 256, 512, 1024, 2048, 4096];
|
|
5
5
|
export type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
|
|
6
6
|
export type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
|
|
7
7
|
export type ImageSize = (typeof ALLOWED_SIZES)[number];
|
|
8
|
-
export declare const OverwrittenMimeTypes: {
|
|
9
|
-
readonly 'image/apng': "image/png";
|
|
10
|
-
};
|