@buape/carbon 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -0
- package/.turbo/turbo-dev.log +12 -0
- package/.turbo/turbo-docs.log +10 -0
- package/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +45 -0
- package/dist/package.json +18 -0
- package/dist/src/abstracts/AnySelectMenu.d.ts +31 -0
- package/dist/src/abstracts/AnySelectMenu.d.ts.map +1 -0
- package/dist/src/abstracts/AnySelectMenu.js +19 -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 +21 -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 +44 -0
- package/dist/src/abstracts/BaseChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseChannel.js +58 -0
- package/dist/src/abstracts/BaseChannel.js.map +1 -0
- package/dist/src/abstracts/BaseCommand.d.ts +58 -0
- package/dist/src/abstracts/BaseCommand.d.ts.map +1 -0
- package/dist/src/abstracts/BaseCommand.js +69 -0
- package/dist/src/abstracts/BaseCommand.js.map +1 -0
- package/dist/src/abstracts/BaseComponent.d.ts +34 -0
- package/dist/src/abstracts/BaseComponent.d.ts.map +1 -0
- package/dist/src/abstracts/BaseComponent.js +30 -0
- package/dist/src/abstracts/BaseComponent.js.map +1 -0
- package/dist/src/abstracts/BaseComponentInteraction.d.ts +9 -0
- package/dist/src/abstracts/BaseComponentInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/BaseComponentInteraction.js +14 -0
- package/dist/src/abstracts/BaseComponentInteraction.js.map +1 -0
- package/dist/src/abstracts/BaseGuildChannel.d.ts +68 -0
- package/dist/src/abstracts/BaseGuildChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseGuildChannel.js +130 -0
- package/dist/src/abstracts/BaseGuildChannel.js.map +1 -0
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts +42 -0
- package/dist/src/abstracts/BaseGuildTextChannel.d.ts.map +1 -0
- package/dist/src/abstracts/BaseGuildTextChannel.js +61 -0
- package/dist/src/abstracts/BaseGuildTextChannel.js.map +1 -0
- package/dist/src/abstracts/BaseInteraction.d.ts +87 -0
- package/dist/src/abstracts/BaseInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/BaseInteraction.js +101 -0
- package/dist/src/abstracts/BaseInteraction.js.map +1 -0
- package/dist/src/abstracts/ButtonInteraction.d.ts +8 -0
- package/dist/src/abstracts/ButtonInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/ButtonInteraction.js +18 -0
- package/dist/src/abstracts/ButtonInteraction.js.map +1 -0
- package/dist/src/abstracts/ChannelSelectMenuInteraction.d.ts +7 -0
- package/dist/src/abstracts/ChannelSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/ChannelSelectMenuInteraction.js +11 -0
- package/dist/src/abstracts/ChannelSelectMenuInteraction.js.map +1 -0
- package/dist/src/abstracts/CommandHandler.d.ts +6 -0
- package/dist/src/abstracts/CommandHandler.d.ts.map +1 -0
- package/dist/src/abstracts/CommandHandler.js +65 -0
- package/dist/src/abstracts/CommandHandler.js.map +1 -0
- package/dist/src/abstracts/CommandInteraction.d.ts +15 -0
- package/dist/src/abstracts/CommandInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/CommandInteraction.js +60 -0
- package/dist/src/abstracts/CommandInteraction.js.map +1 -0
- package/dist/src/abstracts/ComponentHandler.d.ts +6 -0
- package/dist/src/abstracts/ComponentHandler.d.ts.map +1 -0
- package/dist/src/abstracts/ComponentHandler.js +64 -0
- package/dist/src/abstracts/ComponentHandler.js.map +1 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts +42 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.d.ts.map +1 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.js +54 -0
- package/dist/src/abstracts/GuildThreadOnlyChannel.js.map +1 -0
- package/dist/src/abstracts/MentionableSelectMenuInteraction.d.ts +8 -0
- package/dist/src/abstracts/MentionableSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/MentionableSelectMenuInteraction.js +15 -0
- package/dist/src/abstracts/MentionableSelectMenuInteraction.js.map +1 -0
- package/dist/src/abstracts/RoleSelectMenuInteraction.d.ts +8 -0
- package/dist/src/abstracts/RoleSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/RoleSelectMenuInteraction.js +14 -0
- package/dist/src/abstracts/RoleSelectMenuInteraction.js.map +1 -0
- package/dist/src/abstracts/StringSelectMenuInteraction.d.ts +8 -0
- package/dist/src/abstracts/StringSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/StringSelectMenuInteraction.js +14 -0
- package/dist/src/abstracts/StringSelectMenuInteraction.js.map +1 -0
- package/dist/src/abstracts/UserSelectMenuInteraction.d.ts +8 -0
- package/dist/src/abstracts/UserSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/abstracts/UserSelectMenuInteraction.js +14 -0
- package/dist/src/abstracts/UserSelectMenuInteraction.js.map +1 -0
- package/dist/src/classes/Button.d.ts +53 -0
- package/dist/src/classes/Button.d.ts.map +1 -0
- package/dist/src/classes/Button.js +55 -0
- package/dist/src/classes/Button.js.map +1 -0
- package/dist/src/classes/ChannelSelectMenu.d.ts +15 -0
- package/dist/src/classes/ChannelSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/ChannelSelectMenu.js +15 -0
- package/dist/src/classes/ChannelSelectMenu.js.map +1 -0
- package/dist/src/classes/Client.d.ts +117 -0
- package/dist/src/classes/Client.d.ts.map +1 -0
- package/dist/src/classes/Client.js +170 -0
- package/dist/src/classes/Client.js.map +1 -0
- package/dist/src/classes/Command.d.ts +35 -0
- package/dist/src/classes/Command.d.ts.map +1 -0
- package/dist/src/classes/Command.js +31 -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 +31 -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 +21 -0
- package/dist/src/classes/CommandWithSubcommands.js.map +1 -0
- package/dist/src/classes/MentionableSelectMenu.d.ts +13 -0
- package/dist/src/classes/MentionableSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/MentionableSelectMenu.js +13 -0
- package/dist/src/classes/MentionableSelectMenu.js.map +1 -0
- package/dist/src/classes/Paginator.d.ts +3 -0
- package/dist/src/classes/Paginator.d.ts.map +1 -0
- package/dist/src/classes/Paginator.js +3 -0
- package/dist/src/classes/Paginator.js.map +1 -0
- package/dist/src/classes/RoleSelectMenu.d.ts +13 -0
- package/dist/src/classes/RoleSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/RoleSelectMenu.js +13 -0
- package/dist/src/classes/RoleSelectMenu.js.map +1 -0
- package/dist/src/classes/Row.d.ts +27 -0
- package/dist/src/classes/Row.d.ts.map +1 -0
- package/dist/src/classes/Row.js +39 -0
- package/dist/src/classes/Row.js.map +1 -0
- package/dist/src/classes/StringSelectMenu.d.ts +13 -0
- package/dist/src/classes/StringSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/StringSelectMenu.js +12 -0
- package/dist/src/classes/StringSelectMenu.js.map +1 -0
- package/dist/src/classes/UserSelectMenu.d.ts +13 -0
- package/dist/src/classes/UserSelectMenu.d.ts.map +1 -0
- package/dist/src/classes/UserSelectMenu.js +13 -0
- package/dist/src/classes/UserSelectMenu.js.map +1 -0
- package/dist/src/factories/channelFactory.d.ts +13 -0
- package/dist/src/factories/channelFactory.d.ts.map +1 -0
- package/dist/src/factories/channelFactory.js +39 -0
- package/dist/src/factories/channelFactory.js.map +1 -0
- package/dist/src/index.d.ts +49 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +55 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/internals/AutocompleteInteraction.d.ts +34 -0
- package/dist/src/internals/AutocompleteInteraction.d.ts.map +1 -0
- package/dist/src/internals/AutocompleteInteraction.js +68 -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 +18 -0
- package/dist/src/internals/ButtonInteraction.js.map +1 -0
- package/dist/src/internals/ChannelSelectMenuInteraction.d.ts +7 -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 +8 -0
- package/dist/src/internals/CommandHandler.d.ts.map +1 -0
- package/dist/src/internals/CommandHandler.js +81 -0
- package/dist/src/internals/CommandHandler.js.map +1 -0
- package/dist/src/internals/CommandInteraction.d.ts +17 -0
- package/dist/src/internals/CommandInteraction.d.ts.map +1 -0
- package/dist/src/internals/CommandInteraction.js +29 -0
- package/dist/src/internals/CommandInteraction.js.map +1 -0
- package/dist/src/internals/ComponentHandler.d.ts +6 -0
- package/dist/src/internals/ComponentHandler.d.ts.map +1 -0
- package/dist/src/internals/ComponentHandler.js +64 -0
- package/dist/src/internals/ComponentHandler.js.map +1 -0
- package/dist/src/internals/MentionableSelectMenuInteraction.d.ts +8 -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/OptionsHandler.d.ts +70 -0
- package/dist/src/internals/OptionsHandler.d.ts.map +1 -0
- package/dist/src/internals/OptionsHandler.js +115 -0
- package/dist/src/internals/OptionsHandler.js.map +1 -0
- package/dist/src/internals/RoleSelectMenuInteraction.d.ts +8 -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 +8 -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/UserSelectMenuInteraction.d.ts +8 -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/structures/AnySelectMenu.d.ts +31 -0
- package/dist/src/structures/AnySelectMenu.d.ts.map +1 -0
- package/dist/src/structures/AnySelectMenu.js +19 -0
- package/dist/src/structures/AnySelectMenu.js.map +1 -0
- package/dist/src/structures/AnySelectMenuInteraction.d.ts +12 -0
- package/dist/src/structures/AnySelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/structures/AnySelectMenuInteraction.js +21 -0
- package/dist/src/structures/AnySelectMenuInteraction.js.map +1 -0
- package/dist/src/structures/Base.d.ts +10 -0
- package/dist/src/structures/Base.d.ts.map +1 -0
- package/dist/src/structures/Base.js +11 -0
- package/dist/src/structures/Base.js.map +1 -0
- package/dist/src/structures/BaseCommand.d.ts +64 -0
- package/dist/src/structures/BaseCommand.d.ts.map +1 -0
- package/dist/src/structures/BaseCommand.js +58 -0
- package/dist/src/structures/BaseCommand.js.map +1 -0
- package/dist/src/structures/BaseComponent.d.ts +34 -0
- package/dist/src/structures/BaseComponent.d.ts.map +1 -0
- package/dist/src/structures/BaseComponent.js +30 -0
- package/dist/src/structures/BaseComponent.js.map +1 -0
- package/dist/src/structures/BaseComponentInteraction.d.ts +9 -0
- package/dist/src/structures/BaseComponentInteraction.d.ts.map +1 -0
- package/dist/src/structures/BaseComponentInteraction.js +14 -0
- package/dist/src/structures/BaseComponentInteraction.js.map +1 -0
- package/dist/src/structures/BaseInteraction.d.ts +81 -0
- package/dist/src/structures/BaseInteraction.d.ts.map +1 -0
- package/dist/src/structures/BaseInteraction.js +99 -0
- package/dist/src/structures/BaseInteraction.js.map +1 -0
- package/dist/src/structures/ButtonInteraction.d.ts +8 -0
- package/dist/src/structures/ButtonInteraction.d.ts.map +1 -0
- package/dist/src/structures/ButtonInteraction.js +18 -0
- package/dist/src/structures/ButtonInteraction.js.map +1 -0
- package/dist/src/structures/ChannelSelectMenuInteraction.d.ts +7 -0
- package/dist/src/structures/ChannelSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/structures/ChannelSelectMenuInteraction.js +11 -0
- package/dist/src/structures/ChannelSelectMenuInteraction.js.map +1 -0
- package/dist/src/structures/CommandHandler.d.ts +6 -0
- package/dist/src/structures/CommandHandler.d.ts.map +1 -0
- package/dist/src/structures/CommandHandler.js +70 -0
- package/dist/src/structures/CommandHandler.js.map +1 -0
- package/dist/src/structures/CommandInteraction.d.ts +15 -0
- package/dist/src/structures/CommandInteraction.d.ts.map +1 -0
- package/dist/src/structures/CommandInteraction.js +60 -0
- package/dist/src/structures/CommandInteraction.js.map +1 -0
- package/dist/src/structures/ComponentHandler.d.ts +6 -0
- package/dist/src/structures/ComponentHandler.d.ts.map +1 -0
- package/dist/src/structures/ComponentHandler.js +64 -0
- package/dist/src/structures/ComponentHandler.js.map +1 -0
- package/dist/src/structures/DmChannel.d.ts +18 -0
- package/dist/src/structures/DmChannel.d.ts.map +1 -0
- package/dist/src/structures/DmChannel.js +24 -0
- package/dist/src/structures/DmChannel.js.map +1 -0
- package/dist/src/structures/GroupDmChannel.d.ts +67 -0
- package/dist/src/structures/GroupDmChannel.d.ts.map +1 -0
- package/dist/src/structures/GroupDmChannel.js +109 -0
- package/dist/src/structures/GroupDmChannel.js.map +1 -0
- package/dist/src/structures/Guild.d.ts +71 -0
- package/dist/src/structures/Guild.d.ts.map +1 -0
- package/dist/src/structures/Guild.js +123 -0
- package/dist/src/structures/Guild.js.map +1 -0
- package/dist/src/structures/GuildAnnouncementChannel.d.ts +12 -0
- package/dist/src/structures/GuildAnnouncementChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildAnnouncementChannel.js +17 -0
- package/dist/src/structures/GuildAnnouncementChannel.js.map +1 -0
- package/dist/src/structures/GuildCategoryChannel.d.ts +13 -0
- package/dist/src/structures/GuildCategoryChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildCategoryChannel.js +14 -0
- package/dist/src/structures/GuildCategoryChannel.js.map +1 -0
- package/dist/src/structures/GuildForumChannel.d.ts +13 -0
- package/dist/src/structures/GuildForumChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildForumChannel.js +14 -0
- package/dist/src/structures/GuildForumChannel.js.map +1 -0
- package/dist/src/structures/GuildMediaChannel.d.ts +13 -0
- package/dist/src/structures/GuildMediaChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildMediaChannel.js +12 -0
- package/dist/src/structures/GuildMediaChannel.js.map +1 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts +30 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.js +34 -0
- package/dist/src/structures/GuildStageOrVoiceChannel.js.map +1 -0
- package/dist/src/structures/GuildTextChannel.d.ts +15 -0
- package/dist/src/structures/GuildTextChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildTextChannel.js +18 -0
- package/dist/src/structures/GuildTextChannel.js.map +1 -0
- package/dist/src/structures/GuildThreadChannel.d.ts +89 -0
- package/dist/src/structures/GuildThreadChannel.d.ts.map +1 -0
- package/dist/src/structures/GuildThreadChannel.js +134 -0
- package/dist/src/structures/GuildThreadChannel.js.map +1 -0
- package/dist/src/structures/MentionableSelectMenuInteraction.d.ts +8 -0
- package/dist/src/structures/MentionableSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/structures/MentionableSelectMenuInteraction.js +15 -0
- package/dist/src/structures/MentionableSelectMenuInteraction.js.map +1 -0
- package/dist/src/structures/Message.d.ts +52 -0
- package/dist/src/structures/Message.d.ts.map +1 -0
- package/dist/src/structures/Message.js +93 -0
- package/dist/src/structures/Message.js.map +1 -0
- package/dist/src/structures/Role.d.ts +106 -0
- package/dist/src/structures/Role.d.ts.map +1 -0
- package/dist/src/structures/Role.js +181 -0
- package/dist/src/structures/Role.js.map +1 -0
- package/dist/src/structures/RoleSelectMenuInteraction.d.ts +8 -0
- package/dist/src/structures/RoleSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/structures/RoleSelectMenuInteraction.js +14 -0
- package/dist/src/structures/RoleSelectMenuInteraction.js.map +1 -0
- package/dist/src/structures/StringSelectMenuInteraction.d.ts +8 -0
- package/dist/src/structures/StringSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/structures/StringSelectMenuInteraction.js +14 -0
- package/dist/src/structures/StringSelectMenuInteraction.js.map +1 -0
- package/dist/src/structures/User.d.ts +80 -0
- package/dist/src/structures/User.d.ts.map +1 -0
- package/dist/src/structures/User.js +133 -0
- package/dist/src/structures/User.js.map +1 -0
- package/dist/src/structures/UserSelectMenuInteraction.d.ts +8 -0
- package/dist/src/structures/UserSelectMenuInteraction.d.ts.map +1 -0
- package/dist/src/structures/UserSelectMenuInteraction.js +14 -0
- package/dist/src/structures/UserSelectMenuInteraction.js.map +1 -0
- package/dist/src/types.d.ts +31 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +33 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils.d.ts +2 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/src/utils.js +11 -0
- package/dist/src/utils.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/docs/classes/AnySelectMenu.mdx +114 -0
- package/docs/classes/AnySelectMenuInteraction.mdx +161 -0
- package/docs/classes/AutocompleteInteraction.mdx +152 -0
- package/docs/classes/AutocompleteOptionsHandler.mdx +243 -0
- package/docs/classes/BaseChannel.mdx +97 -0
- package/docs/classes/BaseCommand.mdx +61 -0
- package/docs/classes/BaseComponent.mdx +55 -0
- package/docs/classes/BaseComponentInteraction.mdx +146 -0
- package/docs/classes/BaseGuildChannel.mdx +262 -0
- package/docs/classes/BaseGuildTextChannel.mdx +360 -0
- package/docs/classes/BaseInteraction.mdx +127 -0
- package/docs/classes/Button.mdx +99 -0
- package/docs/classes/ButtonInteraction.mdx +141 -0
- package/docs/classes/ChannelSelectMenu.mdx +122 -0
- package/docs/classes/ChannelSelectMenuInteraction.mdx +157 -0
- package/docs/classes/Client.mdx +48 -0
- package/docs/classes/Command.mdx +111 -0
- package/docs/classes/CommandHandler.mdx +65 -0
- package/docs/classes/CommandInteraction.mdx +141 -0
- package/docs/classes/CommandWithSubcommandGroups.mdx +73 -0
- package/docs/classes/CommandWithSubcommands.mdx +76 -0
- package/docs/classes/ComponentHandler.mdx +49 -0
- package/docs/classes/DmChannel.mdx +118 -0
- package/docs/classes/GroupDmChannel.mdx +197 -0
- package/docs/classes/Guild.mdx +139 -0
- package/docs/classes/GuildAnnouncementChannel.mdx +377 -0
- package/docs/classes/GuildCategoryChannel.mdx +272 -0
- package/docs/classes/GuildForumChannel.mdx +333 -0
- package/docs/classes/GuildMediaChannel.mdx +327 -0
- package/docs/classes/GuildStageChannel.mdx +276 -0
- package/docs/classes/GuildStageOrVoiceChannel.mdx +292 -0
- package/docs/classes/GuildTextChannel.mdx +367 -0
- package/docs/classes/GuildThreadChannel.mdx +425 -0
- package/docs/classes/GuildThreadOnlyChannel.mdx +333 -0
- package/docs/classes/GuildVoiceChannel.mdx +276 -0
- package/docs/classes/LinkButton.mdx +84 -0
- package/docs/classes/MentionableSelectMenu.mdx +120 -0
- package/docs/classes/MentionableSelectMenuInteraction.mdx +157 -0
- package/docs/classes/Message.mdx +126 -0
- package/docs/classes/OptionsHandler.mdx +203 -0
- package/docs/classes/PremiumButton.mdx +84 -0
- package/docs/classes/Role.mdx +228 -0
- package/docs/classes/RoleSelectMenu.mdx +120 -0
- package/docs/classes/RoleSelectMenuInteraction.mdx +157 -0
- package/docs/classes/Row.mdx +88 -0
- package/docs/classes/StringSelectMenu.mdx +120 -0
- package/docs/classes/StringSelectMenuInteraction.mdx +157 -0
- package/docs/classes/User.mdx +119 -0
- package/docs/classes/UserSelectMenu.mdx +120 -0
- package/docs/classes/UserSelectMenuInteraction.mdx +157 -0
- package/docs/enumerations/ClientMode.mdx +16 -0
- package/docs/functions/channelFactory.mdx +16 -0
- package/docs/index.mdx +83 -0
- package/docs/type-aliases/AnySelectMenuComponentType.mdx +5 -0
- package/docs/type-aliases/ClientOptions.mdx +20 -0
- package/docs/type-aliases/CommandOptions.mdx +5 -0
- package/docs/type-aliases/ComponentAdditionalData.mdx +9 -0
- package/docs/type-aliases/InteractionFileData.mdx +15 -0
- package/docs/type-aliases/InteractionReplyData.mdx +14 -0
- package/docs/type-aliases/InteractionReplyOptions.mdx +13 -0
- package/docs/type-aliases/RawOptions.mdx +9 -0
- package/docs/type-aliases/meta.json +3 -0
- package/package.json +18 -0
- package/src/README.md +7 -0
- package/src/abstracts/AnySelectMenu.ts +63 -0
- package/src/abstracts/AnySelectMenuInteraction.ts +29 -0
- package/src/abstracts/Base.ts +12 -0
- package/src/abstracts/BaseChannel.ts +73 -0
- package/src/abstracts/BaseCommand.ts +95 -0
- package/src/abstracts/BaseComponent.ts +49 -0
- package/src/abstracts/BaseComponentInteraction.ts +19 -0
- package/src/abstracts/BaseGuildChannel.ts +152 -0
- package/src/abstracts/BaseGuildTextChannel.ts +77 -0
- package/src/abstracts/BaseInteraction.ts +170 -0
- package/src/abstracts/GuildThreadOnlyChannel.ts +71 -0
- package/src/classes/Button.ts +95 -0
- package/src/classes/ChannelSelectMenu.ts +21 -0
- package/src/classes/Client.ts +249 -0
- package/src/classes/Command.ts +51 -0
- package/src/classes/CommandWithSubcommandGroups.ts +47 -0
- package/src/classes/CommandWithSubcommands.ts +35 -0
- package/src/classes/MentionableSelectMenu.ts +19 -0
- package/src/classes/RoleSelectMenu.ts +19 -0
- package/src/classes/Row.ts +44 -0
- package/src/classes/StringSelectMenu.ts +19 -0
- package/src/classes/UserSelectMenu.ts +19 -0
- package/src/factories/channelFactory.ts +43 -0
- package/src/index.ts +59 -0
- package/src/internals/AutocompleteInteraction.ts +107 -0
- package/src/internals/ButtonInteraction.ts +26 -0
- package/src/internals/ChannelSelectMenuInteraction.ts +15 -0
- package/src/internals/CommandHandler.ts +123 -0
- package/src/internals/CommandInteraction.ts +49 -0
- package/src/internals/ComponentHandler.ts +81 -0
- package/src/internals/MentionableSelectMenuInteraction.ts +21 -0
- package/src/internals/OptionsHandler.ts +147 -0
- package/src/internals/RoleSelectMenuInteraction.ts +20 -0
- package/src/internals/StringSelectMenuInteraction.ts +20 -0
- package/src/internals/UserSelectMenuInteraction.ts +20 -0
- package/src/structures/DmChannel.ts +31 -0
- package/src/structures/GroupDmChannel.ts +132 -0
- package/src/structures/Guild.ts +142 -0
- package/src/structures/GuildAnnouncementChannel.ts +20 -0
- package/src/structures/GuildCategoryChannel.ts +16 -0
- package/src/structures/GuildForumChannel.ts +20 -0
- package/src/structures/GuildMediaChannel.ts +13 -0
- package/src/structures/GuildStageOrVoiceChannel.ts +46 -0
- package/src/structures/GuildTextChannel.ts +21 -0
- package/src/structures/GuildThreadChannel.ts +150 -0
- package/src/structures/Message.ts +124 -0
- package/src/structures/Role.ts +201 -0
- package/src/structures/User.ts +153 -0
- package/src/utils.ts +13 -0
- package/tests/index.test.ts +4 -0
- package/tsconfig.json +12 -0
- package/typedoc.json +9 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
export class ChannelSelectMenu extends AnySelectMenu {
|
|
4
|
+
type = ComponentType.ChannelSelect;
|
|
5
|
+
channelTypes;
|
|
6
|
+
defaultValues;
|
|
7
|
+
serializeOptions() {
|
|
8
|
+
return {
|
|
9
|
+
type: this.type,
|
|
10
|
+
default_values: this.defaultValues,
|
|
11
|
+
channel_types: this.channelTypes
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ChannelSelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelSelectMenu.js","sourceRoot":"","sources":["../../../src/classes/ChannelSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,MAAM,OAAgB,iBAAkB,SAAQ,aAAa;IAC5D,IAAI,GAAgC,aAAa,CAAC,aAAa,CAAA;IAC/D,YAAY,CAA6C;IACzD,aAAa,CAA8C;IAG3D,gBAAgB;QACf,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,IAAI,CAAC,aAAa;YAClC,aAAa,EAAE,IAAI,CAAC,YAAY;SAChC,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { RequestClient, type RequestClientOptions } from "@buape/carbon-request";
|
|
2
|
+
import { AutoRouter, type IRequestStrict } from "itty-router";
|
|
3
|
+
import type { BaseCommand } from "../abstracts/BaseCommand.js";
|
|
4
|
+
import { CommandHandler } from "../internals/CommandHandler.js";
|
|
5
|
+
import { ComponentHandler } from "../internals/ComponentHandler.js";
|
|
6
|
+
/**
|
|
7
|
+
* The mode that the client is running in.
|
|
8
|
+
* Different platforms have different requirements for how processes are handled.
|
|
9
|
+
*/
|
|
10
|
+
export declare enum ClientMode {
|
|
11
|
+
NodeJS = "node",
|
|
12
|
+
CloudflareWorkers = "cloudflare",
|
|
13
|
+
Bun = "bun",
|
|
14
|
+
Vercel = "vercel",
|
|
15
|
+
Web = "web"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The options used for initializing the client
|
|
19
|
+
*/
|
|
20
|
+
export type ClientOptions = {
|
|
21
|
+
/**
|
|
22
|
+
* If you want to have the root route for the interaction handler redirect to a different URL, you can set this.
|
|
23
|
+
*/
|
|
24
|
+
redirectUrl?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The client ID of the bot
|
|
27
|
+
*/
|
|
28
|
+
clientId: string;
|
|
29
|
+
/**
|
|
30
|
+
* The public key of the bot, used for interaction verification
|
|
31
|
+
*/
|
|
32
|
+
publicKey: string;
|
|
33
|
+
/**
|
|
34
|
+
* The token of the bot
|
|
35
|
+
*/
|
|
36
|
+
token: string;
|
|
37
|
+
/**
|
|
38
|
+
* The mode of the client, generally where you are hosting the bot. If you have a different mode for your local development, make sure to set it to the local one.
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* import { Client, ClientMode } from "@buape/carbon"
|
|
42
|
+
*
|
|
43
|
+
* const client = new Client({
|
|
44
|
+
* clientId: "12345678901234567890",
|
|
45
|
+
* publicKey: "c1a2f941ae8ce6d776f7704d0bb3d46b863e21fda491cdb2bdba6b8bc5fe7269",
|
|
46
|
+
* token: "MTA4NjEwNTYxMDUxMDE1NTg1Nw.GNt-U8.OSHy-g-5FlfESnu3Z9MEEMJLHiRthXajiXNwiE",
|
|
47
|
+
* mode: process.env.NODE_ENV === "development" ? ClientMode.NodeJS : ClientMode.CloudflareWorkers
|
|
48
|
+
* })
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
mode: ClientMode;
|
|
52
|
+
/**
|
|
53
|
+
* The options used to initialize the request client, if you want to customize it.
|
|
54
|
+
*/
|
|
55
|
+
requestOptions?: RequestClientOptions;
|
|
56
|
+
/**
|
|
57
|
+
* The port to run the server on, if you are using {@link ClientMode.Bun} mode.
|
|
58
|
+
*/
|
|
59
|
+
port?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the commands should be deployed to Discord automatically.
|
|
62
|
+
*/
|
|
63
|
+
autoDeploy?: boolean;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The main client used to interact with Discord
|
|
67
|
+
*/
|
|
68
|
+
export declare class Client {
|
|
69
|
+
/**
|
|
70
|
+
* The options used to initialize the client
|
|
71
|
+
*/
|
|
72
|
+
options: ClientOptions;
|
|
73
|
+
/**
|
|
74
|
+
* The commands that the client has registered
|
|
75
|
+
*/
|
|
76
|
+
commands: BaseCommand[];
|
|
77
|
+
/**
|
|
78
|
+
* The router used to handle requests
|
|
79
|
+
*/
|
|
80
|
+
router: ReturnType<typeof AutoRouter<IRequestStrict>>;
|
|
81
|
+
/**
|
|
82
|
+
* The rest client used to interact with the Discord API
|
|
83
|
+
*/
|
|
84
|
+
rest: RequestClient;
|
|
85
|
+
/**
|
|
86
|
+
* The handler for the component interactions sent from Discord
|
|
87
|
+
*/
|
|
88
|
+
componentHandler: ComponentHandler;
|
|
89
|
+
commandHandler: CommandHandler;
|
|
90
|
+
/**
|
|
91
|
+
* Creates a new client
|
|
92
|
+
* @param options The options used to initialize the client
|
|
93
|
+
* @param commands The commands that the client has registered
|
|
94
|
+
*/
|
|
95
|
+
constructor(options: ClientOptions, commands: BaseCommand[]);
|
|
96
|
+
/**
|
|
97
|
+
* Deploy the commands registered to Discord.
|
|
98
|
+
* This is automatically called when running in NodeJS mode.
|
|
99
|
+
*/
|
|
100
|
+
deployCommands(): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Setup the routes for the client
|
|
103
|
+
*/
|
|
104
|
+
private setupRoutes;
|
|
105
|
+
/**
|
|
106
|
+
* Validate the interaction request
|
|
107
|
+
* @param req The request to validate
|
|
108
|
+
*/
|
|
109
|
+
private validateInteraction;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* @hidden
|
|
113
|
+
*/
|
|
114
|
+
export interface ExecutionContext {
|
|
115
|
+
waitUntil(promise: Promise<any>): void;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=Client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../../../src/classes/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAQhF,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAqB,MAAM,aAAa,CAAA;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;;GAGG;AACH,oBAAY,UAAU;IACrB,MAAM,SAAS;IACf,iBAAiB,eAAe;IAChC,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,GAAG,QAAQ;CACX;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;;;;;;;OAaG;IACH,IAAI,EAAE,UAAU,CAAA;IAChB;;OAEG;IACH,cAAc,CAAC,EAAE,oBAAoB,CAAA;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,qBAAa,MAAM;IAClB;;OAEG;IACH,OAAO,EAAE,aAAa,CAAA;IACtB;;OAEG;IACH,QAAQ,EAAE,WAAW,EAAE,CAAA;IACvB;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,cAAc,CAAC,CAAC,CAAA;IACrD;;OAEG;IACH,IAAI,EAAE,aAAa,CAAA;IACnB;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,cAAc,EAAE,cAAc,CAAA;IAE9B;;;;OAIG;gBACS,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE;IAmB3D;;;OAGG;IACG,cAAc;IAepB;;OAEG;IACH,OAAO,CAAC,WAAW;IAyEnB;;;OAGG;YACW,mBAAmB;CAiBjC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAEhC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;CACtC"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { RequestClient } from "@buape/carbon-request";
|
|
2
|
+
import { InteractionResponseType, InteractionType, Routes } from "discord-api-types/v10";
|
|
3
|
+
import { PlatformAlgorithm, isValidRequest } from "discord-verify";
|
|
4
|
+
import { AutoRouter, StatusError, json } from "itty-router";
|
|
5
|
+
import { CommandHandler } from "../internals/CommandHandler.js";
|
|
6
|
+
import { ComponentHandler } from "../internals/ComponentHandler.js";
|
|
7
|
+
/**
|
|
8
|
+
* The mode that the client is running in.
|
|
9
|
+
* Different platforms have different requirements for how processes are handled.
|
|
10
|
+
*/
|
|
11
|
+
export var ClientMode;
|
|
12
|
+
(function (ClientMode) {
|
|
13
|
+
ClientMode["NodeJS"] = "node";
|
|
14
|
+
ClientMode["CloudflareWorkers"] = "cloudflare";
|
|
15
|
+
ClientMode["Bun"] = "bun";
|
|
16
|
+
ClientMode["Vercel"] = "vercel";
|
|
17
|
+
ClientMode["Web"] = "web";
|
|
18
|
+
})(ClientMode || (ClientMode = {}));
|
|
19
|
+
/**
|
|
20
|
+
* The main client used to interact with Discord
|
|
21
|
+
*/
|
|
22
|
+
export class Client {
|
|
23
|
+
/**
|
|
24
|
+
* The options used to initialize the client
|
|
25
|
+
*/
|
|
26
|
+
options;
|
|
27
|
+
/**
|
|
28
|
+
* The commands that the client has registered
|
|
29
|
+
*/
|
|
30
|
+
commands;
|
|
31
|
+
/**
|
|
32
|
+
* The router used to handle requests
|
|
33
|
+
*/
|
|
34
|
+
router;
|
|
35
|
+
/**
|
|
36
|
+
* The rest client used to interact with the Discord API
|
|
37
|
+
*/
|
|
38
|
+
rest;
|
|
39
|
+
/**
|
|
40
|
+
* The handler for the component interactions sent from Discord
|
|
41
|
+
*/
|
|
42
|
+
componentHandler;
|
|
43
|
+
commandHandler;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new client
|
|
46
|
+
* @param options The options used to initialize the client
|
|
47
|
+
* @param commands The commands that the client has registered
|
|
48
|
+
*/
|
|
49
|
+
constructor(options, commands) {
|
|
50
|
+
if (!options.clientId)
|
|
51
|
+
throw new Error("Missing client ID");
|
|
52
|
+
if (!options.publicKey)
|
|
53
|
+
throw new Error("Missing public key");
|
|
54
|
+
if (!options.token)
|
|
55
|
+
throw new Error("Missing token");
|
|
56
|
+
this.options = options;
|
|
57
|
+
this.commands = commands;
|
|
58
|
+
const routerData = this.options.mode === ClientMode.Bun && this.options.port
|
|
59
|
+
? { port: this.options.port }
|
|
60
|
+
: {};
|
|
61
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
62
|
+
this.router = AutoRouter(routerData);
|
|
63
|
+
this.rest = new RequestClient(options.token, options.requestOptions);
|
|
64
|
+
this.componentHandler = new ComponentHandler(this);
|
|
65
|
+
this.commandHandler = new CommandHandler(this);
|
|
66
|
+
this.setupRoutes();
|
|
67
|
+
if (this.options.autoDeploy)
|
|
68
|
+
this.deployCommands();
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Deploy the commands registered to Discord.
|
|
72
|
+
* This is automatically called when running in NodeJS mode.
|
|
73
|
+
*/
|
|
74
|
+
async deployCommands() {
|
|
75
|
+
try {
|
|
76
|
+
const commands = this.commands.map((command) => {
|
|
77
|
+
return command.serialize();
|
|
78
|
+
});
|
|
79
|
+
await this.rest.put(Routes.applicationCommands(this.options.clientId), {
|
|
80
|
+
body: commands
|
|
81
|
+
});
|
|
82
|
+
console.log(`Deployed ${commands.length} commands to Discord`);
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
console.error("Failed to deploy commands");
|
|
86
|
+
console.error(err);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Setup the routes for the client
|
|
91
|
+
*/
|
|
92
|
+
setupRoutes() {
|
|
93
|
+
this.router.get("/", () => {
|
|
94
|
+
if (this.options.redirectUrl)
|
|
95
|
+
return Response.redirect(this.options.redirectUrl, 302);
|
|
96
|
+
throw new StatusError(404);
|
|
97
|
+
});
|
|
98
|
+
this.router.post("/interaction", async (req, ctx) => {
|
|
99
|
+
const isValid = await this.validateInteraction(req);
|
|
100
|
+
if (!isValid) {
|
|
101
|
+
return new Response("Invalid request signature", { status: 401 });
|
|
102
|
+
}
|
|
103
|
+
const rawInteraction = (await req.json());
|
|
104
|
+
if (rawInteraction.type === InteractionType.Ping) {
|
|
105
|
+
return json({
|
|
106
|
+
type: InteractionResponseType.Pong
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (rawInteraction.type === InteractionType.ApplicationCommand) {
|
|
110
|
+
if (ctx?.waitUntil) {
|
|
111
|
+
ctx.waitUntil((async () => {
|
|
112
|
+
await this.commandHandler.handleCommandInteraction(rawInteraction);
|
|
113
|
+
})());
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
await this.commandHandler.handleCommandInteraction(rawInteraction);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (rawInteraction.type === InteractionType.ApplicationCommandAutocomplete) {
|
|
120
|
+
if (ctx?.waitUntil) {
|
|
121
|
+
ctx.waitUntil((async () => {
|
|
122
|
+
await this.commandHandler.handleAutocompleteInteraction(rawInteraction);
|
|
123
|
+
})());
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
await this.commandHandler.handleAutocompleteInteraction(rawInteraction);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (rawInteraction.type === InteractionType.ApplicationCommand) {
|
|
130
|
+
if (ctx?.waitUntil) {
|
|
131
|
+
ctx.waitUntil((async () => {
|
|
132
|
+
await this.commandHandler.handleCommandInteraction(rawInteraction);
|
|
133
|
+
})());
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
await this.commandHandler.handleCommandInteraction(rawInteraction);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (rawInteraction.type === InteractionType.MessageComponent) {
|
|
140
|
+
if (ctx?.waitUntil) {
|
|
141
|
+
ctx.waitUntil((async () => {
|
|
142
|
+
await this.componentHandler.handleInteraction(rawInteraction);
|
|
143
|
+
})());
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
await this.componentHandler.handleInteraction(rawInteraction);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return new Response(null, { status: 202 });
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Validate the interaction request
|
|
154
|
+
* @param req The request to validate
|
|
155
|
+
*/
|
|
156
|
+
async validateInteraction(req) {
|
|
157
|
+
if (req.method !== "POST") {
|
|
158
|
+
throw new StatusError(405);
|
|
159
|
+
}
|
|
160
|
+
const isValid = await isValidRequest(req, this.options.publicKey, this.options.mode === ClientMode.CloudflareWorkers
|
|
161
|
+
? PlatformAlgorithm.Cloudflare
|
|
162
|
+
: this.options.mode === ClientMode.Vercel
|
|
163
|
+
? PlatformAlgorithm.VercelProd
|
|
164
|
+
: this.options.mode === ClientMode.Web
|
|
165
|
+
? PlatformAlgorithm.Web
|
|
166
|
+
: PlatformAlgorithm.NewNode);
|
|
167
|
+
return isValid;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=Client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../../../src/classes/Client.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type APIApplicationCommandBasicOption, ApplicationCommandType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseCommand } from "../abstracts/BaseCommand.js";
|
|
3
|
+
import type { CommandInteraction } from "../internals/CommandInteraction.js";
|
|
4
|
+
import type { AutocompleteInteraction } from "../internals/AutocompleteInteraction.js";
|
|
5
|
+
export type CommandOptions = APIApplicationCommandBasicOption[];
|
|
6
|
+
/**
|
|
7
|
+
* Represents a standard command that the user creates
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class Command extends BaseCommand {
|
|
10
|
+
/**
|
|
11
|
+
* The options that the user passes along with the command in Discord
|
|
12
|
+
*/
|
|
13
|
+
options?: CommandOptions;
|
|
14
|
+
/**
|
|
15
|
+
* The type of command, either ChatInput, User, or Message. User and Message are context menu commands.
|
|
16
|
+
* @default ChatInput
|
|
17
|
+
*/
|
|
18
|
+
type: ApplicationCommandType;
|
|
19
|
+
/**
|
|
20
|
+
* The function that is called when the command is ran
|
|
21
|
+
* @param interaction The interaction that triggered the command
|
|
22
|
+
*/
|
|
23
|
+
abstract run(interaction: CommandInteraction): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* The function that is called when the command's autocomplete is triggered.
|
|
26
|
+
* @param interaction The interaction that triggered the autocomplete
|
|
27
|
+
* @remarks You are expected to `override` this function to provide your own autocomplete functionality.
|
|
28
|
+
*/
|
|
29
|
+
autocomplete(interaction: AutocompleteInteraction): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
serializeOptions(): CommandOptions | undefined;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=Command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.d.ts","sourceRoot":"","sources":["../../../src/classes/Command.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,gCAAgC,EACrC,sBAAsB,EACtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AAEtF,MAAM,MAAM,cAAc,GAAG,gCAAgC,EAAE,CAAA;AAE/D;;GAEG;AACH,8BAAsB,OAAQ,SAAQ,WAAW;IAChD;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB;;;OAGG;IACH,IAAI,EAAE,sBAAsB,CAAmC;IAE/D;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAE5D;;;;OAIG;IACU,YAAY,CACxB,WAAW,EAAE,uBAAuB,GAClC,OAAO,CAAC,IAAI,CAAC;IAMhB;;OAEG;IACH,gBAAgB;CAGhB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ApplicationCommandType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseCommand } from "../abstracts/BaseCommand.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a standard command that the user creates
|
|
5
|
+
*/
|
|
6
|
+
export class Command extends BaseCommand {
|
|
7
|
+
/**
|
|
8
|
+
* The options that the user passes along with the command in Discord
|
|
9
|
+
*/
|
|
10
|
+
options;
|
|
11
|
+
/**
|
|
12
|
+
* The type of command, either ChatInput, User, or Message. User and Message are context menu commands.
|
|
13
|
+
* @default ChatInput
|
|
14
|
+
*/
|
|
15
|
+
type = ApplicationCommandType.ChatInput;
|
|
16
|
+
/**
|
|
17
|
+
* The function that is called when the command's autocomplete is triggered.
|
|
18
|
+
* @param interaction The interaction that triggered the autocomplete
|
|
19
|
+
* @remarks You are expected to `override` this function to provide your own autocomplete functionality.
|
|
20
|
+
*/
|
|
21
|
+
async autocomplete(interaction) {
|
|
22
|
+
throw new Error(`The ${interaction.rawData.data.name} command does not support autocomplete`);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
serializeOptions() {
|
|
28
|
+
return this.options;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=Command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Command.js","sourceRoot":"","sources":["../../../src/classes/Command.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,sBAAsB,EACtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAMzD;;GAEG;AACH,MAAM,OAAgB,OAAQ,SAAQ,WAAW;IAChD;;OAEG;IACH,OAAO,CAAiB;IAExB;;;OAGG;IACH,IAAI,GAA2B,sBAAsB,CAAC,SAAS,CAAA;IAQ/D;;;;OAIG;IACI,KAAK,CAAC,YAAY,CACxB,WAAoC;QAEpC,MAAM,IAAI,KAAK,CACd,OAAO,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,wCAAwC,CAC5E,CAAA;IACF,CAAC;IAED;;OAEG;IACH,gBAAgB;QACf,OAAO,IAAI,CAAC,OAAO,CAAA;IACpB,CAAC;CACD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type APIApplicationCommandSubcommandGroupOption, type APIApplicationCommandSubcommandOption } from "discord-api-types/v10";
|
|
2
|
+
import type { Command } from "./Command.js";
|
|
3
|
+
import { CommandWithSubcommands } from "./CommandWithSubcommands.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a subcommand group command that the user creates.
|
|
6
|
+
* You make this instead of a {@link Command} class when you want to have subcommand groups in your options.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class CommandWithSubcommandGroups extends CommandWithSubcommands {
|
|
9
|
+
/**
|
|
10
|
+
* The subcommands that the user can use
|
|
11
|
+
*/
|
|
12
|
+
subcommands: Command[];
|
|
13
|
+
/**
|
|
14
|
+
* The subcommands that the user can use
|
|
15
|
+
*/
|
|
16
|
+
abstract subcommandGroups: CommandWithSubcommands[];
|
|
17
|
+
/**
|
|
18
|
+
* @internal
|
|
19
|
+
*/
|
|
20
|
+
serializeOptions(): (APIApplicationCommandSubcommandGroupOption | APIApplicationCommandSubcommandOption)[];
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=CommandWithSubcommandGroups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandWithSubcommandGroups.d.ts","sourceRoot":"","sources":["../../../src/classes/CommandWithSubcommandGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,0CAA0C,EAC/C,KAAK,qCAAqC,EAE1C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE;;;GAGG;AACH,8BAAsB,2BAA4B,SAAQ,sBAAsB;IAC/E;;OAEG;IACH,WAAW,EAAE,OAAO,EAAE,CAAK;IAE3B;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,CAAA;IAEnD;;OAEG;IACH,gBAAgB;CAmBhB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ApplicationCommandOptionType } from "discord-api-types/v10";
|
|
2
|
+
import { CommandWithSubcommands } from "./CommandWithSubcommands.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a subcommand group command that the user creates.
|
|
5
|
+
* You make this instead of a {@link Command} class when you want to have subcommand groups in your options.
|
|
6
|
+
*/
|
|
7
|
+
export class CommandWithSubcommandGroups extends CommandWithSubcommands {
|
|
8
|
+
/**
|
|
9
|
+
* The subcommands that the user can use
|
|
10
|
+
*/
|
|
11
|
+
subcommands = [];
|
|
12
|
+
/**
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
serializeOptions() {
|
|
16
|
+
const subcommands = this.subcommands.map((subcommand) => ({
|
|
17
|
+
name: subcommand.name,
|
|
18
|
+
description: subcommand.description,
|
|
19
|
+
type: ApplicationCommandOptionType.Subcommand,
|
|
20
|
+
options: subcommand.serializeOptions()
|
|
21
|
+
}));
|
|
22
|
+
const subcommandGroups = this.subcommandGroups.map((subcommandGroup) => ({
|
|
23
|
+
name: subcommandGroup.name,
|
|
24
|
+
description: subcommandGroup.description,
|
|
25
|
+
type: ApplicationCommandOptionType.SubcommandGroup,
|
|
26
|
+
options: subcommandGroup.serializeOptions()
|
|
27
|
+
}));
|
|
28
|
+
return [...subcommands, ...subcommandGroups];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=CommandWithSubcommandGroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandWithSubcommandGroups.js","sourceRoot":"","sources":["../../../src/classes/CommandWithSubcommandGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,4BAA4B,EAC5B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE;;;GAGG;AACH,MAAM,OAAgB,2BAA4B,SAAQ,sBAAsB;IAC/E;;OAEG;IACH,WAAW,GAAc,EAAE,CAAA;IAO3B;;OAEG;IACH,gBAAgB;QACf,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YACzD,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,IAAI,EAAE,4BAA4B,CAAC,UAAU;YAC7C,OAAO,EACN,UAAU,CAAC,gBAAgB,EAAwC;SACpE,CAAC,CAA4C,CAAA;QAE9C,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;YACxE,IAAI,EAAE,eAAe,CAAC,IAAI;YAC1B,WAAW,EAAE,eAAe,CAAC,WAAW;YACxC,IAAI,EAAE,4BAA4B,CAAC,eAAe;YAClD,OAAO,EACN,eAAe,CAAC,gBAAgB,EAA6C;SAC9E,CAAC,CAAiD,CAAA;QAEnD,OAAO,CAAC,GAAG,WAAW,EAAE,GAAG,gBAAgB,CAAC,CAAA;IAC7C,CAAC;CACD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ApplicationCommandType, type RESTPostAPIApplicationCommandsJSONBody } from "discord-api-types/v10";
|
|
2
|
+
import { BaseCommand } from "../abstracts/BaseCommand.js";
|
|
3
|
+
import type { Command } from "./Command.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a subcommand command that the user creates.
|
|
6
|
+
* You make this instead of a {@link Command} class when you want to have subcommands in your options.
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class CommandWithSubcommands extends BaseCommand {
|
|
9
|
+
type: ApplicationCommandType;
|
|
10
|
+
/**
|
|
11
|
+
* The subcommands that the user can use
|
|
12
|
+
*/
|
|
13
|
+
abstract subcommands: Command[];
|
|
14
|
+
/**
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
serializeOptions(): RESTPostAPIApplicationCommandsJSONBody["options"];
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=CommandWithSubcommands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandWithSubcommands.d.ts","sourceRoot":"","sources":["../../../src/classes/CommandWithSubcommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,sBAAsB,EACtB,KAAK,sCAAsC,EAC3C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;GAGG;AACH,8BAAsB,sBAAuB,SAAQ,WAAW;IAC/D,IAAI,yBAAmC;IAEvC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,CAAA;IAE/B;;OAEG;IACH,gBAAgB,IAAI,sCAAsC,CAAC,SAAS,CAAC;CASrE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ApplicationCommandOptionType, ApplicationCommandType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseCommand } from "../abstracts/BaseCommand.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a subcommand command that the user creates.
|
|
5
|
+
* You make this instead of a {@link Command} class when you want to have subcommands in your options.
|
|
6
|
+
*/
|
|
7
|
+
export class CommandWithSubcommands extends BaseCommand {
|
|
8
|
+
type = ApplicationCommandType.ChatInput;
|
|
9
|
+
/**
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
serializeOptions() {
|
|
13
|
+
return this.subcommands.map((subcommand) => ({
|
|
14
|
+
name: subcommand.name,
|
|
15
|
+
description: subcommand.description,
|
|
16
|
+
type: ApplicationCommandOptionType.Subcommand,
|
|
17
|
+
options: subcommand.serializeOptions()
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=CommandWithSubcommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandWithSubcommands.js","sourceRoot":"","sources":["../../../src/classes/CommandWithSubcommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,4BAA4B,EAC5B,sBAAsB,EAEtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAGzD;;;GAGG;AACH,MAAM,OAAgB,sBAAuB,SAAQ,WAAW;IAC/D,IAAI,GAAG,sBAAsB,CAAC,SAAS,CAAA;IAOvC;;OAEG;IACH,gBAAgB;QACf,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;YAC5C,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,IAAI,EAAE,4BAA4B,CAAC,UAAU;YAC7C,OAAO,EACN,UAAU,CAAC,gBAAgB,EAAwC;SACpE,CAAC,CAA4C,CAAA;IAC/C,CAAC;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type APIMentionableSelectComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
import type { MentionableSelectMenuInteraction } from "../internals/MentionableSelectMenuInteraction.js";
|
|
4
|
+
export declare abstract class MentionableSelectMenu extends AnySelectMenu {
|
|
5
|
+
type: ComponentType.MentionableSelect;
|
|
6
|
+
defaultValues?: APIMentionableSelectComponent["default_values"];
|
|
7
|
+
abstract run(interaction: MentionableSelectMenuInteraction): Promise<void>;
|
|
8
|
+
serializeOptions(): {
|
|
9
|
+
type: ComponentType.MentionableSelect;
|
|
10
|
+
default_values: import("discord-api-types/v10").APISelectMenuDefaultValue<import("discord-api-types/v10").SelectMenuDefaultValueType.Role | import("discord-api-types/v10").SelectMenuDefaultValueType.User>[] | undefined;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=MentionableSelectMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionableSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/classes/MentionableSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,6BAA6B,EAClC,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAA;AAExG,8BAAsB,qBAAsB,SAAQ,aAAa;IAChE,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAkC;IACvE,aAAa,CAAC,EAAE,6BAA6B,CAAC,gBAAgB,CAAC,CAAA;IAC/D,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1E,gBAAgB;;;;CAMhB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
export class MentionableSelectMenu extends AnySelectMenu {
|
|
4
|
+
type = ComponentType.MentionableSelect;
|
|
5
|
+
defaultValues;
|
|
6
|
+
serializeOptions() {
|
|
7
|
+
return {
|
|
8
|
+
type: this.type,
|
|
9
|
+
default_values: this.defaultValues
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=MentionableSelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MentionableSelectMenu.js","sourceRoot":"","sources":["../../../src/classes/MentionableSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,MAAM,OAAgB,qBAAsB,SAAQ,aAAa;IAChE,IAAI,GAAoC,aAAa,CAAC,iBAAiB,CAAA;IACvE,aAAa,CAAkD;IAG/D,gBAAgB;QACf,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,IAAI,CAAC,aAAa;SAClC,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Paginator.d.ts","sourceRoot":"","sources":["../../../src/classes/Paginator.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;CAGrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Paginator.js","sourceRoot":"","sources":["../../../src/classes/Paginator.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAS;CAGrB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type APIRoleSelectComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
import type { RoleSelectMenuInteraction } from "../internals/RoleSelectMenuInteraction.js";
|
|
4
|
+
export declare abstract class RoleSelectMenu extends AnySelectMenu {
|
|
5
|
+
type: ComponentType.RoleSelect;
|
|
6
|
+
defaultValues?: APIRoleSelectComponent["default_values"];
|
|
7
|
+
abstract run(interaction: RoleSelectMenuInteraction): Promise<void>;
|
|
8
|
+
serializeOptions(): {
|
|
9
|
+
type: ComponentType.RoleSelect;
|
|
10
|
+
default_values: import("discord-api-types/v10").APISelectMenuDefaultValue<import("discord-api-types/v10").SelectMenuDefaultValueType.Role>[] | undefined;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=RoleSelectMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSelectMenu.d.ts","sourceRoot":"","sources":["../../../src/classes/RoleSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,sBAAsB,EAC3B,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAA;AAE1F,8BAAsB,cAAe,SAAQ,aAAa;IACzD,IAAI,EAAE,aAAa,CAAC,UAAU,CAA2B;IACzD,aAAa,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;IACxD,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAEnE,gBAAgB;;;;CAMhB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js";
|
|
3
|
+
export class RoleSelectMenu extends AnySelectMenu {
|
|
4
|
+
type = ComponentType.RoleSelect;
|
|
5
|
+
defaultValues;
|
|
6
|
+
serializeOptions() {
|
|
7
|
+
return {
|
|
8
|
+
type: this.type,
|
|
9
|
+
default_values: this.defaultValues
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=RoleSelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSelectMenu.js","sourceRoot":"","sources":["../../../src/classes/RoleSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAG7D,MAAM,OAAgB,cAAe,SAAQ,aAAa;IACzD,IAAI,GAA6B,aAAa,CAAC,UAAU,CAAA;IACzD,aAAa,CAA2C;IAGxD,gBAAgB;QACf,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,cAAc,EAAE,IAAI,CAAC,aAAa;SAClC,CAAA;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseComponent } from "../abstracts/BaseComponent.js";
|
|
2
|
+
export declare class Row {
|
|
3
|
+
/**
|
|
4
|
+
* The components in the action row
|
|
5
|
+
*/
|
|
6
|
+
components: BaseComponent[];
|
|
7
|
+
constructor(components: BaseComponent[]);
|
|
8
|
+
/**
|
|
9
|
+
* Add a component to the action row
|
|
10
|
+
* @param component The component to add
|
|
11
|
+
*/
|
|
12
|
+
addComponent(component: BaseComponent): void;
|
|
13
|
+
/**
|
|
14
|
+
* Remove a component from the action row
|
|
15
|
+
* @param component The component to remove
|
|
16
|
+
*/
|
|
17
|
+
removeComponent(component: BaseComponent): void;
|
|
18
|
+
/**
|
|
19
|
+
* Remove all components from the action row
|
|
20
|
+
*/
|
|
21
|
+
removeAllComponents(): void;
|
|
22
|
+
serialize(): {
|
|
23
|
+
type: number;
|
|
24
|
+
components: import("discord-api-types/v10").APIBaseComponent<import("discord-api-types/v10").ComponentType>[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=Row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/classes/Row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAElE,qBAAa,GAAG;IACf;;OAEG;IACH,UAAU,EAAE,aAAa,EAAE,CAAA;gBAEf,UAAU,EAAE,aAAa,EAAE;IAIvC;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,aAAa;IAIrC;;;OAGG;IACH,eAAe,CAAC,SAAS,EAAE,aAAa;IAMxC;;OAEG;IACH,mBAAmB;IAInB,SAAS;;;;CAMT"}
|