carbon-proxy 0.14.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/README.md +237 -0
- package/dist/package.json +43 -0
- package/dist/src/abstracts/AnySelectMenu.d.ts +40 -0
- package/dist/src/abstracts/AnySelectMenu.d.ts.map +1 -0
- package/dist/src/abstracts/AnySelectMenu.js +41 -0
- package/dist/src/abstracts/AnySelectMenu.js.map +1 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.d.ts +12 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.js +19 -0
- package/dist/src/abstracts/AnySelectMenuInteraction.js.map +1 -0
- package/dist/src/abstracts/Base.d.ts +10 -0
- package/dist/src/abstracts/Base.d.ts.map +1 -0
- package/dist/src/abstracts/Base.js +11 -0
- package/dist/src/abstracts/Base.js.map +1 -0
- package/dist/src/abstracts/BaseChannel.d.ts +60 -0
- package/dist/src/abstracts/BaseChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseChannel.js +90 -0
- package/dist/src/abstracts/BaseChannel.js.map +1 -0
- package/dist/src/abstracts/BaseCommand.d.ts +77 -0
- package/dist/src/abstracts/BaseCommand.d.ts.map +1 -0
- package/dist/src/abstracts/BaseCommand.js +127 -0
- package/dist/src/abstracts/BaseCommand.js.map +1 -0
- package/dist/src/abstracts/BaseComponent.d.ts +20 -0
- package/dist/src/abstracts/BaseComponent.d.ts.map +1 -0
- package/dist/src/abstracts/BaseComponent.js +10 -0
- package/dist/src/abstracts/BaseComponent.js.map +1 -0
- package/dist/src/abstracts/BaseComponentInteraction.d.ts +18 -0
- package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/BaseComponentInteraction.js +41 -0
- package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -0
- package/dist/src/abstracts/BaseGuildChannel.d.ts +61 -0
- package/dist/src/abstracts/BaseGuildChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseGuildChannel.js +125 -0
- package/dist/src/abstracts/BaseGuildChannel.js.map +1 -0
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts +53 -0
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseGuildTextChannel.js +89 -0
- package/dist/src/abstracts/BaseGuildTextChannel.js.map +1 -0
- package/dist/src/abstracts/BaseInteraction.d.ts +166 -0
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/BaseInteraction.js +274 -0
- package/dist/src/abstracts/BaseInteraction.js.map +1 -0
- package/dist/src/abstracts/BaseListener.d.ts +13 -0
- package/dist/src/abstracts/BaseListener.d.ts.map +1 -0
- package/dist/src/abstracts/BaseListener.js +8 -0
- package/dist/src/abstracts/BaseListener.js.map +1 -0
- package/dist/src/abstracts/BaseMessageInteractiveComponent.d.ts +41 -0
- package/dist/src/abstracts/BaseMessageInteractiveComponent.d.ts.map +1 -0
- package/dist/src/abstracts/BaseMessageInteractiveComponent.js +35 -0
- package/dist/src/abstracts/BaseMessageInteractiveComponent.js.map +1 -0
- package/dist/src/abstracts/BaseModalComponent.d.ts +9 -0
- package/dist/src/abstracts/BaseModalComponent.d.ts.map +1 -0
- package/dist/src/abstracts/BaseModalComponent.js +5 -0
- package/dist/src/abstracts/BaseModalComponent.js.map +1 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts +58 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts.map +1 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.js +102 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.js.map +1 -0
- package/dist/src/abstracts/Plugin.d.ts +49 -0
- package/dist/src/abstracts/Plugin.d.ts.map +1 -0
- package/dist/src/abstracts/Plugin.js +6 -0
- package/dist/src/abstracts/Plugin.js.map +1 -0
- package/dist/src/adapters/bun/index.d.ts +13 -0
- package/dist/src/adapters/bun/index.d.ts.map +1 -0
- package/dist/src/adapters/bun/index.js +16 -0
- package/dist/src/adapters/bun/index.js.map +1 -0
- package/dist/src/adapters/fetch/index.d.ts +11 -0
- package/dist/src/adapters/fetch/index.d.ts.map +1 -0
- package/dist/src/adapters/fetch/index.js +50 -0
- package/dist/src/adapters/fetch/index.js.map +1 -0
- package/dist/src/adapters/node/index.d.ts +13 -0
- package/dist/src/adapters/node/index.d.ts.map +1 -0
- package/dist/src/adapters/node/index.js +17 -0
- package/dist/src/adapters/node/index.js.map +1 -0
- package/dist/src/classes/Client.d.ts +253 -0
- package/dist/src/classes/Client.d.ts.map +1 -0
- package/dist/src/classes/Client.js +419 -0
- package/dist/src/classes/Client.js.map +1 -0
- package/dist/src/classes/Command.d.ts +44 -0
- package/dist/src/classes/Command.d.ts.map +1 -0
- package/dist/src/classes/Command.js +53 -0
- package/dist/src/classes/Command.js.map +1 -0
- package/dist/src/classes/CommandWithSubcommandGroups.d.ts +22 -0
- package/dist/src/classes/CommandWithSubcommandGroups.d.ts.map +1 -0
- package/dist/src/classes/CommandWithSubcommandGroups.js +27 -0
- package/dist/src/classes/CommandWithSubcommandGroups.js.map +1 -0
- package/dist/src/classes/CommandWithSubcommands.d.ts +19 -0
- package/dist/src/classes/CommandWithSubcommands.d.ts.map +1 -0
- package/dist/src/classes/CommandWithSubcommands.js +19 -0
- package/dist/src/classes/CommandWithSubcommands.js.map +1 -0
- package/dist/src/classes/Embed.d.ts +61 -0
- package/dist/src/classes/Embed.d.ts.map +1 -0
- package/dist/src/classes/Embed.js +75 -0
- package/dist/src/classes/Embed.js.map +1 -0
- package/dist/src/classes/Listener.d.ts +392 -0
- package/dist/src/classes/Listener.d.ts.map +1 -0
- package/dist/src/classes/Listener.js +1034 -0
- package/dist/src/classes/Listener.js.map +1 -0
- package/dist/src/classes/Modal.d.ts +37 -0
- package/dist/src/classes/Modal.d.ts.map +1 -0
- package/dist/src/classes/Modal.js +28 -0
- package/dist/src/classes/Modal.js.map +1 -0
- package/dist/src/classes/RequestClient.d.ts +106 -0
- package/dist/src/classes/RequestClient.d.ts.map +1 -0
- package/dist/src/classes/RequestClient.js +451 -0
- package/dist/src/classes/RequestClient.js.map +1 -0
- package/dist/src/classes/components/Button.d.ts +52 -0
- package/dist/src/classes/components/Button.d.ts.map +1 -0
- package/dist/src/classes/components/Button.js +71 -0
- package/dist/src/classes/components/Button.js.map +1 -0
- package/dist/src/classes/components/ChannelSelectMenu.d.ts +17 -0
- package/dist/src/classes/components/ChannelSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/components/ChannelSelectMenu.js +22 -0
- package/dist/src/classes/components/ChannelSelectMenu.js.map +1 -0
- package/dist/src/classes/components/Checkbox.d.ts +12 -0
- package/dist/src/classes/components/Checkbox.d.ts.map +1 -0
- package/dist/src/classes/components/Checkbox.js +20 -0
- package/dist/src/classes/components/Checkbox.js.map +1 -0
- package/dist/src/classes/components/CheckboxGroup.d.ts +24 -0
- package/dist/src/classes/components/CheckboxGroup.d.ts.map +1 -0
- package/dist/src/classes/components/CheckboxGroup.js +37 -0
- package/dist/src/classes/components/CheckboxGroup.js.map +1 -0
- package/dist/src/classes/components/Container.d.ts +28 -0
- package/dist/src/classes/components/Container.d.ts.map +1 -0
- package/dist/src/classes/components/Container.js +38 -0
- package/dist/src/classes/components/Container.js.map +1 -0
- package/dist/src/classes/components/File.d.ts +21 -0
- package/dist/src/classes/components/File.d.ts.map +1 -0
- package/dist/src/classes/components/File.js +36 -0
- package/dist/src/classes/components/File.js.map +1 -0
- package/dist/src/classes/components/FileUpload.d.ts +23 -0
- package/dist/src/classes/components/FileUpload.d.ts.map +1 -0
- package/dist/src/classes/components/FileUpload.js +36 -0
- package/dist/src/classes/components/FileUpload.js.map +1 -0
- package/dist/src/classes/components/Label.d.ts +31 -0
- package/dist/src/classes/components/Label.d.ts.map +1 -0
- package/dist/src/classes/components/Label.js +35 -0
- package/dist/src/classes/components/Label.js.map +1 -0
- package/dist/src/classes/components/MediaGallery.d.ts +22 -0
- package/dist/src/classes/components/MediaGallery.d.ts.map +1 -0
- package/dist/src/classes/components/MediaGallery.js +32 -0
- package/dist/src/classes/components/MediaGallery.js.map +1 -0
- package/dist/src/classes/components/MentionableSelectMenu.d.ts +15 -0
- package/dist/src/classes/components/MentionableSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/components/MentionableSelectMenu.js +20 -0
- package/dist/src/classes/components/MentionableSelectMenu.js.map +1 -0
- package/dist/src/classes/components/RadioGroup.d.ts +24 -0
- package/dist/src/classes/components/RadioGroup.d.ts.map +1 -0
- package/dist/src/classes/components/RadioGroup.js +33 -0
- package/dist/src/classes/components/RadioGroup.js.map +1 -0
- package/dist/src/classes/components/RoleSelectMenu.d.ts +15 -0
- package/dist/src/classes/components/RoleSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/components/RoleSelectMenu.js +20 -0
- package/dist/src/classes/components/RoleSelectMenu.js.map +1 -0
- package/dist/src/classes/components/Row.d.ts +28 -0
- package/dist/src/classes/components/Row.d.ts.map +1 -0
- package/dist/src/classes/components/Row.js +44 -0
- package/dist/src/classes/components/Row.js.map +1 -0
- package/dist/src/classes/components/Section.d.ts +23 -0
- package/dist/src/classes/components/Section.d.ts.map +1 -0
- package/dist/src/classes/components/Section.js +37 -0
- package/dist/src/classes/components/Section.js.map +1 -0
- package/dist/src/classes/components/Separator.d.ts +22 -0
- package/dist/src/classes/components/Separator.d.ts.map +1 -0
- package/dist/src/classes/components/Separator.js +33 -0
- package/dist/src/classes/components/Separator.js.map +1 -0
- package/dist/src/classes/components/StringSelectMenu.d.ts +15 -0
- package/dist/src/classes/components/StringSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/components/StringSelectMenu.js +19 -0
- package/dist/src/classes/components/StringSelectMenu.js.map +1 -0
- package/dist/src/classes/components/TextDisplay.d.ts +10 -0
- package/dist/src/classes/components/TextDisplay.d.ts.map +1 -0
- package/dist/src/classes/components/TextDisplay.js +22 -0
- package/dist/src/classes/components/TextDisplay.js.map +1 -0
- package/dist/src/classes/components/TextInput.d.ts +53 -0
- package/dist/src/classes/components/TextInput.d.ts.map +1 -0
- package/dist/src/classes/components/TextInput.js +57 -0
- package/dist/src/classes/components/TextInput.js.map +1 -0
- package/dist/src/classes/components/Thumbnail.d.ts +14 -0
- package/dist/src/classes/components/Thumbnail.d.ts.map +1 -0
- package/dist/src/classes/components/Thumbnail.js +27 -0
- package/dist/src/classes/components/Thumbnail.js.map +1 -0
- package/dist/src/classes/components/UserSelectMenu.d.ts +15 -0
- package/dist/src/classes/components/UserSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/components/UserSelectMenu.js +20 -0
- package/dist/src/classes/components/UserSelectMenu.js.map +1 -0
- package/dist/src/errors/BaseError.d.ts +3 -0
- package/dist/src/errors/BaseError.d.ts.map +1 -0
- package/dist/src/errors/BaseError.js +3 -0
- package/dist/src/errors/BaseError.js.map +1 -0
- package/dist/src/errors/DiscordError.d.ts +25 -0
- package/dist/src/errors/DiscordError.d.ts.map +1 -0
- package/dist/src/errors/DiscordError.js +31 -0
- package/dist/src/errors/DiscordError.js.map +1 -0
- package/dist/src/errors/RatelimitError.d.ts +15 -0
- package/dist/src/errors/RatelimitError.d.ts.map +1 -0
- package/dist/src/errors/RatelimitError.js +18 -0
- package/dist/src/errors/RatelimitError.js.map +1 -0
- package/dist/src/functions/channelFactory.d.ts +14 -0
- package/dist/src/functions/channelFactory.d.ts.map +1 -0
- package/dist/src/functions/channelFactory.js +39 -0
- package/dist/src/functions/channelFactory.js.map +1 -0
- package/dist/src/functions/enforceChoicesLimit.d.ts +3 -0
- package/dist/src/functions/enforceChoicesLimit.d.ts.map +1 -0
- package/dist/src/functions/enforceChoicesLimit.js +17 -0
- package/dist/src/functions/enforceChoicesLimit.js.map +1 -0
- package/dist/src/functions/errorsMapper.d.ts +14 -0
- package/dist/src/functions/errorsMapper.d.ts.map +1 -0
- package/dist/src/functions/errorsMapper.js +46 -0
- package/dist/src/functions/errorsMapper.js.map +1 -0
- package/dist/src/index.d.ts +93 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +100 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/internals/AutocompleteInteraction.d.ts +43 -0
- package/dist/src/internals/AutocompleteInteraction.d.ts.map +1 -0
- package/dist/src/internals/AutocompleteInteraction.js +73 -0
- package/dist/src/internals/AutocompleteInteraction.js.map +1 -0
- package/dist/src/internals/ButtonInteraction.d.ts +8 -0
- package/dist/src/internals/ButtonInteraction.d.ts.map +1 -0
- package/dist/src/internals/ButtonInteraction.js +16 -0
- package/dist/src/internals/ButtonInteraction.js.map +1 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.d.ts +8 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.js +11 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/CommandHandler.d.ts +13 -0
- package/dist/src/internals/CommandHandler.d.ts.map +1 -0
- package/dist/src/internals/CommandHandler.js +143 -0
- package/dist/src/internals/CommandHandler.js.map +1 -0
- package/dist/src/internals/CommandInteraction.d.ts +26 -0
- package/dist/src/internals/CommandInteraction.d.ts.map +1 -0
- package/dist/src/internals/CommandInteraction.js +60 -0
- package/dist/src/internals/CommandInteraction.js.map +1 -0
- package/dist/src/internals/ComponentHandler.d.ts +14 -0
- package/dist/src/internals/ComponentHandler.d.ts.map +1 -0
- package/dist/src/internals/ComponentHandler.js +183 -0
- package/dist/src/internals/ComponentHandler.js.map +1 -0
- package/dist/src/internals/EmojiHandler.d.ts +19 -0
- package/dist/src/internals/EmojiHandler.d.ts.map +1 -0
- package/dist/src/internals/EmojiHandler.js +34 -0
- package/dist/src/internals/EmojiHandler.js.map +1 -0
- package/dist/src/internals/EventHandler.d.ts +22 -0
- package/dist/src/internals/EventHandler.d.ts.map +1 -0
- package/dist/src/internals/EventHandler.js +23 -0
- package/dist/src/internals/EventHandler.js.map +1 -0
- package/dist/src/internals/EventQueue.d.ts +59 -0
- package/dist/src/internals/EventQueue.d.ts.map +1 -0
- package/dist/src/internals/EventQueue.js +131 -0
- package/dist/src/internals/EventQueue.js.map +1 -0
- package/dist/src/internals/FieldsHandler.d.ts +68 -0
- package/dist/src/internals/FieldsHandler.d.ts.map +1 -0
- package/dist/src/internals/FieldsHandler.js +146 -0
- package/dist/src/internals/FieldsHandler.js.map +1 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.js +15 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/ModalHandler.d.ts +17 -0
- package/dist/src/internals/ModalHandler.d.ts.map +1 -0
- package/dist/src/internals/ModalHandler.js +35 -0
- package/dist/src/internals/ModalHandler.js.map +1 -0
- package/dist/src/internals/ModalInteraction.d.ts +21 -0
- package/dist/src/internals/ModalInteraction.d.ts.map +1 -0
- package/dist/src/internals/ModalInteraction.js +41 -0
- package/dist/src/internals/ModalInteraction.js.map +1 -0
- package/dist/src/internals/OptionsHandler.d.ts +108 -0
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -0
- package/dist/src/internals/OptionsHandler.js +237 -0
- package/dist/src/internals/OptionsHandler.js.map +1 -0
- package/dist/src/internals/RoleSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/RoleSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/RoleSelectMenuInteraction.js +14 -0
- package/dist/src/internals/RoleSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/StringSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/StringSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/StringSelectMenuInteraction.js +14 -0
- package/dist/src/internals/StringSelectMenuInteraction.js.map +1 -0
- package/dist/src/internals/TemporaryListenerManager.d.ts +20 -0
- package/dist/src/internals/TemporaryListenerManager.d.ts.map +1 -0
- package/dist/src/internals/TemporaryListenerManager.js +59 -0
- package/dist/src/internals/TemporaryListenerManager.js.map +1 -0
- package/dist/src/internals/UserSelectMenuInteraction.d.ts +9 -0
- package/dist/src/internals/UserSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/internals/UserSelectMenuInteraction.js +14 -0
- package/dist/src/internals/UserSelectMenuInteraction.js.map +1 -0
- package/dist/src/permissions.d.ts +56 -0
- package/dist/src/permissions.d.ts.map +1 -0
- package/dist/src/permissions.js +4 -0
- package/dist/src/permissions.js.map +1 -0
- package/dist/src/plugins/client-manager/ClientManager.d.ts +151 -0
- package/dist/src/plugins/client-manager/ClientManager.d.ts.map +1 -0
- package/dist/src/plugins/client-manager/ClientManager.js +253 -0
- package/dist/src/plugins/client-manager/ClientManager.js.map +1 -0
- package/dist/src/plugins/client-manager/index.d.ts +2 -0
- package/dist/src/plugins/client-manager/index.d.ts.map +1 -0
- package/dist/src/plugins/client-manager/index.js +2 -0
- package/dist/src/plugins/client-manager/index.js.map +1 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.d.ts +16 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.d.ts.map +1 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.js +43 -0
- package/dist/src/plugins/command-data/CommandDataPlugin.js.map +1 -0
- package/dist/src/plugins/command-data/index.d.ts +2 -0
- package/dist/src/plugins/command-data/index.d.ts.map +1 -0
- package/dist/src/plugins/command-data/index.js +2 -0
- package/dist/src/plugins/command-data/index.js.map +1 -0
- package/dist/src/plugins/gateway/BabyCache.d.ts +16 -0
- package/dist/src/plugins/gateway/BabyCache.d.ts.map +1 -0
- package/dist/src/plugins/gateway/BabyCache.js +53 -0
- package/dist/src/plugins/gateway/BabyCache.js.map +1 -0
- package/dist/src/plugins/gateway/GatewayPlugin.d.ts +90 -0
- package/dist/src/plugins/gateway/GatewayPlugin.d.ts.map +1 -0
- package/dist/src/plugins/gateway/GatewayPlugin.js +516 -0
- package/dist/src/plugins/gateway/GatewayPlugin.js.map +1 -0
- package/dist/src/plugins/gateway/InteractionEventListener.d.ts +8 -0
- package/dist/src/plugins/gateway/InteractionEventListener.d.ts.map +1 -0
- package/dist/src/plugins/gateway/InteractionEventListener.js +9 -0
- package/dist/src/plugins/gateway/InteractionEventListener.js.map +1 -0
- package/dist/src/plugins/gateway/index.d.ts +7 -0
- package/dist/src/plugins/gateway/index.d.ts.map +1 -0
- package/dist/src/plugins/gateway/index.js +7 -0
- package/dist/src/plugins/gateway/index.js.map +1 -0
- package/dist/src/plugins/gateway/types.d.ts +130 -0
- package/dist/src/plugins/gateway/types.d.ts.map +1 -0
- package/dist/src/plugins/gateway/types.js +5 -0
- package/dist/src/plugins/gateway/types.js.map +1 -0
- package/dist/src/plugins/gateway/utils/heartbeat.d.ts +18 -0
- package/dist/src/plugins/gateway/utils/heartbeat.d.ts.map +1 -0
- package/dist/src/plugins/gateway/utils/heartbeat.js +33 -0
- package/dist/src/plugins/gateway/utils/heartbeat.js.map +1 -0
- package/dist/src/plugins/gateway/utils/monitor.d.ts +37 -0
- package/dist/src/plugins/gateway/utils/monitor.d.ts.map +1 -0
- package/dist/src/plugins/gateway/utils/monitor.js +88 -0
- package/dist/src/plugins/gateway/utils/monitor.js.map +1 -0
- package/dist/src/plugins/gateway/utils/payload.d.ts +24 -0
- package/dist/src/plugins/gateway/utils/payload.d.ts.map +1 -0
- package/dist/src/plugins/gateway/utils/payload.js +65 -0
- package/dist/src/plugins/gateway/utils/payload.js.map +1 -0
- package/dist/src/plugins/gateway/utils/rateLimit.d.ts +41 -0
- package/dist/src/plugins/gateway/utils/rateLimit.d.ts.map +1 -0
- package/dist/src/plugins/gateway/utils/rateLimit.js +61 -0
- package/dist/src/plugins/gateway/utils/rateLimit.js.map +1 -0
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.d.ts +30 -0
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.d.ts.map +1 -0
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.js +80 -0
- package/dist/src/plugins/gateway-forwarder/GatewayForwarderPlugin.js.map +1 -0
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.d.ts +9 -0
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.d.ts.map +1 -0
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.js +7 -0
- package/dist/src/plugins/gateway-forwarder/ShardedGatewayForwarderPlugin.js.map +1 -0
- package/dist/src/plugins/gateway-forwarder/index.d.ts +4 -0
- package/dist/src/plugins/gateway-forwarder/index.d.ts.map +1 -0
- package/dist/src/plugins/gateway-forwarder/index.js +4 -0
- package/dist/src/plugins/gateway-forwarder/index.js.map +1 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.d.ts +70 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.js +211 -0
- package/dist/src/plugins/linked-roles/LinkedRoles.js.map +1 -0
- package/dist/src/plugins/linked-roles/index.d.ts +3 -0
- package/dist/src/plugins/linked-roles/index.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/index.js +3 -0
- package/dist/src/plugins/linked-roles/index.js.map +1 -0
- package/dist/src/plugins/linked-roles/types.d.ts +94 -0
- package/dist/src/plugins/linked-roles/types.d.ts.map +1 -0
- package/dist/src/plugins/linked-roles/types.js +39 -0
- package/dist/src/plugins/linked-roles/types.js.map +1 -0
- package/dist/src/plugins/paginator/GoToPageModal.d.ts +18 -0
- package/dist/src/plugins/paginator/GoToPageModal.d.ts.map +1 -0
- package/dist/src/plugins/paginator/GoToPageModal.js +56 -0
- package/dist/src/plugins/paginator/GoToPageModal.js.map +1 -0
- package/dist/src/plugins/paginator/Paginator.d.ts +53 -0
- package/dist/src/plugins/paginator/Paginator.d.ts.map +1 -0
- package/dist/src/plugins/paginator/Paginator.js +183 -0
- package/dist/src/plugins/paginator/Paginator.js.map +1 -0
- package/dist/src/plugins/paginator/index.d.ts +11 -0
- package/dist/src/plugins/paginator/index.d.ts.map +1 -0
- package/dist/src/plugins/paginator/index.js +11 -0
- package/dist/src/plugins/paginator/index.js.map +1 -0
- package/dist/src/plugins/sharding/ShardingPlugin.d.ts +44 -0
- package/dist/src/plugins/sharding/ShardingPlugin.d.ts.map +1 -0
- package/dist/src/plugins/sharding/ShardingPlugin.js +119 -0
- package/dist/src/plugins/sharding/ShardingPlugin.js.map +1 -0
- package/dist/src/plugins/sharding/index.d.ts +3 -0
- package/dist/src/plugins/sharding/index.d.ts.map +1 -0
- package/dist/src/plugins/sharding/index.js +3 -0
- package/dist/src/plugins/sharding/index.js.map +1 -0
- package/dist/src/plugins/voice/GuildDeleteListener.d.ts +7 -0
- package/dist/src/plugins/voice/GuildDeleteListener.d.ts.map +1 -0
- package/dist/src/plugins/voice/GuildDeleteListener.js +11 -0
- package/dist/src/plugins/voice/GuildDeleteListener.js.map +1 -0
- package/dist/src/plugins/voice/VoicePlugin.d.ts +15 -0
- package/dist/src/plugins/voice/VoicePlugin.d.ts.map +1 -0
- package/dist/src/plugins/voice/VoicePlugin.js +58 -0
- package/dist/src/plugins/voice/VoicePlugin.js.map +1 -0
- package/dist/src/plugins/voice/VoiceServerUpdateListener.d.ts +10 -0
- package/dist/src/plugins/voice/VoiceServerUpdateListener.d.ts.map +1 -0
- package/dist/src/plugins/voice/VoiceServerUpdateListener.js +16 -0
- package/dist/src/plugins/voice/VoiceServerUpdateListener.js.map +1 -0
- package/dist/src/plugins/voice/VoiceStateUpdateListener.d.ts +10 -0
- package/dist/src/plugins/voice/VoiceStateUpdateListener.d.ts.map +1 -0
- package/dist/src/plugins/voice/VoiceStateUpdateListener.js +21 -0
- package/dist/src/plugins/voice/VoiceStateUpdateListener.js.map +1 -0
- package/dist/src/plugins/voice/index.d.ts +2 -0
- package/dist/src/plugins/voice/index.d.ts.map +1 -0
- package/dist/src/plugins/voice/index.js +2 -0
- package/dist/src/plugins/voice/index.js.map +1 -0
- package/dist/src/structures/DmChannel.d.ts +22 -0
- package/dist/src/structures/DmChannel.d.ts.map +1 -0
- package/dist/src/structures/DmChannel.js +33 -0
- package/dist/src/structures/DmChannel.js.map +1 -0
- package/dist/src/structures/Emoji.d.ts +75 -0
- package/dist/src/structures/Emoji.d.ts.map +1 -0
- package/dist/src/structures/Emoji.js +156 -0
- package/dist/src/structures/Emoji.js.map +1 -0
- package/dist/src/structures/GroupDmChannel.d.ts +75 -0
- package/dist/src/structures/GroupDmChannel.d.ts.map +1 -0
- package/dist/src/structures/GroupDmChannel.js +131 -0
- package/dist/src/structures/GroupDmChannel.js.map +1 -0
- package/dist/src/structures/Guild.d.ts +338 -0
- package/dist/src/structures/Guild.d.ts.map +1 -0
- package/dist/src/structures/Guild.js +715 -0
- package/dist/src/structures/Guild.js.map +1 -0
- package/dist/src/structures/GuildAnnouncementChannel.d.ts +21 -0
- package/dist/src/structures/GuildAnnouncementChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildAnnouncementChannel.js +35 -0
- package/dist/src/structures/GuildAnnouncementChannel.js.map +1 -0
- package/dist/src/structures/GuildCategoryChannel.d.ts +23 -0
- package/dist/src/structures/GuildCategoryChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildCategoryChannel.js +34 -0
- package/dist/src/structures/GuildCategoryChannel.js.map +1 -0
- package/dist/src/structures/GuildForumChannel.d.ts +14 -0
- package/dist/src/structures/GuildForumChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildForumChannel.js +15 -0
- package/dist/src/structures/GuildForumChannel.js.map +1 -0
- package/dist/src/structures/GuildMediaChannel.d.ts +9 -0
- package/dist/src/structures/GuildMediaChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildMediaChannel.js +7 -0
- package/dist/src/structures/GuildMediaChannel.js.map +1 -0
- package/dist/src/structures/GuildMember.d.ts +145 -0
- package/dist/src/structures/GuildMember.d.ts.map +1 -0
- package/dist/src/structures/GuildMember.js +320 -0
- package/dist/src/structures/GuildMember.js.map +1 -0
- package/dist/src/structures/GuildScheduledEvent.d.ts +121 -0
- package/dist/src/structures/GuildScheduledEvent.d.ts.map +1 -0
- package/dist/src/structures/GuildScheduledEvent.js +228 -0
- package/dist/src/structures/GuildScheduledEvent.js.map +1 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts +40 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.js +63 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.js.map +1 -0
- package/dist/src/structures/GuildTextChannel.d.ts +24 -0
- package/dist/src/structures/GuildTextChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildTextChannel.js +41 -0
- package/dist/src/structures/GuildTextChannel.js.map +1 -0
- package/dist/src/structures/GuildThreadChannel.d.ts +90 -0
- package/dist/src/structures/GuildThreadChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildThreadChannel.js +165 -0
- package/dist/src/structures/GuildThreadChannel.js.map +1 -0
- package/dist/src/structures/Message.d.ts +174 -0
- package/dist/src/structures/Message.d.ts.map +1 -0
- package/dist/src/structures/Message.js +417 -0
- package/dist/src/structures/Message.js.map +1 -0
- package/dist/src/structures/Poll.d.ts +29 -0
- package/dist/src/structures/Poll.d.ts.map +1 -0
- package/dist/src/structures/Poll.js +51 -0
- package/dist/src/structures/Poll.js.map +1 -0
- package/dist/src/structures/Role.d.ts +151 -0
- package/dist/src/structures/Role.d.ts.map +1 -0
- package/dist/src/structures/Role.js +291 -0
- package/dist/src/structures/Role.js.map +1 -0
- package/dist/src/structures/ThreadMember.d.ts +40 -0
- package/dist/src/structures/ThreadMember.d.ts.map +1 -0
- package/dist/src/structures/ThreadMember.js +79 -0
- package/dist/src/structures/ThreadMember.js.map +1 -0
- package/dist/src/structures/User.d.ts +104 -0
- package/dist/src/structures/User.d.ts.map +1 -0
- package/dist/src/structures/User.js +199 -0
- package/dist/src/structures/User.js.map +1 -0
- package/dist/src/structures/Webhook.d.ts +160 -0
- package/dist/src/structures/Webhook.d.ts.map +1 -0
- package/dist/src/structures/Webhook.js +287 -0
- package/dist/src/structures/Webhook.js.map +1 -0
- package/dist/src/types/index.d.ts +199 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +2 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/listeners.d.ts +579 -0
- package/dist/src/types/listeners.d.ts.map +1 -0
- package/dist/src/types/listeners.js +14 -0
- package/dist/src/types/listeners.js.map +1 -0
- package/dist/src/utils/LRUCache.d.ts +46 -0
- package/dist/src/utils/LRUCache.d.ts.map +1 -0
- package/dist/src/utils/LRUCache.js +78 -0
- package/dist/src/utils/LRUCache.js.map +1 -0
- package/dist/src/utils/cdn.d.ts +31 -0
- package/dist/src/utils/cdn.d.ts.map +1 -0
- package/dist/src/utils/cdn.js +18 -0
- package/dist/src/utils/cdn.js.map +1 -0
- package/dist/src/utils/customIdParser.d.ts +3 -0
- package/dist/src/utils/customIdParser.d.ts.map +1 -0
- package/dist/src/utils/customIdParser.js +38 -0
- package/dist/src/utils/customIdParser.js.map +1 -0
- package/dist/src/utils/index.d.ts +6 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +6 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/payload.d.ts +4 -0
- package/dist/src/utils/payload.d.ts.map +1 -0
- package/dist/src/utils/payload.js +61 -0
- package/dist/src/utils/payload.js.map +1 -0
- package/dist/src/utils/proxy.d.ts +27 -0
- package/dist/src/utils/proxy.d.ts.map +1 -0
- package/dist/src/utils/proxy.js +135 -0
- package/dist/src/utils/proxy.js.map +1 -0
- package/dist/src/utils/verification.d.ts +4 -0
- package/dist/src/utils/verification.d.ts.map +1 -0
- package/dist/src/utils/verification.js +52 -0
- package/dist/src/utils/verification.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import { buildCDNUrl, serializePayload } from "../utils/index.js";
|
|
4
|
+
import { Message } from "./Message.js";
|
|
5
|
+
export class User extends Base {
|
|
6
|
+
constructor(client, rawDataOrId) {
|
|
7
|
+
super(client);
|
|
8
|
+
if (typeof rawDataOrId === "string") {
|
|
9
|
+
this.id = rawDataOrId;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
this._rawData = rawDataOrId;
|
|
13
|
+
this.id = rawDataOrId.id;
|
|
14
|
+
this.setData(rawDataOrId);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
_rawData = null;
|
|
18
|
+
setData(data) {
|
|
19
|
+
if (!data)
|
|
20
|
+
throw new Error("Cannot set data without having data... smh");
|
|
21
|
+
this._rawData = data;
|
|
22
|
+
}
|
|
23
|
+
// private setField(key: keyof APIUser, value: unknown) {
|
|
24
|
+
// if (!this.rawData) throw new Error("Cannot set field without having data... smh")
|
|
25
|
+
// Reflect.set(this.rawData, key, value)
|
|
26
|
+
// }
|
|
27
|
+
/**
|
|
28
|
+
* The raw Discord API data for this user
|
|
29
|
+
*/
|
|
30
|
+
get rawData() {
|
|
31
|
+
if (!this._rawData)
|
|
32
|
+
throw new Error("Cannot access rawData on partial User. Use fetch() to populate data.");
|
|
33
|
+
return this._rawData;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The ID of the user
|
|
37
|
+
*/
|
|
38
|
+
id;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the user is a partial user (meaning it does not have all the data).
|
|
41
|
+
* If this is true, you should use {@link User.fetch} to get the full data of the user.
|
|
42
|
+
*/
|
|
43
|
+
get partial() {
|
|
44
|
+
return (this._rawData === null);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The username of the user.
|
|
48
|
+
*/
|
|
49
|
+
get username() {
|
|
50
|
+
if (!this._rawData)
|
|
51
|
+
return undefined;
|
|
52
|
+
return this._rawData.username;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The global name of the user.
|
|
56
|
+
*/
|
|
57
|
+
get globalName() {
|
|
58
|
+
if (!this._rawData)
|
|
59
|
+
return undefined;
|
|
60
|
+
return this._rawData.global_name;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The discriminator of the user.
|
|
64
|
+
*/
|
|
65
|
+
get discriminator() {
|
|
66
|
+
if (!this._rawData)
|
|
67
|
+
return undefined;
|
|
68
|
+
return this._rawData.discriminator;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Is this user a bot?
|
|
72
|
+
*/
|
|
73
|
+
get bot() {
|
|
74
|
+
if (!this._rawData)
|
|
75
|
+
return undefined;
|
|
76
|
+
return this._rawData.bot ?? false;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Is this user a system user?
|
|
80
|
+
*/
|
|
81
|
+
get system() {
|
|
82
|
+
if (!this._rawData)
|
|
83
|
+
return undefined;
|
|
84
|
+
return this._rawData.system ?? false;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The public flags of the user. (Bitfield)
|
|
88
|
+
* @see https://discord.com/developers/docs/resources/user#user-object-user-flags
|
|
89
|
+
*/
|
|
90
|
+
get flags() {
|
|
91
|
+
if (!this._rawData)
|
|
92
|
+
return undefined;
|
|
93
|
+
return this._rawData.public_flags;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The avatar hash of the user.
|
|
97
|
+
* You can use {@link User.avatarUrl} to get the URL of the avatar.
|
|
98
|
+
*/
|
|
99
|
+
get avatar() {
|
|
100
|
+
if (!this._rawData)
|
|
101
|
+
return undefined;
|
|
102
|
+
return this._rawData.avatar;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get the URL of the user's avatar with default settings (png format)
|
|
106
|
+
*/
|
|
107
|
+
get avatarUrl() {
|
|
108
|
+
if (!this._rawData)
|
|
109
|
+
return undefined;
|
|
110
|
+
return buildCDNUrl(`https://cdn.discordapp.com/avatars/${this.id}`, this.avatar);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get the URL of the user's avatar with custom format and size options
|
|
114
|
+
* @param options Optional format and size parameters
|
|
115
|
+
* @returns The avatar URL or null if no avatar is set
|
|
116
|
+
*/
|
|
117
|
+
getAvatarUrl(options) {
|
|
118
|
+
if (!this._rawData)
|
|
119
|
+
return undefined;
|
|
120
|
+
return buildCDNUrl(`https://cdn.discordapp.com/avatars/${this.id}`, this.avatar, options);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The banner hash of the user.
|
|
124
|
+
* You can use {@link User.bannerUrl} to get the URL of the banner.
|
|
125
|
+
*/
|
|
126
|
+
get banner() {
|
|
127
|
+
if (!this._rawData)
|
|
128
|
+
return undefined;
|
|
129
|
+
return this._rawData.banner ?? null;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get the URL of the user's banner with default settings (png format)
|
|
133
|
+
*/
|
|
134
|
+
get bannerUrl() {
|
|
135
|
+
if (!this._rawData)
|
|
136
|
+
return undefined;
|
|
137
|
+
return buildCDNUrl(`https://cdn.discordapp.com/banners/${this.id}`, this.banner);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get the URL of the user's banner with custom format and size options
|
|
141
|
+
* @param options Optional format and size parameters
|
|
142
|
+
* @returns The banner URL or null if no banner is set
|
|
143
|
+
*/
|
|
144
|
+
getBannerUrl(options) {
|
|
145
|
+
if (!this._rawData)
|
|
146
|
+
return undefined;
|
|
147
|
+
return buildCDNUrl(`https://cdn.discordapp.com/banners/${this.id}`, this.banner, options);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The accent color of the user.
|
|
151
|
+
*/
|
|
152
|
+
get accentColor() {
|
|
153
|
+
if (!this._rawData)
|
|
154
|
+
return undefined;
|
|
155
|
+
return this._rawData.accent_color ?? null;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Returns the Discord mention format for this user
|
|
159
|
+
* @returns The mention string in the format <@userId>
|
|
160
|
+
*/
|
|
161
|
+
toString() {
|
|
162
|
+
return `<@${this.id}>`;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Fetch updated data for this user.
|
|
166
|
+
* If the user is partial, this will fetch all the data for the user and populate the fields.
|
|
167
|
+
* If the user is not partial, all fields will be updated with new values from Discord.
|
|
168
|
+
* @returns A Promise that resolves to a non-partial User
|
|
169
|
+
*/
|
|
170
|
+
async fetch() {
|
|
171
|
+
const newData = (await this.client.rest.get(Routes.user(this.id)));
|
|
172
|
+
if (!newData)
|
|
173
|
+
throw new Error(`User ${this.id} not found`);
|
|
174
|
+
this.setData(newData);
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Instantiate a new DM channel with this user.
|
|
179
|
+
*/
|
|
180
|
+
async createDm() {
|
|
181
|
+
const dmChannel = (await this.client.rest.post(Routes.userChannels(), {
|
|
182
|
+
body: {
|
|
183
|
+
recipient_id: this.id
|
|
184
|
+
}
|
|
185
|
+
}));
|
|
186
|
+
return dmChannel;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Send a message to this user.
|
|
190
|
+
*/
|
|
191
|
+
async send(data) {
|
|
192
|
+
const dmChannel = await this.createDm();
|
|
193
|
+
const message = (await this.client.rest.post(Routes.channelMessages(dmChannel.id), {
|
|
194
|
+
body: serializePayload(data)
|
|
195
|
+
}));
|
|
196
|
+
return new Message(this.client, message);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=User.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/structures/User.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,MAAM,EAEN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AA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,CAAC,OAAO,CAAC,CAAA;QAErB,OAAO,IAAmB,CAAA;IAC3B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ;QACb,MAAM,SAAS,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE;YACrE,IAAI,EAAE;gBACL,YAAY,EAAE,IAAI,CAAC,EAAE;aACrB;SACD,CAAC,CAAiB,CAAA;QACnB,OAAO,SAAS,CAAA;IACjB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,IAAoB;QAC9B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAA;QACvC,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAC3C,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,CAAC,EACpC;YACC,IAAI,EAAE,gBAAgB,CAAC,IAAI,CAAC;SAC5B,CACD,CAAe,CAAA;QAChB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,CAAC;CACD"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type { APIMessage, APIUser, APIWebhook, RESTPatchAPIWebhookJSONBody, WebhookType } from "discord-api-types/v10";
|
|
2
|
+
import { RequestClient } from "../classes/RequestClient.js";
|
|
3
|
+
import type { IfPartial, MessagePayload } from "../types/index.js";
|
|
4
|
+
import { type CDNUrlOptions } from "../utils/index.js";
|
|
5
|
+
export type WebhookInput = APIWebhook | {
|
|
6
|
+
id: string;
|
|
7
|
+
token: string;
|
|
8
|
+
threadId?: string;
|
|
9
|
+
} | string;
|
|
10
|
+
export declare class Webhook<IsPartial extends boolean = false> {
|
|
11
|
+
rest: RequestClient;
|
|
12
|
+
constructor(rawData: APIWebhook);
|
|
13
|
+
constructor(idAndToken: {
|
|
14
|
+
id: string;
|
|
15
|
+
token: string;
|
|
16
|
+
threadId?: string;
|
|
17
|
+
});
|
|
18
|
+
constructor(url: string);
|
|
19
|
+
constructor(input: WebhookInput);
|
|
20
|
+
protected _rawData: APIWebhook | null;
|
|
21
|
+
private setData;
|
|
22
|
+
/**
|
|
23
|
+
* The raw Discord API data for this webhook
|
|
24
|
+
*/
|
|
25
|
+
get rawData(): Readonly<APIWebhook>;
|
|
26
|
+
/**
|
|
27
|
+
* The ID of the webhook
|
|
28
|
+
*/
|
|
29
|
+
readonly id: string;
|
|
30
|
+
/**
|
|
31
|
+
* The token of the webhook
|
|
32
|
+
*/
|
|
33
|
+
readonly token?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The thread ID this webhook is for
|
|
36
|
+
*/
|
|
37
|
+
readonly threadId?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the webhook is a partial webhook (meaning it does not have all the data).
|
|
40
|
+
* If this is true, you should use {@link Webhook.fetch} to get the full data of the webhook.
|
|
41
|
+
*/
|
|
42
|
+
get partial(): IsPartial;
|
|
43
|
+
/**
|
|
44
|
+
* The type of the webhook
|
|
45
|
+
* @see https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
|
|
46
|
+
*/
|
|
47
|
+
get type(): IfPartial<IsPartial, WebhookType>;
|
|
48
|
+
/**
|
|
49
|
+
* The guild id this webhook is for
|
|
50
|
+
*/
|
|
51
|
+
get guildId(): IfPartial<IsPartial, string | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* The channel id this webhook is for
|
|
54
|
+
*/
|
|
55
|
+
get channelId(): IfPartial<IsPartial, string>;
|
|
56
|
+
/**
|
|
57
|
+
* The user this webhook was created by
|
|
58
|
+
* Not returned when getting a webhook with its token
|
|
59
|
+
*/
|
|
60
|
+
get user(): IfPartial<IsPartial, APIUser | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* The default name of the webhook
|
|
63
|
+
*/
|
|
64
|
+
get name(): IfPartial<IsPartial, string | null>;
|
|
65
|
+
/**
|
|
66
|
+
* The default avatar of the webhook
|
|
67
|
+
*/
|
|
68
|
+
get avatar(): IfPartial<IsPartial, string | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Get the URL of the webhook's avatar with default settings (png format)
|
|
71
|
+
*/
|
|
72
|
+
get avatarUrl(): IfPartial<IsPartial, string | null>;
|
|
73
|
+
/**
|
|
74
|
+
* Get the URL of the webhook's avatar with custom format and size options
|
|
75
|
+
* @param options Optional format and size parameters
|
|
76
|
+
* @returns The avatar URL or null if no avatar is set
|
|
77
|
+
*/
|
|
78
|
+
getAvatarUrl(options?: CDNUrlOptions): IfPartial<IsPartial, string | null>;
|
|
79
|
+
/**
|
|
80
|
+
* The bot/OAuth2 application that created this webhook
|
|
81
|
+
*/
|
|
82
|
+
get applicationId(): IfPartial<IsPartial, string | null>;
|
|
83
|
+
/**
|
|
84
|
+
* The guild of the channel that this webhook is following
|
|
85
|
+
* Only returned for Channel Follower Webhooks
|
|
86
|
+
*/
|
|
87
|
+
get sourceGuild(): IfPartial<IsPartial, APIWebhook["source_guild"] | undefined>;
|
|
88
|
+
/**
|
|
89
|
+
* The channel that this webhook is following
|
|
90
|
+
* Only returned for Channel Follower Webhooks
|
|
91
|
+
*/
|
|
92
|
+
get sourceChannel(): IfPartial<IsPartial, APIWebhook["source_channel"] | undefined>;
|
|
93
|
+
/**
|
|
94
|
+
* The url used for executing the webhook
|
|
95
|
+
* Only returned by the webhooks OAuth2 flow
|
|
96
|
+
*/
|
|
97
|
+
get url(): string;
|
|
98
|
+
urlWithOptions({
|
|
99
|
+
/**
|
|
100
|
+
* Waits for server confirmation of message send before response, and returns the created message body
|
|
101
|
+
*/
|
|
102
|
+
wait,
|
|
103
|
+
/**
|
|
104
|
+
* Specify the thread to use with this webhook
|
|
105
|
+
*/
|
|
106
|
+
threadId,
|
|
107
|
+
/**
|
|
108
|
+
* Whether to respect the components field of the request. When enabled, allows application-owned webhooks to use all components and non-owned webhooks to use non-interactive components
|
|
109
|
+
* @default false
|
|
110
|
+
*/
|
|
111
|
+
withComponents }: {
|
|
112
|
+
wait?: boolean;
|
|
113
|
+
threadId?: string;
|
|
114
|
+
withComponents?: boolean;
|
|
115
|
+
}): string;
|
|
116
|
+
/**
|
|
117
|
+
* Fetch this webhook's data
|
|
118
|
+
* @returns A Promise that resolves to a non-partial Webhook
|
|
119
|
+
*/
|
|
120
|
+
fetch(): Promise<Webhook<false>>;
|
|
121
|
+
/**
|
|
122
|
+
* Modify this webhook
|
|
123
|
+
* @param data The data to modify the webhook with
|
|
124
|
+
* @returns A Promise that resolves to the modified webhook
|
|
125
|
+
*/
|
|
126
|
+
modify(data: RESTPatchAPIWebhookJSONBody): Promise<Webhook<false>>;
|
|
127
|
+
/**
|
|
128
|
+
* Delete this webhook
|
|
129
|
+
* @returns A Promise that resolves when the webhook is deleted
|
|
130
|
+
*/
|
|
131
|
+
delete(): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Send a message through this webhook
|
|
134
|
+
* @param data The data to send with the webhook
|
|
135
|
+
* @param threadId Optional ID of the thread to send the message to. If not provided, uses the webhook's thread ID.
|
|
136
|
+
*/
|
|
137
|
+
send<T extends true | false = false>(data: MessagePayload, threadId?: string, wait?: T): Promise<T extends true ? APIMessage : void>;
|
|
138
|
+
/**
|
|
139
|
+
* Edit a message sent by this webhook
|
|
140
|
+
* @param messageId The ID of the message to edit
|
|
141
|
+
* @param data The data to edit the message with
|
|
142
|
+
* @param threadId Optional ID of the thread to edit the message in. If not provided, uses the webhook's thread ID.
|
|
143
|
+
*/
|
|
144
|
+
edit(messageId: string, data: MessagePayload, threadId?: string): Promise<APIMessage>;
|
|
145
|
+
/**
|
|
146
|
+
* Delete a message sent by this webhook
|
|
147
|
+
* @param messageId The ID of the message to delete
|
|
148
|
+
* @param threadId Optional ID of the thread to delete the message from. If not provided, uses the webhook's thread ID.
|
|
149
|
+
* @returns A Promise that resolves when the message is deleted
|
|
150
|
+
*/
|
|
151
|
+
deleteMessage(messageId: string, threadId?: string): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Get a message sent by this webhook
|
|
154
|
+
* @param messageId The ID of the message to get
|
|
155
|
+
* @param threadId Optional ID of the thread to get the message from. If not provided, uses the webhook's thread ID.
|
|
156
|
+
* @returns The raw data of the message, which you can then use to create a Message instance
|
|
157
|
+
*/
|
|
158
|
+
getMessage(messageId: string, threadId?: string): Promise<APIMessage>;
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=Webhook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Webhook.d.ts","sourceRoot":"","sources":["../../../src/structures/Webhook.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,OAAO,EACP,UAAU,EAGV,2BAA2B,EAE3B,WAAW,EACX,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAEN,KAAK,aAAa,EAElB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,MAAM,YAAY,GACrB,UAAU,GACV;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,MAAM,CAAA;AAET,qBAAa,OAAO,CAAC,SAAS,SAAS,OAAO,GAAG,KAAK;IACrD,IAAI,EAAE,aAAa,CAAA;gBACP,OAAO,EAAE,UAAU;gBACnB,UAAU,EAAE;QACvB,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,CAAC,EAAE,MAAM,CAAA;KACjB;gBACW,GAAG,EAAE,MAAM;gBACX,KAAK,EAAE,YAAY;IAuB/B,SAAS,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI,CAAO;IAC5C,OAAO,CAAC,OAAO;IAKf;;OAEG;IACH,I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routes } from "discord-api-types/v10";
|
|
2
|
+
import { RequestClient } from "../classes/RequestClient.js";
|
|
3
|
+
import { buildCDNUrl, serializePayload } from "../utils/index.js";
|
|
4
|
+
export class Webhook {
|
|
5
|
+
rest;
|
|
6
|
+
constructor(input) {
|
|
7
|
+
if (!input)
|
|
8
|
+
throw new Error(`Missing input, currently set to ${input}`);
|
|
9
|
+
if (typeof input === "string") {
|
|
10
|
+
const url = new URL(input);
|
|
11
|
+
if (url.protocol !== "https:")
|
|
12
|
+
throw new Error("Invalid URL");
|
|
13
|
+
const [id, token] = url.pathname.split("/").slice(3);
|
|
14
|
+
if (!id || !token)
|
|
15
|
+
throw new Error("Invalid URL");
|
|
16
|
+
this.id = id;
|
|
17
|
+
this.token = token;
|
|
18
|
+
const potentialThreadId = url.searchParams.get("thread_id");
|
|
19
|
+
this.threadId = potentialThreadId ?? undefined;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
if ("channel_id" in input) {
|
|
23
|
+
this.setData(input);
|
|
24
|
+
}
|
|
25
|
+
this.id = input.id;
|
|
26
|
+
this.token = input.token;
|
|
27
|
+
this.threadId = "threadId" in input ? input.threadId : undefined;
|
|
28
|
+
}
|
|
29
|
+
this.rest = new RequestClient("webhook");
|
|
30
|
+
}
|
|
31
|
+
_rawData = null;
|
|
32
|
+
setData(data) {
|
|
33
|
+
if (!data)
|
|
34
|
+
throw new Error("Cannot set data without having data... smh");
|
|
35
|
+
this._rawData = data;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The raw Discord API data for this webhook
|
|
39
|
+
*/
|
|
40
|
+
get rawData() {
|
|
41
|
+
if (!this._rawData)
|
|
42
|
+
throw new Error("Cannot access rawData on partial Webhook. Use fetch() to populate data.");
|
|
43
|
+
return this._rawData;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The ID of the webhook
|
|
47
|
+
*/
|
|
48
|
+
id;
|
|
49
|
+
/**
|
|
50
|
+
* The token of the webhook
|
|
51
|
+
*/
|
|
52
|
+
token;
|
|
53
|
+
/**
|
|
54
|
+
* The thread ID this webhook is for
|
|
55
|
+
*/
|
|
56
|
+
threadId;
|
|
57
|
+
/**
|
|
58
|
+
* Whether the webhook is a partial webhook (meaning it does not have all the data).
|
|
59
|
+
* If this is true, you should use {@link Webhook.fetch} to get the full data of the webhook.
|
|
60
|
+
*/
|
|
61
|
+
get partial() {
|
|
62
|
+
return (this._rawData === null);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The type of the webhook
|
|
66
|
+
* @see https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
|
|
67
|
+
*/
|
|
68
|
+
get type() {
|
|
69
|
+
if (!this._rawData)
|
|
70
|
+
return undefined;
|
|
71
|
+
return this._rawData.type;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The guild id this webhook is for
|
|
75
|
+
*/
|
|
76
|
+
get guildId() {
|
|
77
|
+
if (!this._rawData)
|
|
78
|
+
return undefined;
|
|
79
|
+
return this._rawData.guild_id;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The channel id this webhook is for
|
|
83
|
+
*/
|
|
84
|
+
get channelId() {
|
|
85
|
+
if (!this._rawData)
|
|
86
|
+
return undefined;
|
|
87
|
+
return this._rawData.channel_id;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* The user this webhook was created by
|
|
91
|
+
* Not returned when getting a webhook with its token
|
|
92
|
+
*/
|
|
93
|
+
get user() {
|
|
94
|
+
if (!this._rawData?.user)
|
|
95
|
+
return undefined;
|
|
96
|
+
return this._rawData.user;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The default name of the webhook
|
|
100
|
+
*/
|
|
101
|
+
get name() {
|
|
102
|
+
if (!this._rawData)
|
|
103
|
+
return undefined;
|
|
104
|
+
return this._rawData.name;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The default avatar of the webhook
|
|
108
|
+
*/
|
|
109
|
+
get avatar() {
|
|
110
|
+
if (!this._rawData)
|
|
111
|
+
return undefined;
|
|
112
|
+
return this._rawData.avatar;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get the URL of the webhook's avatar with default settings (png format)
|
|
116
|
+
*/
|
|
117
|
+
get avatarUrl() {
|
|
118
|
+
if (!this._rawData)
|
|
119
|
+
return undefined;
|
|
120
|
+
return buildCDNUrl(`https://cdn.discordapp.com/avatars/${this.id}`, this.avatar);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get the URL of the webhook's avatar with custom format and size options
|
|
124
|
+
* @param options Optional format and size parameters
|
|
125
|
+
* @returns The avatar URL or null if no avatar is set
|
|
126
|
+
*/
|
|
127
|
+
getAvatarUrl(options) {
|
|
128
|
+
if (!this._rawData)
|
|
129
|
+
return undefined;
|
|
130
|
+
return buildCDNUrl(`https://cdn.discordapp.com/avatars/${this.id}`, this.avatar, options);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The bot/OAuth2 application that created this webhook
|
|
134
|
+
*/
|
|
135
|
+
get applicationId() {
|
|
136
|
+
if (!this._rawData)
|
|
137
|
+
return undefined;
|
|
138
|
+
return this._rawData.application_id;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The guild of the channel that this webhook is following
|
|
142
|
+
* Only returned for Channel Follower Webhooks
|
|
143
|
+
*/
|
|
144
|
+
get sourceGuild() {
|
|
145
|
+
if (!this._rawData)
|
|
146
|
+
return undefined;
|
|
147
|
+
return this._rawData.source_guild;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* The channel that this webhook is following
|
|
151
|
+
* Only returned for Channel Follower Webhooks
|
|
152
|
+
*/
|
|
153
|
+
get sourceChannel() {
|
|
154
|
+
if (!this._rawData)
|
|
155
|
+
return undefined;
|
|
156
|
+
return this._rawData.source_channel;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The url used for executing the webhook
|
|
160
|
+
* Only returned by the webhooks OAuth2 flow
|
|
161
|
+
*/
|
|
162
|
+
get url() {
|
|
163
|
+
const base = `https://discord.com/api/webhooks/${this.id}/${this.token}`;
|
|
164
|
+
const queryParams = new URLSearchParams();
|
|
165
|
+
if (this.threadId)
|
|
166
|
+
queryParams.set("thread_id", this.threadId);
|
|
167
|
+
return base;
|
|
168
|
+
}
|
|
169
|
+
urlWithOptions({
|
|
170
|
+
/**
|
|
171
|
+
* Waits for server confirmation of message send before response, and returns the created message body
|
|
172
|
+
*/
|
|
173
|
+
wait,
|
|
174
|
+
/**
|
|
175
|
+
* Specify the thread to use with this webhook
|
|
176
|
+
*/
|
|
177
|
+
threadId,
|
|
178
|
+
/**
|
|
179
|
+
* Whether to respect the components field of the request. When enabled, allows application-owned webhooks to use all components and non-owned webhooks to use non-interactive components
|
|
180
|
+
* @default false
|
|
181
|
+
*/
|
|
182
|
+
withComponents }) {
|
|
183
|
+
let base = `/webhooks/${this.id}/${this.token}`;
|
|
184
|
+
const queryParams = new URLSearchParams();
|
|
185
|
+
if (this.threadId)
|
|
186
|
+
queryParams.set("thread_id", this.threadId);
|
|
187
|
+
if (threadId)
|
|
188
|
+
queryParams.set("thread_id", threadId);
|
|
189
|
+
if (wait)
|
|
190
|
+
queryParams.set("wait", "true");
|
|
191
|
+
if (withComponents)
|
|
192
|
+
queryParams.set("with_components", "true");
|
|
193
|
+
if (queryParams.size > 0)
|
|
194
|
+
base += `?${queryParams.toString()}`;
|
|
195
|
+
return base;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Fetch this webhook's data
|
|
199
|
+
* @returns A Promise that resolves to a non-partial Webhook
|
|
200
|
+
*/
|
|
201
|
+
async fetch() {
|
|
202
|
+
const newData = (await this.rest.get(Routes.webhook(this.id)));
|
|
203
|
+
if (!newData)
|
|
204
|
+
throw new Error(`Webhook ${this.id} not found`);
|
|
205
|
+
this.setData(newData);
|
|
206
|
+
return this;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Modify this webhook
|
|
210
|
+
* @param data The data to modify the webhook with
|
|
211
|
+
* @returns A Promise that resolves to the modified webhook
|
|
212
|
+
*/
|
|
213
|
+
async modify(data) {
|
|
214
|
+
const newData = (await this.rest.patch(Routes.webhook(this.id), {
|
|
215
|
+
body: data
|
|
216
|
+
}));
|
|
217
|
+
this.setData(newData);
|
|
218
|
+
return this;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Delete this webhook
|
|
222
|
+
* @returns A Promise that resolves when the webhook is deleted
|
|
223
|
+
*/
|
|
224
|
+
async delete() {
|
|
225
|
+
await this.rest.delete(Routes.webhook(this.id));
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Send a message through this webhook
|
|
229
|
+
* @param data The data to send with the webhook
|
|
230
|
+
* @param threadId Optional ID of the thread to send the message to. If not provided, uses the webhook's thread ID.
|
|
231
|
+
*/
|
|
232
|
+
async send(data, threadId, wait) {
|
|
233
|
+
if (!this.token)
|
|
234
|
+
throw new Error("Cannot send webhook message without token");
|
|
235
|
+
const serialized = serializePayload(data);
|
|
236
|
+
const finalThreadId = threadId || this.threadId;
|
|
237
|
+
const response = (await this.rest.post(this.urlWithOptions({ wait, threadId }), {
|
|
238
|
+
body: serialized
|
|
239
|
+
}, finalThreadId ? { thread_id: finalThreadId } : undefined));
|
|
240
|
+
return response;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Edit a message sent by this webhook
|
|
244
|
+
* @param messageId The ID of the message to edit
|
|
245
|
+
* @param data The data to edit the message with
|
|
246
|
+
* @param threadId Optional ID of the thread to edit the message in. If not provided, uses the webhook's thread ID.
|
|
247
|
+
*/
|
|
248
|
+
async edit(messageId, data, threadId) {
|
|
249
|
+
if (!this.token)
|
|
250
|
+
throw new Error("Cannot edit webhook message without token");
|
|
251
|
+
const serialized = serializePayload(data);
|
|
252
|
+
const finalThreadId = threadId || this.threadId;
|
|
253
|
+
const message = (await this.rest.patch(Routes.webhookMessage(this.id, this.token, messageId) +
|
|
254
|
+
(threadId ? `?thread_id=${threadId}` : ""), {
|
|
255
|
+
body: serialized
|
|
256
|
+
}, finalThreadId ? { thread_id: finalThreadId } : undefined));
|
|
257
|
+
return message;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Delete a message sent by this webhook
|
|
261
|
+
* @param messageId The ID of the message to delete
|
|
262
|
+
* @param threadId Optional ID of the thread to delete the message from. If not provided, uses the webhook's thread ID.
|
|
263
|
+
* @returns A Promise that resolves when the message is deleted
|
|
264
|
+
*/
|
|
265
|
+
async deleteMessage(messageId, threadId) {
|
|
266
|
+
if (!this.token)
|
|
267
|
+
throw new Error("Cannot delete webhook message without token");
|
|
268
|
+
const finalThreadId = threadId || this.threadId;
|
|
269
|
+
await this.rest.delete(Routes.webhookMessage(this.id, this.token, messageId) +
|
|
270
|
+
(threadId ? `?thread_id=${threadId}` : ""), undefined, finalThreadId ? { thread_id: finalThreadId } : undefined);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Get a message sent by this webhook
|
|
274
|
+
* @param messageId The ID of the message to get
|
|
275
|
+
* @param threadId Optional ID of the thread to get the message from. If not provided, uses the webhook's thread ID.
|
|
276
|
+
* @returns The raw data of the message, which you can then use to create a Message instance
|
|
277
|
+
*/
|
|
278
|
+
async getMessage(messageId, threadId) {
|
|
279
|
+
if (!this.token)
|
|
280
|
+
throw new Error("Cannot get webhook message without token");
|
|
281
|
+
const finalThreadId = threadId || this.threadId;
|
|
282
|
+
const message = (await this.rest.get(Routes.webhookMessage(this.id, this.token, messageId) +
|
|
283
|
+
(threadId ? `?thread_id=${threadId}` : ""), finalThreadId ? { thread_id: finalThreadId } : undefined));
|
|
284
|
+
return message;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=Webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Webhook.js","sourceRoot":"","sources":["../../../src/structures/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