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,417 @@
|
|
|
1
|
+
import { ComponentType, MessageReferenceType, Routes } from "discord-api-types/v10";
|
|
2
|
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import { Embed } from "../classes/Embed.js";
|
|
4
|
+
import { channelFactory } from "../functions/channelFactory.js";
|
|
5
|
+
import { serializePayload } from "../utils/index.js";
|
|
6
|
+
import { GuildThreadChannel } from "./GuildThreadChannel.js";
|
|
7
|
+
import { Poll } from "./Poll.js";
|
|
8
|
+
import { Role } from "./Role.js";
|
|
9
|
+
import { User } from "./User.js";
|
|
10
|
+
export class Message extends Base {
|
|
11
|
+
constructor(client, rawDataOrIds) {
|
|
12
|
+
super(client);
|
|
13
|
+
if (Object.keys(rawDataOrIds).length === 2 &&
|
|
14
|
+
"id" in rawDataOrIds &&
|
|
15
|
+
"channelId" in rawDataOrIds) {
|
|
16
|
+
this.id = rawDataOrIds.id;
|
|
17
|
+
this.channelId = rawDataOrIds.channelId || "";
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
const data = rawDataOrIds;
|
|
21
|
+
this.id = data.id;
|
|
22
|
+
this.channelId = data.channel_id;
|
|
23
|
+
this.setData(data);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
_rawData = null;
|
|
27
|
+
setData(data) {
|
|
28
|
+
this._rawData = data;
|
|
29
|
+
if (!data)
|
|
30
|
+
throw new Error("Cannot set data without having data... smh");
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The raw Discord API data for this message
|
|
34
|
+
*/
|
|
35
|
+
get rawData() {
|
|
36
|
+
if (!this._rawData)
|
|
37
|
+
throw new Error("Cannot access rawData on partial Message. Use fetch() to populate data.");
|
|
38
|
+
return this._rawData;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The ID of the message
|
|
42
|
+
*/
|
|
43
|
+
id;
|
|
44
|
+
/**
|
|
45
|
+
* The ID of the channel the message is in
|
|
46
|
+
*/
|
|
47
|
+
channelId;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the message is a partial message (meaning it does not have all the data).
|
|
50
|
+
* If this is true, you should use {@link Message.fetch} to get the full data of the message.
|
|
51
|
+
*/
|
|
52
|
+
get partial() {
|
|
53
|
+
return (this._rawData === null);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* If this message is a response to an interaction, this is the ID of the interaction's application
|
|
57
|
+
*/
|
|
58
|
+
get applicationId() {
|
|
59
|
+
if (!this._rawData)
|
|
60
|
+
return undefined;
|
|
61
|
+
return this._rawData.application_id;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The attachments of the message
|
|
65
|
+
*/
|
|
66
|
+
get attachments() {
|
|
67
|
+
if (!this._rawData)
|
|
68
|
+
return undefined;
|
|
69
|
+
return this._rawData.attachments ?? [];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The components of the message
|
|
73
|
+
*/
|
|
74
|
+
get components() {
|
|
75
|
+
if (!this._rawData)
|
|
76
|
+
return undefined;
|
|
77
|
+
return this._rawData.components ?? [];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The content of the message
|
|
81
|
+
*/
|
|
82
|
+
get content() {
|
|
83
|
+
if (!this._rawData)
|
|
84
|
+
return undefined;
|
|
85
|
+
return this._rawData.content ?? "";
|
|
86
|
+
}
|
|
87
|
+
get embeds() {
|
|
88
|
+
if (!this._rawData)
|
|
89
|
+
return undefined;
|
|
90
|
+
if (!this._rawData?.embeds)
|
|
91
|
+
return [];
|
|
92
|
+
return this._rawData.embeds.map((embed) => new Embed(embed));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* If this message was edited, this is the timestamp of the edit
|
|
96
|
+
*/
|
|
97
|
+
get editedTimestamp() {
|
|
98
|
+
if (!this._rawData)
|
|
99
|
+
return undefined;
|
|
100
|
+
return this._rawData.edited_timestamp;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The flags of the message
|
|
104
|
+
*/
|
|
105
|
+
get flags() {
|
|
106
|
+
if (!this._rawData)
|
|
107
|
+
return undefined;
|
|
108
|
+
return this._rawData.flags;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The interaction metadata of the message
|
|
112
|
+
*/
|
|
113
|
+
get interactionMetadata() {
|
|
114
|
+
if (!this._rawData)
|
|
115
|
+
return undefined;
|
|
116
|
+
return this._rawData.interaction_metadata;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Whether the message mentions everyone
|
|
120
|
+
*/
|
|
121
|
+
get mentionedEveryone() {
|
|
122
|
+
if (!this._rawData)
|
|
123
|
+
return undefined;
|
|
124
|
+
return this._rawData.mention_everyone;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* The users mentioned in the message
|
|
128
|
+
*/
|
|
129
|
+
get mentionedUsers() {
|
|
130
|
+
if (!this._rawData)
|
|
131
|
+
return undefined;
|
|
132
|
+
if (!this._rawData?.mentions)
|
|
133
|
+
return [];
|
|
134
|
+
return this._rawData.mentions.map((mention) => new User(this.client, mention));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* The roles mentioned in the message
|
|
138
|
+
*/
|
|
139
|
+
get mentionedRoles() {
|
|
140
|
+
if (!this._rawData)
|
|
141
|
+
return undefined;
|
|
142
|
+
if (!this._rawData?.mention_roles)
|
|
143
|
+
return [];
|
|
144
|
+
return this._rawData.mention_roles.map((mention) => new Role(this.client, mention));
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* The data about the referenced message. You can use {@link Message.referencedMessage} to get the referenced message itself.
|
|
148
|
+
*/
|
|
149
|
+
get messageReference() {
|
|
150
|
+
if (!this._rawData)
|
|
151
|
+
return undefined;
|
|
152
|
+
return this._rawData.message_reference;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* The referenced message itself
|
|
156
|
+
*/
|
|
157
|
+
get referencedMessage() {
|
|
158
|
+
if (!this._rawData?.referenced_message)
|
|
159
|
+
return null;
|
|
160
|
+
return new Message(this.client, this._rawData?.referenced_message);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Whether the message is pinned
|
|
164
|
+
*/
|
|
165
|
+
get pinned() {
|
|
166
|
+
if (!this._rawData)
|
|
167
|
+
return undefined;
|
|
168
|
+
return this._rawData.pinned;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The poll contained in the message
|
|
172
|
+
*/
|
|
173
|
+
get poll() {
|
|
174
|
+
if (!this._rawData?.poll)
|
|
175
|
+
return undefined;
|
|
176
|
+
return new Poll(this.client, {
|
|
177
|
+
channelId: this.channelId,
|
|
178
|
+
messageId: this.id,
|
|
179
|
+
data: this._rawData.poll
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The approximate position of the message in the channel
|
|
184
|
+
*/
|
|
185
|
+
get position() {
|
|
186
|
+
if (!this._rawData)
|
|
187
|
+
return undefined;
|
|
188
|
+
return this._rawData.position;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The reactions on the message
|
|
192
|
+
*/
|
|
193
|
+
get reactions() {
|
|
194
|
+
if (!this._rawData)
|
|
195
|
+
return undefined;
|
|
196
|
+
return this._rawData.reactions ?? [];
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The stickers in the message
|
|
200
|
+
*/
|
|
201
|
+
get stickers() {
|
|
202
|
+
if (!this._rawData)
|
|
203
|
+
return undefined;
|
|
204
|
+
return this._rawData.sticker_items ?? [];
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The timestamp of the original message
|
|
208
|
+
*/
|
|
209
|
+
get timestamp() {
|
|
210
|
+
if (!this._rawData)
|
|
211
|
+
return undefined;
|
|
212
|
+
return this._rawData.timestamp;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Whether the message is a TTS message
|
|
216
|
+
*/
|
|
217
|
+
get tts() {
|
|
218
|
+
if (!this._rawData)
|
|
219
|
+
return undefined;
|
|
220
|
+
return this._rawData.tts;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* The type of the message
|
|
224
|
+
*/
|
|
225
|
+
get type() {
|
|
226
|
+
if (!this._rawData)
|
|
227
|
+
return undefined;
|
|
228
|
+
return this._rawData.type;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Get the author of the message
|
|
232
|
+
*/
|
|
233
|
+
get author() {
|
|
234
|
+
if (!this._rawData)
|
|
235
|
+
return null;
|
|
236
|
+
if (this._rawData?.webhook_id)
|
|
237
|
+
return null; // TODO: Add webhook user
|
|
238
|
+
return new User(this.client, this._rawData.author);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Get the thread associated with this message, if there is one
|
|
242
|
+
*/
|
|
243
|
+
get thread() {
|
|
244
|
+
if (!this.rawData)
|
|
245
|
+
return null;
|
|
246
|
+
if (!this._rawData?.thread)
|
|
247
|
+
return null;
|
|
248
|
+
return channelFactory(this.client, this._rawData?.thread);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Fetch updated data for this message.
|
|
252
|
+
* If the message is partial, this will fetch all the data for the message and populate the fields.
|
|
253
|
+
* If the message is not partial, all fields will be updated with new values from Discord.
|
|
254
|
+
* @returns A Promise that resolves to a non-partial Message
|
|
255
|
+
*/
|
|
256
|
+
async fetch() {
|
|
257
|
+
if (!this.channelId)
|
|
258
|
+
throw new Error("Cannot fetch message without channel ID");
|
|
259
|
+
const newData = (await this.client.rest.get(Routes.channelMessage(this.channelId, this.id)));
|
|
260
|
+
if (!newData)
|
|
261
|
+
throw new Error(`Message ${this.id} not found`);
|
|
262
|
+
this.setData(newData);
|
|
263
|
+
return this;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Delete this message from Discord
|
|
267
|
+
*/
|
|
268
|
+
async delete() {
|
|
269
|
+
if (!this.channelId)
|
|
270
|
+
throw new Error("Cannot delete message without channel ID");
|
|
271
|
+
await this.client.rest.delete(Routes.channelMessage(this.channelId, this.id));
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Get the channel the message was sent in
|
|
275
|
+
*/
|
|
276
|
+
async fetchChannel() {
|
|
277
|
+
if (!this.channelId)
|
|
278
|
+
throw new Error("Cannot fetch channel without channel ID");
|
|
279
|
+
const data = (await this.client.rest.get(Routes.channel(this.channelId)));
|
|
280
|
+
const channel = channelFactory(this.client, data);
|
|
281
|
+
return channel;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Pin this message
|
|
285
|
+
*/
|
|
286
|
+
async pin() {
|
|
287
|
+
if (!this.channelId)
|
|
288
|
+
throw new Error("Cannot pin message without channel ID");
|
|
289
|
+
await this.client.rest.put(Routes.channelMessagesPin(this.channelId, this.id));
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Unpin this message
|
|
293
|
+
*/
|
|
294
|
+
async unpin() {
|
|
295
|
+
if (!this.channelId)
|
|
296
|
+
throw new Error("Cannot unpin message without channel ID");
|
|
297
|
+
await this.client.rest.delete(Routes.channelMessagesPin(this.channelId, this.id));
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Start a thread with this message as the associated start message.
|
|
301
|
+
* If you want to start a thread without a start message, use {@link BaseGuildTextChannel.startThread}
|
|
302
|
+
*/
|
|
303
|
+
async startThread(data) {
|
|
304
|
+
if (!this.channelId)
|
|
305
|
+
throw new Error("Cannot start thread without channel ID");
|
|
306
|
+
const thread = (await this.client.rest.post(Routes.threads(this.channelId, this.id), {
|
|
307
|
+
body: { ...data }
|
|
308
|
+
}));
|
|
309
|
+
return new GuildThreadChannel(this.client, thread);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Edit this message
|
|
313
|
+
* @param data - The data to edit the message with
|
|
314
|
+
* @returns A Promise that resolves to the edited message
|
|
315
|
+
*/
|
|
316
|
+
async edit(data) {
|
|
317
|
+
if (!this.channelId)
|
|
318
|
+
throw new Error("Cannot edit message without channel ID");
|
|
319
|
+
const serialized = serializePayload(data);
|
|
320
|
+
const newMessage = (await this.client.rest.patch(Routes.channelMessage(this.channelId, this.id), {
|
|
321
|
+
body: {
|
|
322
|
+
...serialized
|
|
323
|
+
}
|
|
324
|
+
}));
|
|
325
|
+
this.setData(newMessage);
|
|
326
|
+
return this;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Forward this message to a different channel
|
|
330
|
+
* @param channelId - The ID of the channel to forward the message to
|
|
331
|
+
* @returns A Promise that resolves to the forwarded message
|
|
332
|
+
*/
|
|
333
|
+
async forward(channelId) {
|
|
334
|
+
if (!this.channelId)
|
|
335
|
+
throw new Error("Cannot forward message without channel ID");
|
|
336
|
+
const channel = await this.client.fetchChannel(channelId);
|
|
337
|
+
if (!channel)
|
|
338
|
+
throw new Error(`Channel ${channelId} not found`);
|
|
339
|
+
if (!("send" in channel))
|
|
340
|
+
throw new Error(`Cannot forward message to channel ${channelId}`);
|
|
341
|
+
const message = (await this.client.rest.post(Routes.channelMessages(channelId), {
|
|
342
|
+
body: {
|
|
343
|
+
message_reference: {
|
|
344
|
+
type: MessageReferenceType.Forward,
|
|
345
|
+
message_id: this.id,
|
|
346
|
+
channel_id: this.channelId
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}));
|
|
350
|
+
return new Message(this.client, message);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Reply to this message
|
|
354
|
+
* @param data - The data to reply with
|
|
355
|
+
* @returns A Promise that resolves to the replied message
|
|
356
|
+
*/
|
|
357
|
+
async reply(data) {
|
|
358
|
+
if (!this.channelId)
|
|
359
|
+
throw new Error("Cannot reply to message without channel ID");
|
|
360
|
+
const serialized = serializePayload(data);
|
|
361
|
+
const message = (await this.client.rest.post(Routes.channelMessages(this.channelId), {
|
|
362
|
+
body: {
|
|
363
|
+
...serialized,
|
|
364
|
+
message_reference: {
|
|
365
|
+
type: MessageReferenceType.Default,
|
|
366
|
+
message_id: this.id
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}));
|
|
370
|
+
return new Message(this.client, message);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Disable all buttons on the message except for link buttons
|
|
374
|
+
*/
|
|
375
|
+
async disableAllButtons() {
|
|
376
|
+
if (!this._rawData)
|
|
377
|
+
return;
|
|
378
|
+
if (!this._rawData.components)
|
|
379
|
+
return;
|
|
380
|
+
const patched = (await this.client.rest.patch(Routes.channelMessage(this.channelId, this.id), {
|
|
381
|
+
body: {
|
|
382
|
+
...this._rawData,
|
|
383
|
+
components: this._rawData.components?.map((component) => {
|
|
384
|
+
const disable = (component) => {
|
|
385
|
+
if (component.type === ComponentType.ActionRow) {
|
|
386
|
+
return {
|
|
387
|
+
...component,
|
|
388
|
+
components: component.components.map((c) => ({
|
|
389
|
+
...c,
|
|
390
|
+
...("disabled" in c ? { disabled: true } : {})
|
|
391
|
+
}))
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
if (component.type === ComponentType.Section) {
|
|
395
|
+
return {
|
|
396
|
+
...component,
|
|
397
|
+
accessory: "disabled" in component.accessory
|
|
398
|
+
? { ...component.accessory, disabled: true }
|
|
399
|
+
: component.accessory
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
return component;
|
|
403
|
+
};
|
|
404
|
+
if (component.type === ComponentType.Container) {
|
|
405
|
+
return {
|
|
406
|
+
...component,
|
|
407
|
+
components: component.components.map((c) => disable(c))
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
return disable(component);
|
|
411
|
+
}) ?? []
|
|
412
|
+
}
|
|
413
|
+
}));
|
|
414
|
+
this.setData(patched);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
//# sourceMappingURL=Message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../src/structures/Message.ts"],"names":[],"mappings":"AAAA,OAAO,EAWN,aAAa,EAEb,oBAAoB,EAKpB,MAAM,EACN,MAAM,uB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ACD,IAAI,SAAS,CAAC,IAAI,KAAK,aAAa,CAAC,OAAO,EAAE,CAAC;4BAC9C,OAAO;gCACN,GAAG,SAAS;gCACZ,SAAS,EACR,UAAU,IAAI,SAAS,CAAC,SAAS;oCAChC,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;oCAC5C,CAAC,CAAC,SAAS,CAAC,SAAS;6BACvB,CAAA;wBACF,CAAC;wBACD,OAAO,SAAS,CAAA;oBACjB,CAAC,CAAA;oBACD,IAAI,SAAS,CAAC,IAAI,KAAK,aAAa,CAAC,SAAS,EAAE,CAAC;wBAChD,OAAO;4BACN,GAAG,SAAS;4BACZ,UAAU,EAAE,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;yBACvD,CAAA;oBACF,CAAC;oBACD,OAAO,OAAO,CAAC,SAAS,CAAC,CAAA;gBAC1B,CAAC,CAAC,IAAI,EAAE;aACoC;SAC9C,CACD,CAAe,CAAA;QAChB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACtB,CAAC;CACD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type APIPoll, type APIPollAnswer } from "discord-api-types/v10";
|
|
2
|
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import type { Client } from "../classes/Client.js";
|
|
4
|
+
import { Message } from "../index.js";
|
|
5
|
+
import { User } from "./User.js";
|
|
6
|
+
export declare class Poll extends Base {
|
|
7
|
+
private channelId;
|
|
8
|
+
private messageId;
|
|
9
|
+
protected _rawData: APIPoll;
|
|
10
|
+
constructor(client: Client, { channelId, messageId, data }: {
|
|
11
|
+
channelId: string;
|
|
12
|
+
messageId: string;
|
|
13
|
+
data: APIPoll;
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* The raw Discord API data for this poll
|
|
17
|
+
*/
|
|
18
|
+
get rawData(): Readonly<APIPoll>;
|
|
19
|
+
get question(): import("discord-api-types/v10").APIPollMedia;
|
|
20
|
+
get answers(): ReadonlyArray<APIPollAnswer>;
|
|
21
|
+
get allowMultiselect(): boolean;
|
|
22
|
+
get layoutType(): APIPoll["layout_type"];
|
|
23
|
+
get results(): APIPoll["results"] | undefined;
|
|
24
|
+
get expiry(): string;
|
|
25
|
+
get isFinalized(): boolean;
|
|
26
|
+
getAnswerVoters(answerId: number): Promise<User[]>;
|
|
27
|
+
end(): Promise<Message<false>>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=Poll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Poll.d.ts","sourceRoot":"","sources":["../../../src/structures/Poll.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,OAAO,EACZ,KAAK,aAAa,EAGlB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,qBAAa,IAAK,SAAQ,IAAI;IAC7B,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,SAAS,CAAQ;IACzB,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAA;gBAG1B,MAAM,EAAE,MAAM,EACd,EACC,SAAS,EACT,SAAS,EACT,IAAI,EACJ,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE;IAQ3D;;OAEG;IACH,IAAI,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,CAE/B;IAED,IAAI,QAAQ,iDAEX;IAED,IAAI,OAAO,IAAI,aAAa,CAAC,aAAa,CAAC,CAE1C;IAED,IAAI,gBAAgB,IAAI,OAAO,CAE9B;IAED,IAAI,UAAU,IAAI,OAAO,CAAC,aAAa,CAAC,CAEvC;IAED,IAAI,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAE5C;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAEK,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAOlD,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;CAOpC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import { Message } from "../index.js";
|
|
4
|
+
import { User } from "./User.js";
|
|
5
|
+
export class Poll extends Base {
|
|
6
|
+
channelId;
|
|
7
|
+
messageId;
|
|
8
|
+
_rawData;
|
|
9
|
+
constructor(client, { channelId, messageId, data }) {
|
|
10
|
+
super(client);
|
|
11
|
+
this.channelId = channelId;
|
|
12
|
+
this.messageId = messageId;
|
|
13
|
+
this._rawData = data;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The raw Discord API data for this poll
|
|
17
|
+
*/
|
|
18
|
+
get rawData() {
|
|
19
|
+
return this._rawData;
|
|
20
|
+
}
|
|
21
|
+
get question() {
|
|
22
|
+
return this._rawData.question;
|
|
23
|
+
}
|
|
24
|
+
get answers() {
|
|
25
|
+
return this._rawData.answers;
|
|
26
|
+
}
|
|
27
|
+
get allowMultiselect() {
|
|
28
|
+
return this._rawData.allow_multiselect;
|
|
29
|
+
}
|
|
30
|
+
get layoutType() {
|
|
31
|
+
return this._rawData.layout_type;
|
|
32
|
+
}
|
|
33
|
+
get results() {
|
|
34
|
+
return this._rawData.results;
|
|
35
|
+
}
|
|
36
|
+
get expiry() {
|
|
37
|
+
return this._rawData.expiry;
|
|
38
|
+
}
|
|
39
|
+
get isFinalized() {
|
|
40
|
+
return this._rawData.results !== undefined;
|
|
41
|
+
}
|
|
42
|
+
async getAnswerVoters(answerId) {
|
|
43
|
+
const usersData = (await this.client.rest.get(Routes.pollAnswerVoters(this.channelId, this.messageId, answerId)));
|
|
44
|
+
return usersData.users.map((userData) => new User(this.client, userData));
|
|
45
|
+
}
|
|
46
|
+
async end() {
|
|
47
|
+
const updatedMessage = (await this.client.rest.post(Routes.expirePoll(this.channelId, this.messageId), {}));
|
|
48
|
+
return new Message(this.client, updatedMessage);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=Poll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Poll.js","sourceRoot":"","sources":["../../../src/structures/Poll.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,OAAO,IAAK,SAAQ,IAAI;IACrB,SAAS,CAAQ;IACjB,SAAS,CAAQ;IACf,QAAQ,CAAS;IAE3B,YACC,MAAc,EACd,EACC,SAAS,EACT,SAAS,EACT,IAAI,EACqD;QAE1D,KAAK,CAAC,MAAM,CAAC,CAAA;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAA;IACrB,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAA;IAC9B,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,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
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import type { Client } from "../classes/Client.js";
|
|
4
|
+
import type { IfPartial } from "../types/index.js";
|
|
5
|
+
import { type CDNUrlOptions } from "../utils/index.js";
|
|
6
|
+
export declare class Role<IsPartial extends boolean = false> extends Base {
|
|
7
|
+
constructor(client: Client, rawDataOrId: IsPartial extends true ? string : APIRole, guildId?: string);
|
|
8
|
+
protected _rawData: APIRole | null;
|
|
9
|
+
private _guildId?;
|
|
10
|
+
private setData;
|
|
11
|
+
private setField;
|
|
12
|
+
/**
|
|
13
|
+
* The raw Discord API data for this role
|
|
14
|
+
*/
|
|
15
|
+
get rawData(): Readonly<APIRole>;
|
|
16
|
+
/**
|
|
17
|
+
* The ID of the role.
|
|
18
|
+
*/
|
|
19
|
+
readonly id: string;
|
|
20
|
+
/**
|
|
21
|
+
* The ID of the guild this role belongs to
|
|
22
|
+
*/
|
|
23
|
+
get guildId(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the role is a partial role (meaning it does not have all the data).
|
|
26
|
+
* If this is true, you should use {@link Role.fetch} to get the full data of the role.
|
|
27
|
+
*/
|
|
28
|
+
get partial(): IsPartial;
|
|
29
|
+
/**
|
|
30
|
+
* The name of the role.
|
|
31
|
+
*/
|
|
32
|
+
get name(): IfPartial<IsPartial, string>;
|
|
33
|
+
/**
|
|
34
|
+
* The color of the role.
|
|
35
|
+
*/
|
|
36
|
+
get color(): IfPartial<IsPartial, number>;
|
|
37
|
+
/**
|
|
38
|
+
* The icon hash of the role.
|
|
39
|
+
* You can use {@link Role.iconUrl} to get the URL of the icon.
|
|
40
|
+
*/
|
|
41
|
+
get icon(): IfPartial<IsPartial, string | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the URL of the role's icon with default settings (png format)
|
|
44
|
+
*/
|
|
45
|
+
get iconUrl(): IfPartial<IsPartial, string | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Get the URL of the role's icon with custom format and size options
|
|
48
|
+
* @param options Optional format and size parameters
|
|
49
|
+
* @returns The icon URL or null if no icon is set
|
|
50
|
+
*/
|
|
51
|
+
getIconUrl(options?: CDNUrlOptions): IfPartial<IsPartial, string | null>;
|
|
52
|
+
/**
|
|
53
|
+
* If this role is mentionable.
|
|
54
|
+
*/
|
|
55
|
+
get mentionable(): IfPartial<IsPartial, boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* If this role is hoisted.
|
|
58
|
+
*/
|
|
59
|
+
get hoisted(): IfPartial<IsPartial, boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* The position of the role.
|
|
62
|
+
*/
|
|
63
|
+
get position(): IfPartial<IsPartial, number>;
|
|
64
|
+
/**
|
|
65
|
+
* The permissions of the role.
|
|
66
|
+
*/
|
|
67
|
+
get permissions(): IfPartial<IsPartial, bigint>;
|
|
68
|
+
/**
|
|
69
|
+
* If this role is managed by an integration.
|
|
70
|
+
*/
|
|
71
|
+
get managed(): IfPartial<IsPartial, boolean>;
|
|
72
|
+
/**
|
|
73
|
+
* The unicode emoji for the role.
|
|
74
|
+
*/
|
|
75
|
+
get unicodeEmoji(): IfPartial<IsPartial, string | null>;
|
|
76
|
+
/**
|
|
77
|
+
* The flags of this role.
|
|
78
|
+
* @see https://discord.com/developers/docs/topics/permissions#role-object-role-flags
|
|
79
|
+
*/
|
|
80
|
+
get flags(): IfPartial<IsPartial, RoleFlags>;
|
|
81
|
+
/**
|
|
82
|
+
* The tags of this role.
|
|
83
|
+
* @see https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure
|
|
84
|
+
*/
|
|
85
|
+
get tags(): IfPartial<IsPartial, APIRoleTags | undefined>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the Discord mention format for this role
|
|
88
|
+
* @returns The mention string in the format <@&roleId>
|
|
89
|
+
*/
|
|
90
|
+
toString(): string;
|
|
91
|
+
/**
|
|
92
|
+
* Fetch updated data for this role.
|
|
93
|
+
* If the role is partial, this will fetch all the data for the role and populate the fields.
|
|
94
|
+
* If the role is not partial, all fields will be updated with new values from Discord.
|
|
95
|
+
* @returns A Promise that resolves to a non-partial Role
|
|
96
|
+
*/
|
|
97
|
+
fetch(): Promise<Role<false>>;
|
|
98
|
+
/**
|
|
99
|
+
* Set the name of the role
|
|
100
|
+
* @param name The new name for the role
|
|
101
|
+
* @param reason The reason for changing the name (will be shown in audit log)
|
|
102
|
+
*/
|
|
103
|
+
setName(name: string, reason?: string): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Set the color of the role
|
|
106
|
+
* @param color The new color for the role
|
|
107
|
+
* @param reason The reason for changing the color (will be shown in audit log)
|
|
108
|
+
*/
|
|
109
|
+
setColor(color: number, reason?: string): Promise<void>;
|
|
110
|
+
/**
|
|
111
|
+
* Set the icon of the role
|
|
112
|
+
* @param icon The unicode emoji or icon URL to set
|
|
113
|
+
* @param reason The reason for changing the icon (will be shown in audit log)
|
|
114
|
+
*/
|
|
115
|
+
setIcon(icon: string, reason?: string): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Set the mentionable status of the role
|
|
118
|
+
* @param mentionable Whether the role should be mentionable
|
|
119
|
+
* @param reason The reason for changing the mentionable status (will be shown in audit log)
|
|
120
|
+
*/
|
|
121
|
+
setMentionable(mentionable: boolean, reason?: string): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Set the hoisted status of the role
|
|
124
|
+
* @param hoisted Whether the role should be hoisted
|
|
125
|
+
* @param reason The reason for changing the hoisted status (will be shown in audit log)
|
|
126
|
+
*/
|
|
127
|
+
setHoisted(hoisted: boolean, reason?: string): Promise<void>;
|
|
128
|
+
/**
|
|
129
|
+
* Set the position of the role
|
|
130
|
+
* @param position The new position for the role
|
|
131
|
+
* @param reason The reason for changing the position (will be shown in audit log)
|
|
132
|
+
*/
|
|
133
|
+
setPosition(position: number, reason?: string): Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Set the permissions of the role
|
|
136
|
+
* @param permissions The permissions to set
|
|
137
|
+
* @param reason The reason for changing the permissions (will be shown in audit log)
|
|
138
|
+
*/
|
|
139
|
+
setPermissions(permissions: bigint[], reason?: string): Promise<void>;
|
|
140
|
+
/**
|
|
141
|
+
* Delete the role
|
|
142
|
+
* @param reason The reason for deleting the role (will be shown in audit log)
|
|
143
|
+
*/
|
|
144
|
+
delete(reason?: string): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Get the member count for this role
|
|
147
|
+
* @returns A Promise that resolves to the number of members with this role
|
|
148
|
+
*/
|
|
149
|
+
fetchMemberCount(): Promise<number>;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=Role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Role.d.ts","sourceRoot":"","sources":["../../../src/structures/Role.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGnE,qBAAa,IAAI,CAAC,SAAS,SAAS,OAAO,GAAG,KAAK,CAAE,SAAQ,IAAI;gBAE/D,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,SAAS,SAAS,IAAI,GAAG,MAAM,GAAG,OAAO,EACtD,OAAO,CAAC,EAAE,MAAM;IAajB,SAAS,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAO;IACzC,OAAO,CAAC,QAAQ,CAAC,CAAQ;IAEzB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,QAAQ;IAMhB;;OAEG;IACH,IAAI,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,CAM/B;IAED;;OAEG;IACH,QAAQ,CAAC,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