@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,12 @@
|
|
|
1
|
+
|
|
2
|
+
> @buape/carbon@0.0.0 dev /Users/shadow/Projects/carbon/packages/carbon
|
|
3
|
+
> tsc -w
|
|
4
|
+
|
|
5
|
+
[[90m12:08:38 PM[0m] Starting compilation in watch mode...
|
|
6
|
+
|
|
7
|
+
[[90m12:08:40 PM[0m] Found 0 errors. Watching for file changes.
|
|
8
|
+
|
|
9
|
+
[[90m12:09:35 PM[0m] File change detected. Starting incremental compilation...
|
|
10
|
+
|
|
11
|
+
[[90m12:09:36 PM[0m] Found 0 errors. Watching for file changes.
|
|
12
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @buape/carbon@0.0.0 docs /Users/shadow/Projects/carbon/packages/carbon
|
|
4
|
+
> typedoc
|
|
5
|
+
|
|
6
|
+
[96m[info][0m Loaded plugin typedoc-plugin-mdn-links
|
|
7
|
+
[96m[info][0m Loaded plugin typedoc-plugin-markdown
|
|
8
|
+
[96m[info][0m Loaded plugin typedoc-plugin-frontmatter
|
|
9
|
+
[96m[info][0m Loaded plugin /Users/shadow/Projects/carbon/formatter.mjs
|
|
10
|
+
[96m[info][0m Documentation generated at ./docs
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @buape/carbon
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1a00131: Initial beta!
|
|
8
|
+
|
|
9
|
+
Featuring interactions, commands, messages, subcommands, options, linked roles, and more!
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [1a00131]
|
|
14
|
+
- @buape/carbon-request@0.1.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Buape Studios
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Carbon
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<a href="https://go.buape.com/Discord"><img src="https://cdn.buape.com/CarbonWordmark.png" alt="Carbon Wordmark"></a>
|
|
5
|
+
|
|
6
|
+
<img alt="Discord" src="https://img.shields.io/discord/744282929684938844?style=for-the-badge">
|
|
7
|
+
<img alt="NPM Version" src="https://img.shields.io/npm/v/@buape/carbon?style=for-the-badge">
|
|
8
|
+
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/@buape/carbon?style=for-the-badge">
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
Carbon is a fully-featured framework for building HTTP Discord bots. It supports both Cloudflare Workers and Node.js, and provides a simple and intuitive API for creating commands and handling interactions.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- Fully up to date with the Discord API
|
|
16
|
+
- Integrates with Discord's Monetization
|
|
17
|
+
- Easy to use component framework
|
|
18
|
+
- Built in pagination support
|
|
19
|
+
- More to come!
|
|
20
|
+
|
|
21
|
+
## Why Carbon?
|
|
22
|
+
|
|
23
|
+
Carbon is designed to be easy to use and understand, while still providing the flexibility and power needed to build complex bots.
|
|
24
|
+
You can deploy it to many services and serverless platforms, and it's easy to integrate with other frameworks and libraries.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
To get started with Carbon, you can install it via your package manager of choice:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install @buape/carbon
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Useful Links
|
|
35
|
+
|
|
36
|
+
- [Website](https://carbon.buape.com) ([Source](https://github.com/buape/carbon/tree/main/apps/website))
|
|
37
|
+
- [Documentation](https://carbon.buape.com/docs)
|
|
38
|
+
- [Discord](https://go.buape.com/discord)
|
|
39
|
+
- [NPM](https://www.npmjs.com/package/@buape/carbon)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## Examples
|
|
43
|
+
|
|
44
|
+
- [Cloudflare Workers](https://github.com/buape/carbon/tree/main/apps/cloudo)
|
|
45
|
+
- [Node.js](https://github.com/buape/carbon/tree/main/apps/rocko)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@buape/carbon",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/src/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"dev": "tsc -w",
|
|
9
|
+
"docs": "typedoc"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@buape/carbon-request": "workspace:*",
|
|
14
|
+
"discord-api-types": "0.37.98",
|
|
15
|
+
"discord-verify": "1.2.0",
|
|
16
|
+
"itty-router": "5.0.18"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { APIChannelSelectComponent, APIMentionableSelectComponent, APIRoleSelectComponent, APISelectMenuComponent, APIStringSelectComponent, APIUserSelectComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import type { AnySelectMenuInteraction } from "./AnySelectMenuInteraction.js";
|
|
3
|
+
import { BaseComponent } from "./BaseComponent.js";
|
|
4
|
+
export type AnySelectMenuComponentType = ComponentType.ChannelSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect | ComponentType.MentionableSelect;
|
|
5
|
+
export declare abstract class AnySelectMenu extends BaseComponent {
|
|
6
|
+
abstract type: AnySelectMenuComponentType;
|
|
7
|
+
abstract run(interaction: AnySelectMenuInteraction): Promise<void>;
|
|
8
|
+
minValues?: number;
|
|
9
|
+
maxValues?: number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
serialize: () => APISelectMenuComponent;
|
|
13
|
+
abstract serializeOptions(): {
|
|
14
|
+
type: ComponentType.ChannelSelect;
|
|
15
|
+
channel_types: APIChannelSelectComponent["channel_types"];
|
|
16
|
+
default_values: APIChannelSelectComponent["default_values"];
|
|
17
|
+
} | {
|
|
18
|
+
type: ComponentType.StringSelect;
|
|
19
|
+
options: APIStringSelectComponent["options"];
|
|
20
|
+
} | {
|
|
21
|
+
type: ComponentType.RoleSelect;
|
|
22
|
+
default_values: APIRoleSelectComponent["default_values"];
|
|
23
|
+
} | {
|
|
24
|
+
type: ComponentType.UserSelect;
|
|
25
|
+
default_values: APIUserSelectComponent["default_values"];
|
|
26
|
+
} | {
|
|
27
|
+
type: ComponentType.MentionableSelect;
|
|
28
|
+
default_values: APIMentionableSelectComponent["default_values"];
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=AnySelectMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnySelectMenu.d.ts","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,MAAM,0BAA0B,GACnC,aAAa,CAAC,aAAa,GAC3B,aAAa,CAAC,UAAU,GACxB,aAAa,CAAC,YAAY,GAC1B,aAAa,CAAC,UAAU,GACxB,aAAa,CAAC,iBAAiB,CAAA;AAElC,8BAAsB,aAAc,SAAQ,aAAa;IACxD,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAA;IACzC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAElE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,SAAS,QAAO,sBAAsB,CAUrC;IAED,QAAQ,CAAC,gBAAgB,IACtB;QACA,IAAI,EAAE,aAAa,CAAC,aAAa,CAAA;QACjC,aAAa,EAAE,yBAAyB,CAAC,eAAe,CAAC,CAAA;QACzD,cAAc,EAAE,yBAAyB,CAAC,gBAAgB,CAAC,CAAA;KAC1D,GACD;QACA,IAAI,EAAE,aAAa,CAAC,YAAY,CAAA;QAChC,OAAO,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAA;KAC3C,GACD;QACA,IAAI,EAAE,aAAa,CAAC,UAAU,CAAA;QAC9B,cAAc,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;KACvD,GACD;QACA,IAAI,EAAE,aAAa,CAAC,UAAU,CAAA;QAC9B,cAAc,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAA;KACvD,GACD;QACA,IAAI,EAAE,aAAa,CAAC,iBAAiB,CAAA;QACrC,cAAc,EAAE,6BAA6B,CAAC,gBAAgB,CAAC,CAAA;KAC9D;CACJ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseComponent } from "./BaseComponent.js";
|
|
2
|
+
export class AnySelectMenu extends BaseComponent {
|
|
3
|
+
minValues;
|
|
4
|
+
maxValues;
|
|
5
|
+
disabled;
|
|
6
|
+
placeholder;
|
|
7
|
+
serialize = () => {
|
|
8
|
+
const options = this.serializeOptions();
|
|
9
|
+
return {
|
|
10
|
+
...options,
|
|
11
|
+
custom_id: this.customId,
|
|
12
|
+
disabled: this.disabled,
|
|
13
|
+
placeholder: this.placeholder,
|
|
14
|
+
min_values: this.minValues,
|
|
15
|
+
max_values: this.maxValues
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=AnySelectMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnySelectMenu.js","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenu.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AASlD,MAAM,OAAgB,aAAc,SAAQ,aAAa;IAIxD,SAAS,CAAS;IAClB,SAAS,CAAS;IAClB,QAAQ,CAAU;IAClB,WAAW,CAAS;IAEpB,SAAS,GAAG,GAA2B,EAAE;QACxC,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAA;QACvC,OAAO;YACN,GAAG,OAAO;YACV,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,UAAU,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACF,CAAC,CAAA;CAwBD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type APIMessageComponentSelectMenuInteraction } from "discord-api-types/v10";
|
|
2
|
+
import type { Client } from "../classes/Client.js";
|
|
3
|
+
import { BaseComponentInteraction } from "./BaseComponentInteraction.js";
|
|
4
|
+
export declare abstract class AnySelectMenuInteraction extends BaseComponentInteraction {
|
|
5
|
+
customId: string;
|
|
6
|
+
constructor(client: Client, data: APIMessageComponentSelectMenuInteraction);
|
|
7
|
+
/**
|
|
8
|
+
* The raw IDs of the selected options (either role/string/channel IDs or the IDs you provided in your options)
|
|
9
|
+
*/
|
|
10
|
+
get values(): string[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AnySelectMenuInteraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnySelectMenuInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,wCAAwC,EAG7C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,8BAAsB,wBAAyB,SAAQ,wBAAwB;IAC9E,QAAQ,EAAE,MAAM,CAEZ;gBACQ,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,wCAAwC;IAS1E;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,EAAE,CAErB;CACD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InteractionType } from "discord-api-types/v10";
|
|
2
|
+
import { splitCustomId } from "../utils.js";
|
|
3
|
+
import { BaseComponentInteraction } from "./BaseComponentInteraction.js";
|
|
4
|
+
export class AnySelectMenuInteraction extends BaseComponentInteraction {
|
|
5
|
+
customId = splitCustomId(this.rawData.data.custom_id)[0];
|
|
6
|
+
constructor(client, data) {
|
|
7
|
+
super(client, data);
|
|
8
|
+
if (!data.data)
|
|
9
|
+
throw new Error("Invalid interaction data was used to create this class");
|
|
10
|
+
if (data.type !== InteractionType.MessageComponent) {
|
|
11
|
+
throw new Error("Invalid interaction type was used to create this class");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The raw IDs of the selected options (either role/string/channel IDs or the IDs you provided in your options)
|
|
16
|
+
*/
|
|
17
|
+
get values() {
|
|
18
|
+
return this.rawData.data.values;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=AnySelectMenuInteraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnySelectMenuInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/AnySelectMenuInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,eAAe,EACf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAExE,MAAM,OAAgB,wBAAyB,SAAQ,wBAAwB;IAC9E,QAAQ,GAAW,aAAa,CAC9B,IAAI,CAAC,OAAO,CAAC,IAA4C,CAAC,SAAS,CACpE,CAAC,CAAC,CAAC,CAAA;IACJ,YAAY,MAAc,EAAE,IAA8C;QACzE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,CAAC,IAAI,CAAC,IAAI;YACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,gBAAgB,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,CAAC;IACF,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACT,OAAQ,IAAI,CAAC,OAAO,CAAC,IAA4C,CAAC,MAAM,CAAA;IACzE,CAAC;CACD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../../../src/abstracts/Base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD;;;GAGG;AACH,qBAAa,IAAI;IAChB,MAAM,EAAE,MAAM,CAAA;gBACF,MAAM,EAAE,MAAM;CAG1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base.js","sourceRoot":"","sources":["../../../src/abstracts/Base.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,IAAI;IAChB,MAAM,CAAQ;IACd,YAAY,MAAc;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACrB,CAAC;CACD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type APIChannel, type ChannelType } from "discord-api-types/v10";
|
|
2
|
+
import type { Client } from "../classes/Client.js";
|
|
3
|
+
import { Base } from "./Base.js";
|
|
4
|
+
export declare abstract class BaseChannel<Type extends ChannelType> extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* The id of the channel.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the channel is a partial channel (meaning it does not have all the data).
|
|
11
|
+
* If this is true, you should use {@link BaseChannel.fetch} to get the full data of the channel.
|
|
12
|
+
*/
|
|
13
|
+
partial: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The type of the channel.
|
|
16
|
+
*/
|
|
17
|
+
type?: Type;
|
|
18
|
+
/**
|
|
19
|
+
* The flags of the channel in a bitfield.
|
|
20
|
+
* @see https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
|
21
|
+
*/
|
|
22
|
+
flags?: number | null;
|
|
23
|
+
/**
|
|
24
|
+
* The raw data of the channel.
|
|
25
|
+
*/
|
|
26
|
+
protected rawData: Extract<APIChannel, {
|
|
27
|
+
type: Type;
|
|
28
|
+
}> | null;
|
|
29
|
+
constructor(client: Client, rawDataOrId: Extract<APIChannel, {
|
|
30
|
+
type: Type;
|
|
31
|
+
}> | string);
|
|
32
|
+
protected setData(data: Extract<APIChannel, {
|
|
33
|
+
type: Type;
|
|
34
|
+
}>): void;
|
|
35
|
+
protected abstract setSpecificData(data: Extract<APIChannel, {
|
|
36
|
+
type: Type;
|
|
37
|
+
}>): void;
|
|
38
|
+
/**
|
|
39
|
+
* Fetches the channel from the API.
|
|
40
|
+
* @returns The channel data.
|
|
41
|
+
*/
|
|
42
|
+
fetch(): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=BaseChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseChannel.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,UAAU,EACf,KAAK,WAAW,EAEhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,8BAAsB,WAAW,CAAC,IAAI,SAAS,WAAW,CAAE,SAAQ,IAAI;IACvE;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IACX;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI,CAAO;gBAGnE,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,OAAO,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,GAAG,MAAM;IAc1D,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC;IAQ3D,SAAS,CAAC,QAAQ,CAAC,eAAe,CACjC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,GACvC,IAAI;IAEP;;;OAGG;IACG,KAAK;CAQX"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { Base } from "./Base.js";
|
|
3
|
+
export class BaseChannel extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* The id of the channel.
|
|
6
|
+
*/
|
|
7
|
+
id;
|
|
8
|
+
/**
|
|
9
|
+
* Whether the channel is a partial channel (meaning it does not have all the data).
|
|
10
|
+
* If this is true, you should use {@link BaseChannel.fetch} to get the full data of the channel.
|
|
11
|
+
*/
|
|
12
|
+
partial;
|
|
13
|
+
/**
|
|
14
|
+
* The type of the channel.
|
|
15
|
+
*/
|
|
16
|
+
type;
|
|
17
|
+
/**
|
|
18
|
+
* The flags of the channel in a bitfield.
|
|
19
|
+
* @see https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
|
20
|
+
*/
|
|
21
|
+
flags;
|
|
22
|
+
/**
|
|
23
|
+
* The raw data of the channel.
|
|
24
|
+
*/
|
|
25
|
+
rawData = null;
|
|
26
|
+
constructor(client, rawDataOrId) {
|
|
27
|
+
super(client);
|
|
28
|
+
if (typeof rawDataOrId === "string") {
|
|
29
|
+
this.id = rawDataOrId;
|
|
30
|
+
this.partial = true;
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this.rawData = rawDataOrId;
|
|
34
|
+
this.id = rawDataOrId.id;
|
|
35
|
+
this.partial = false;
|
|
36
|
+
this.setData(rawDataOrId);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
setData(data) {
|
|
40
|
+
if (!data)
|
|
41
|
+
throw new Error("Cannot set data without having data... smh");
|
|
42
|
+
this.rawData = data;
|
|
43
|
+
this.type = data.type;
|
|
44
|
+
this.partial = false;
|
|
45
|
+
this.setSpecificData(data);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Fetches the channel from the API.
|
|
49
|
+
* @returns The channel data.
|
|
50
|
+
*/
|
|
51
|
+
async fetch() {
|
|
52
|
+
const newData = (await this.client.rest.get(Routes.channel(this.id)));
|
|
53
|
+
if (!newData)
|
|
54
|
+
throw new Error(`Channel ${this.id} not found`);
|
|
55
|
+
this.setData(newData);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=BaseChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseChannel.js","sourceRoot":"","sources":["../../../src/abstracts/BaseChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,OAAgB,WAAsC,SAAQ,IAAI;IACvE;;OAEG;IACH,EAAE,CAAQ;IACV;;;OAGG;IACH,OAAO,CAAS;IAChB;;OAEG;IACH,IAAI,CAAO;IACX;;;OAGG;IACH,KAAK,CAAgB;IACrB;;OAEG;IACO,OAAO,GAA+C,IAAI,CAAA;IAEpE,YACC,MAAc,EACd,WAAyD;QAEzD,KAAK,CAAC,MAAM,CAAC,CAAA;QACb,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;YACrC,IAAI,CAAC,EAAE,GAAG,WAAW,CAAA;YACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACpB,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;YAC1B,IAAI,CAAC,EAAE,GAAG,WAAW,CAAC,EAAE,CAAA;YACxB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;YACpB,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAC1B,CAAC;IACF,CAAC;IAES,OAAO,CAAC,IAAyC;QAC1D,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;QACxE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;QACrB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;QACpB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAMD;;;OAGG;IACH,KAAK,CAAC,KAAK;QACV,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAC1C,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CACvB,CAAwC,CAAA;QACzC,IAAI,CAAC,OAAO;YAAE,MAAM,IAAI,KAAK,CAAC,WAAW,IAAI,CAAC,EAAE,YAAY,CAAC,CAAA;QAE7D,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACtB,CAAC;CACD"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ApplicationCommandType, type RESTPostAPIApplicationCommandsJSONBody } from "discord-api-types/v10";
|
|
2
|
+
import { ApplicationIntegrationType, InteractionContextType } from "../index.js";
|
|
3
|
+
import type { BaseComponent } from "./BaseComponent.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents the base data of a command that the user creates
|
|
6
|
+
*/
|
|
7
|
+
export declare abstract class BaseCommand {
|
|
8
|
+
/**
|
|
9
|
+
* The name of the command (e.g. "ping" for /ping)
|
|
10
|
+
*/
|
|
11
|
+
abstract name: string;
|
|
12
|
+
/**
|
|
13
|
+
* A description of the command
|
|
14
|
+
*/
|
|
15
|
+
abstract description: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the command response should be automatically deferred
|
|
18
|
+
*/
|
|
19
|
+
defer: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Whether the command response should be ephemeral
|
|
22
|
+
*/
|
|
23
|
+
ephemeral: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The type of the command
|
|
26
|
+
*/
|
|
27
|
+
abstract type: ApplicationCommandType;
|
|
28
|
+
/**
|
|
29
|
+
* The places this command can be used in
|
|
30
|
+
* @beta API types are not finalized
|
|
31
|
+
*/
|
|
32
|
+
integrationTypes: ApplicationIntegrationType[];
|
|
33
|
+
/**
|
|
34
|
+
* The contexts this command can be used in
|
|
35
|
+
* @beta API types are not finalized
|
|
36
|
+
*/
|
|
37
|
+
contexts: InteractionContextType[];
|
|
38
|
+
/**
|
|
39
|
+
* All the components that the command is able to use.
|
|
40
|
+
* You mount these here so the handler can access them
|
|
41
|
+
*/
|
|
42
|
+
components?: BaseComponent[];
|
|
43
|
+
/**
|
|
44
|
+
* All the paginators that the command is able to use.
|
|
45
|
+
* You mount these here so the handler can access them
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Serializes the command into a JSON object that can be sent to Discord
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
serialize(): import("discord-api-types/v10").RESTPostAPIChatInputApplicationCommandsJSONBody | import("discord-api-types/v10").RESTPostAPIContextMenuApplicationCommandsJSONBody;
|
|
52
|
+
/**
|
|
53
|
+
* Serializes the options of the command into a JSON object that can be sent to Discord
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
abstract serializeOptions(): RESTPostAPIApplicationCommandsJSONBody["options"];
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=BaseCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseCommand.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EACtB,KAAK,sCAAsC,EAC3C,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvD;;GAEG;AACH,8BAAsB,WAAW;IAChC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;OAEG;IACH,KAAK,UAAQ;IACb;;OAEG;IACH,SAAS,UAAQ;IACjB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;IACrC;;;OAGG;IACH,gBAAgB,EAAE,0BAA0B,EAAE,CAG7C;IACD;;;OAGG;IACH,QAAQ,EAAE,sBAAsB,EAAE,CAIjC;IAED;;;OAGG;IACH,UAAU,CAAC,EAAE,aAAa,EAAE,CAAK;IACjC;;;OAGG;IAGH;;;OAGG;IACH,SAAS;IAyBT;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,IAAI,sCAAsC,CAAC,SAAS,CAAC;CAC9E"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ApplicationCommandType } from "discord-api-types/v10";
|
|
2
|
+
import { ApplicationIntegrationType, InteractionContextType } from "../index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents the base data of a command that the user creates
|
|
5
|
+
*/
|
|
6
|
+
export class BaseCommand {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the command response should be automatically deferred
|
|
9
|
+
*/
|
|
10
|
+
defer = false;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the command response should be ephemeral
|
|
13
|
+
*/
|
|
14
|
+
ephemeral = false;
|
|
15
|
+
/**
|
|
16
|
+
* The places this command can be used in
|
|
17
|
+
* @beta API types are not finalized
|
|
18
|
+
*/
|
|
19
|
+
integrationTypes = [
|
|
20
|
+
ApplicationIntegrationType.GuildInstall,
|
|
21
|
+
ApplicationIntegrationType.UserInstall
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* The contexts this command can be used in
|
|
25
|
+
* @beta API types are not finalized
|
|
26
|
+
*/
|
|
27
|
+
contexts = [
|
|
28
|
+
InteractionContextType.Guild,
|
|
29
|
+
InteractionContextType.BotDM,
|
|
30
|
+
InteractionContextType.PrivateChannel
|
|
31
|
+
];
|
|
32
|
+
/**
|
|
33
|
+
* All the components that the command is able to use.
|
|
34
|
+
* You mount these here so the handler can access them
|
|
35
|
+
*/
|
|
36
|
+
components = [];
|
|
37
|
+
/**
|
|
38
|
+
* All the paginators that the command is able to use.
|
|
39
|
+
* You mount these here so the handler can access them
|
|
40
|
+
*/
|
|
41
|
+
// paginators?: Paginator[] = []
|
|
42
|
+
/**
|
|
43
|
+
* Serializes the command into a JSON object that can be sent to Discord
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
serialize() {
|
|
47
|
+
// Only chat input commands can have descriptions
|
|
48
|
+
if (this.type === ApplicationCommandType.ChatInput) {
|
|
49
|
+
const data = {
|
|
50
|
+
name: this.name,
|
|
51
|
+
type: this.type,
|
|
52
|
+
description: this.description,
|
|
53
|
+
options: this.serializeOptions(),
|
|
54
|
+
integration_types: this.integrationTypes,
|
|
55
|
+
contexts: this.contexts
|
|
56
|
+
};
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
const data = {
|
|
60
|
+
name: this.name,
|
|
61
|
+
type: this.type,
|
|
62
|
+
options: this.serializeOptions(),
|
|
63
|
+
integration_types: this.integrationTypes,
|
|
64
|
+
contexts: this.contexts
|
|
65
|
+
};
|
|
66
|
+
return data;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=BaseCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseCommand.js","sourceRoot":"","sources":["../../../src/abstracts/BaseCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,sBAAsB,EAEtB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAGhF;;GAEG;AACH,MAAM,OAAgB,WAAW;IAShC;;OAEG;IACH,KAAK,GAAG,KAAK,CAAA;IACb;;OAEG;IACH,SAAS,GAAG,KAAK,CAAA;IAKjB;;;OAGG;IACH,gBAAgB,GAAiC;QAChD,0BAA0B,CAAC,YAAY;QACvC,0BAA0B,CAAC,WAAW;KACtC,CAAA;IACD;;;OAGG;IACH,QAAQ,GAA6B;QACpC,sBAAsB,CAAC,KAAK;QAC5B,sBAAsB,CAAC,KAAK;QAC5B,sBAAsB,CAAC,cAAc;KACrC,CAAA;IAED;;;OAGG;IACH,UAAU,GAAqB,EAAE,CAAA;IACjC;;;OAGG;IACH,gCAAgC;IAEhC;;;OAGG;IACH,SAAS;QACR,iDAAiD;QACjD,IAAI,IAAI,CAAC,IAAI,KAAK,sBAAsB,CAAC,SAAS,EAAE,CAAC;YACpD,MAAM,IAAI,GAA2C;gBACpD,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE;gBAChC,iBAAiB,EAAE,IAAI,CAAC,gBAAgB;gBACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACvB,CAAA;YAED,OAAO,IAAI,CAAA;QACZ,CAAC;QACD,MAAM,IAAI,GAA2C;YACpD,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE;YAChC,iBAAiB,EAAE,IAAI,CAAC,gBAAgB;YACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAA;QAED,OAAO,IAAI,CAAA;IACZ,CAAC;CAOD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { APIBaseComponent, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
export type ComponentAdditionalData = {
|
|
3
|
+
[key: string]: string | number | boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare abstract class BaseComponent {
|
|
6
|
+
constructor(data?: {
|
|
7
|
+
additionalData?: ComponentAdditionalData;
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Whether the component response should be automatically deferred
|
|
11
|
+
*/
|
|
12
|
+
defer: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the component response should be ephemeral
|
|
15
|
+
*/
|
|
16
|
+
ephemeral: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The type of the component
|
|
19
|
+
*/
|
|
20
|
+
abstract type: ComponentType;
|
|
21
|
+
/**
|
|
22
|
+
* The custom ID of the component
|
|
23
|
+
*/
|
|
24
|
+
abstract customId: string;
|
|
25
|
+
additionalData: ComponentAdditionalData | null;
|
|
26
|
+
/**
|
|
27
|
+
* Create a custom ID to use for this component that embeds additional data that you want to be handed
|
|
28
|
+
* @param additionalData The additional data that you want to be passed in this component's custom ID
|
|
29
|
+
* @returns The custom ID to use
|
|
30
|
+
*/
|
|
31
|
+
createId: (additionalData: typeof this.additionalData) => string;
|
|
32
|
+
abstract serialize: () => APIBaseComponent<typeof this.type>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=BaseComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseComponent.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE5E,MAAM,MAAM,uBAAuB,GAAG;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAA;CACxC,CAAA;AAED,8BAAsB,aAAa;gBACtB,IAAI,CAAC,EAAE;QAClB,cAAc,CAAC,EAAE,uBAAuB,CAAA;KACxC;IAID;;OAEG;IACH,KAAK,UAAQ;IACb;;OAEG;IACH,SAAS,UAAQ;IAEjB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IAEzB,cAAc,EAAE,uBAAuB,GAAG,IAAI,CAAO;IAErD;;;;OAIG;IACI,QAAQ,mBAAoB,OAAO,IAAI,CAAC,cAAc,YAO5D;IAED,QAAQ,CAAC,SAAS,EAAE,MAAM,gBAAgB,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAA;CAC5D"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class BaseComponent {
|
|
2
|
+
constructor(data) {
|
|
3
|
+
if (data?.additionalData)
|
|
4
|
+
this.additionalData = data.additionalData;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Whether the component response should be automatically deferred
|
|
8
|
+
*/
|
|
9
|
+
defer = false;
|
|
10
|
+
/**
|
|
11
|
+
* Whether the component response should be ephemeral
|
|
12
|
+
*/
|
|
13
|
+
ephemeral = false;
|
|
14
|
+
additionalData = null;
|
|
15
|
+
/**
|
|
16
|
+
* Create a custom ID to use for this component that embeds additional data that you want to be handed
|
|
17
|
+
* @param additionalData The additional data that you want to be passed in this component's custom ID
|
|
18
|
+
* @returns The custom ID to use
|
|
19
|
+
*/
|
|
20
|
+
createId = (additionalData) => {
|
|
21
|
+
if (!additionalData)
|
|
22
|
+
return this.customId;
|
|
23
|
+
// id:arg1=1;arg2=2
|
|
24
|
+
const id = `${this.customId}:${Object.entries(additionalData)
|
|
25
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
26
|
+
.join(";")}`;
|
|
27
|
+
return id;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=BaseComponent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseComponent.js","sourceRoot":"","sources":["../../../src/abstracts/BaseComponent.ts"],"names":[],"mappings":"AAMA,MAAM,OAAgB,aAAa;IAClC,YAAY,IAEX;QACA,IAAI,IAAI,EAAE,cAAc;YAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAA;IACpE,CAAC;IAED;;OAEG;IACH,KAAK,GAAG,KAAK,CAAA;IACb;;OAEG;IACH,SAAS,GAAG,KAAK,CAAA;IAWjB,cAAc,GAAmC,IAAI,CAAA;IAErD;;;;OAIG;IACI,QAAQ,GAAG,CAAC,cAA0C,EAAE,EAAE;QAChE,IAAI,CAAC,cAAc;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAA;QACzC,mBAAmB;QACnB,MAAM,EAAE,GAAG,GAAG,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC;aAC3D,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;aACxC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAA;QACb,OAAO,EAAE,CAAA;IACV,CAAC,CAAA;CAGD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { APIMessageComponentInteraction, ComponentType } from "discord-api-types/v10";
|
|
2
|
+
import type { Client } from "../classes/Client.js";
|
|
3
|
+
import { BaseInteraction } from "./BaseInteraction.js";
|
|
4
|
+
export declare class BaseComponentInteraction extends BaseInteraction<APIMessageComponentInteraction> {
|
|
5
|
+
customId: string;
|
|
6
|
+
componentType: ComponentType;
|
|
7
|
+
constructor(client: Client, data: APIMessageComponentInteraction);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=BaseComponentInteraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseComponentInteraction.d.ts","sourceRoot":"","sources":["../../../src/abstracts/BaseComponentInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,8BAA8B,EAC9B,aAAa,EACb,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,qBAAa,wBAAyB,SAAQ,eAAe,CAAC,8BAA8B,CAAC;IAC5F,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,aAAa,CAAA;gBAChB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B;CAOhE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { splitCustomId } from "../utils.js";
|
|
2
|
+
import { BaseInteraction } from "./BaseInteraction.js";
|
|
3
|
+
export class BaseComponentInteraction extends BaseInteraction {
|
|
4
|
+
customId;
|
|
5
|
+
componentType;
|
|
6
|
+
constructor(client, data) {
|
|
7
|
+
super(client, data);
|
|
8
|
+
if (!data.data)
|
|
9
|
+
throw new Error("Invalid interaction data was used to create this class");
|
|
10
|
+
this.customId = splitCustomId(data.data.custom_id)[0];
|
|
11
|
+
this.componentType = data.data.component_type;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=BaseComponentInteraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseComponentInteraction.js","sourceRoot":"","sources":["../../../src/abstracts/BaseComponentInteraction.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,MAAM,OAAO,wBAAyB,SAAQ,eAA+C;IAC5F,QAAQ,CAAQ;IAChB,aAAa,CAAe;IAC5B,YAAY,MAAc,EAAE,IAAoC;QAC/D,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,CAAC,IAAI,CAAC,IAAI;YACb,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;QACrD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAA;IAC9C,CAAC;CACD"}
|