@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,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type APIChannel,
|
|
3
|
+
type APIGuildChannel,
|
|
4
|
+
type APIMessage,
|
|
5
|
+
type GuildChannelType,
|
|
6
|
+
type RESTGetAPIGuildInvitesResult,
|
|
7
|
+
type RESTPostAPIChannelInviteJSONBody,
|
|
8
|
+
type RESTPostAPIChannelInviteResult,
|
|
9
|
+
Routes
|
|
10
|
+
} from "discord-api-types/v10"
|
|
11
|
+
import { Guild } from "../structures/Guild.js"
|
|
12
|
+
import type { GuildCategoryChannel } from "../structures/GuildCategoryChannel.js"
|
|
13
|
+
import { BaseChannel } from "./BaseChannel.js"
|
|
14
|
+
|
|
15
|
+
export abstract class BaseGuildChannel<
|
|
16
|
+
Type extends GuildChannelType
|
|
17
|
+
> extends BaseChannel<Type> {
|
|
18
|
+
/**
|
|
19
|
+
* The name of the channel.
|
|
20
|
+
*/
|
|
21
|
+
name?: string
|
|
22
|
+
/**
|
|
23
|
+
* The ID of the guild this channel is in
|
|
24
|
+
*/
|
|
25
|
+
guildId?: string
|
|
26
|
+
/**
|
|
27
|
+
* The position of the channel in the channel list.
|
|
28
|
+
*/
|
|
29
|
+
position?: number
|
|
30
|
+
/**
|
|
31
|
+
* The ID of the parent category for the channel.
|
|
32
|
+
*/
|
|
33
|
+
parentId?: string | null
|
|
34
|
+
/**
|
|
35
|
+
* Whether the channel is marked as nsfw.
|
|
36
|
+
*/
|
|
37
|
+
nsfw?: boolean
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The guild this channel is in
|
|
41
|
+
*/
|
|
42
|
+
get guild() {
|
|
43
|
+
if (!this.guildId) throw new Error("Cannot get guild without guild ID")
|
|
44
|
+
return new Guild(this.client, this.guildId)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
protected override setData(data: APIGuildChannel<Type>): void {
|
|
48
|
+
this.rawData = data as Extract<APIChannel, { type: Type }> | null
|
|
49
|
+
this.partial = false
|
|
50
|
+
this.name = data.name
|
|
51
|
+
this.guildId = data.guild_id
|
|
52
|
+
this.position = data.position
|
|
53
|
+
this.parentId = data.parent_id
|
|
54
|
+
this.nsfw = data.nsfw
|
|
55
|
+
this.setSpecificData(data as Extract<APIChannel, { type: Type }>)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Set the name of the channel
|
|
60
|
+
* @param name The new name of the channel
|
|
61
|
+
*/
|
|
62
|
+
async setName(name: string) {
|
|
63
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
64
|
+
body: {
|
|
65
|
+
name
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
this.name = name
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Set the position of the channel
|
|
73
|
+
* @param position The new position of the channel
|
|
74
|
+
*/
|
|
75
|
+
async setPosition(position: number) {
|
|
76
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
77
|
+
body: {
|
|
78
|
+
position
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
this.position = position
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Set the parent ID of the channel
|
|
86
|
+
* @param parent The new category channel or ID to set
|
|
87
|
+
*/
|
|
88
|
+
async setParent(parent: GuildCategoryChannel | string) {
|
|
89
|
+
if (typeof parent === "string") {
|
|
90
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
91
|
+
body: {
|
|
92
|
+
parent_id: parent
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
this.parentId = parent
|
|
96
|
+
} else {
|
|
97
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
98
|
+
body: {
|
|
99
|
+
parent_id: parent.id
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
this.parentId = parent.id
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Set whether the channel is nsfw
|
|
108
|
+
* @param nsfw The new nsfw status of the channel
|
|
109
|
+
*/
|
|
110
|
+
async setNsfw(nsfw: boolean) {
|
|
111
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
112
|
+
body: {
|
|
113
|
+
nsfw
|
|
114
|
+
}
|
|
115
|
+
})
|
|
116
|
+
this.nsfw = nsfw
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Send a message to the channel
|
|
121
|
+
*/
|
|
122
|
+
async send(message: APIMessage) {
|
|
123
|
+
this.client.rest.post(Routes.channelMessages(this.id), {
|
|
124
|
+
body: { ...message }
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Get the invites for the channel
|
|
130
|
+
*/
|
|
131
|
+
async getInvites() {
|
|
132
|
+
return (await this.client.rest.get(
|
|
133
|
+
Routes.channelInvites(this.id)
|
|
134
|
+
)) as RESTGetAPIGuildInvitesResult
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Create an invite for the channel
|
|
139
|
+
*/
|
|
140
|
+
async createInvite(options?: RESTPostAPIChannelInviteJSONBody) {
|
|
141
|
+
return (await this.client.rest.post(Routes.channelInvites(this.id), {
|
|
142
|
+
body: { ...options }
|
|
143
|
+
})) as RESTPostAPIChannelInviteResult
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Trigger a typing indicator in the channel (this will expire after 10 seconds)
|
|
148
|
+
*/
|
|
149
|
+
async triggerTyping() {
|
|
150
|
+
await this.client.rest.post(Routes.channelTyping(this.id))
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type APIGuildTextChannel,
|
|
3
|
+
type APIThreadChannel,
|
|
4
|
+
type GuildTextChannelType,
|
|
5
|
+
type RESTGetAPIChannelPinsResult,
|
|
6
|
+
type RESTPostAPIChannelThreadsJSONBody,
|
|
7
|
+
Routes
|
|
8
|
+
} from "discord-api-types/v10"
|
|
9
|
+
import { GuildThreadChannel } from "../structures/GuildThreadChannel.js"
|
|
10
|
+
import { Message } from "../structures/Message.js"
|
|
11
|
+
import { BaseGuildChannel } from "./BaseGuildChannel.js"
|
|
12
|
+
|
|
13
|
+
export abstract class BaseGuildTextChannel<
|
|
14
|
+
Type extends GuildTextChannelType
|
|
15
|
+
> extends BaseGuildChannel<Type> {
|
|
16
|
+
/**
|
|
17
|
+
* The ID of the last message sent in the channel.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
|
|
21
|
+
*/
|
|
22
|
+
lastMessageId?: string | null
|
|
23
|
+
/**
|
|
24
|
+
* The timestamp of the last pin in the channel.
|
|
25
|
+
*/
|
|
26
|
+
lastPinTimestamp?: string | null
|
|
27
|
+
/**
|
|
28
|
+
* The rate limit per user for the channel, in seconds.
|
|
29
|
+
*/
|
|
30
|
+
rateLimitPerUser?: number | null
|
|
31
|
+
|
|
32
|
+
protected setSpecificData(data: APIGuildTextChannel<Type>): void {
|
|
33
|
+
this.lastMessageId = data.last_message_id
|
|
34
|
+
this.lastPinTimestamp = data.last_pin_timestamp
|
|
35
|
+
this.rateLimitPerUser = data.rate_limit_per_user
|
|
36
|
+
this.setMoreSpecificData(data)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
protected abstract setMoreSpecificData(data: APIGuildTextChannel<Type>): void
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The last message sent in the channel.
|
|
43
|
+
*
|
|
44
|
+
* @remarks
|
|
45
|
+
* This might not always resolve to a message. The ID still stays a part of the channel's data, even if the message is deleted.
|
|
46
|
+
* This will always return a partial message, so you can use {@link Message.fetch} to get the full message data.
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
get lastMessage() {
|
|
50
|
+
if (!this.lastMessageId) return null
|
|
51
|
+
return new Message(this.client, {
|
|
52
|
+
id: this.lastMessageId,
|
|
53
|
+
channel_id: this.id
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get the pinned messages in the channel
|
|
59
|
+
*/
|
|
60
|
+
async getPinnedMessages() {
|
|
61
|
+
const msgs = (await this.client.rest.get(
|
|
62
|
+
Routes.channelPins(this.id)
|
|
63
|
+
)) as RESTGetAPIChannelPinsResult
|
|
64
|
+
return msgs.map((x) => new Message(this.client, x))
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Start a thread without an associated start message.
|
|
69
|
+
* If you want to start a thread with a start message, use {@link Message.startThread}
|
|
70
|
+
*/
|
|
71
|
+
async startThread(data: RESTPostAPIChannelThreadsJSONBody) {
|
|
72
|
+
const thread = (await this.client.rest.post(Routes.threads(this.id), {
|
|
73
|
+
body: { ...data }
|
|
74
|
+
})) as APIThreadChannel
|
|
75
|
+
return new GuildThreadChannel(this.client, thread)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type APIChannel,
|
|
3
|
+
type APIInteraction,
|
|
4
|
+
InteractionResponseType,
|
|
5
|
+
type InteractionType,
|
|
6
|
+
Routes
|
|
7
|
+
} from "discord-api-types/v10"
|
|
8
|
+
import type { Client } from "../classes/Client.js"
|
|
9
|
+
import type { Row } from "../classes/Row.js"
|
|
10
|
+
import { channelFactory } from "../factories/channelFactory.js"
|
|
11
|
+
import { Guild } from "../structures/Guild.js"
|
|
12
|
+
import { Message } from "../structures/Message.js"
|
|
13
|
+
import { User } from "../structures/User.js"
|
|
14
|
+
import { Base } from "./Base.js"
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The data to reply to an interaction
|
|
18
|
+
*/
|
|
19
|
+
export type InteractionReplyData = {
|
|
20
|
+
/**
|
|
21
|
+
* The content of the message
|
|
22
|
+
*/
|
|
23
|
+
content?: string
|
|
24
|
+
/**
|
|
25
|
+
* The components to send in the message, listed in rows
|
|
26
|
+
*/
|
|
27
|
+
components?: Row[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Additional options for replying to an interaction
|
|
32
|
+
*/
|
|
33
|
+
export type InteractionReplyOptions = {
|
|
34
|
+
/**
|
|
35
|
+
* The files to send in the interaction
|
|
36
|
+
*/
|
|
37
|
+
files?: InteractionFileData[]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The data for a file to send in an interaction
|
|
42
|
+
*/
|
|
43
|
+
export type InteractionFileData = {
|
|
44
|
+
/**
|
|
45
|
+
* The name of the file that will be given to Discord
|
|
46
|
+
*/
|
|
47
|
+
name: string
|
|
48
|
+
/**
|
|
49
|
+
* The data of the file in a Blob
|
|
50
|
+
*/
|
|
51
|
+
data: Blob
|
|
52
|
+
/**
|
|
53
|
+
* The alt text of the file, shown for accessibility
|
|
54
|
+
* @alpha This isn't implemented yet
|
|
55
|
+
*/
|
|
56
|
+
description?: string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* This is the base type interaction, all interaction types extend from this
|
|
61
|
+
*/
|
|
62
|
+
export abstract class BaseInteraction<T extends APIInteraction> extends Base {
|
|
63
|
+
/**
|
|
64
|
+
* The type of interaction
|
|
65
|
+
*/
|
|
66
|
+
type: InteractionType
|
|
67
|
+
/**
|
|
68
|
+
* The raw data of the interaction
|
|
69
|
+
*/
|
|
70
|
+
rawData: T
|
|
71
|
+
/**
|
|
72
|
+
* The user who sent the interaction
|
|
73
|
+
*/
|
|
74
|
+
userId: string | undefined
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether the interaction is deferred already
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
_deferred = false
|
|
81
|
+
|
|
82
|
+
constructor(client: Client, data: T) {
|
|
83
|
+
super(client)
|
|
84
|
+
this.rawData = data
|
|
85
|
+
this.type = data.type
|
|
86
|
+
this.userId =
|
|
87
|
+
this.rawData.user?.id || this.rawData.member?.user.id || undefined
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
get message(): Message | null {
|
|
91
|
+
if (!this.rawData.message) return null
|
|
92
|
+
return new Message(this.client, this.rawData.message)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get guild(): Guild | null {
|
|
96
|
+
if (!this.rawData.guild_id) return null
|
|
97
|
+
return new Guild(this.client, this.rawData.guild_id)
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
get user(): User | null {
|
|
101
|
+
if (this.rawData.user) return new User(this.client, this.rawData.user)
|
|
102
|
+
if (this.rawData.member)
|
|
103
|
+
return new User(this.client, this.rawData.member.user)
|
|
104
|
+
return null
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
get channel() {
|
|
108
|
+
if (!this.rawData.channel) return null
|
|
109
|
+
return channelFactory(this.client, this.rawData.channel as APIChannel)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Reply to an interaction.
|
|
114
|
+
* If the interaction is deferred, this will edit the original response.
|
|
115
|
+
* @param data The response data
|
|
116
|
+
*/
|
|
117
|
+
async reply(
|
|
118
|
+
data: InteractionReplyData,
|
|
119
|
+
options: InteractionReplyOptions = {}
|
|
120
|
+
) {
|
|
121
|
+
if (this._deferred) {
|
|
122
|
+
await this.client.rest.patch(
|
|
123
|
+
Routes.webhookMessage(
|
|
124
|
+
this.client.options.clientId,
|
|
125
|
+
this.rawData.token,
|
|
126
|
+
"@original"
|
|
127
|
+
),
|
|
128
|
+
{
|
|
129
|
+
body: {
|
|
130
|
+
...data,
|
|
131
|
+
components: data.components?.map((row) => row.serialize())
|
|
132
|
+
},
|
|
133
|
+
files: options.files
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
} else {
|
|
137
|
+
await this.client.rest.post(
|
|
138
|
+
Routes.interactionCallback(this.rawData.id, this.rawData.token),
|
|
139
|
+
{
|
|
140
|
+
body: {
|
|
141
|
+
type: InteractionResponseType.ChannelMessageWithSource,
|
|
142
|
+
data: {
|
|
143
|
+
...data,
|
|
144
|
+
components: data.components?.map((row) => row.serialize())
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
files: options.files
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Defer the interaction response. This is used automatically by commands that are set to defer.
|
|
155
|
+
* If the interaction is already deferred, this will do nothing.
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
async defer() {
|
|
159
|
+
if (this._deferred) return
|
|
160
|
+
this._deferred = true
|
|
161
|
+
await this.client.rest.post(
|
|
162
|
+
Routes.interactionCallback(this.rawData.id, this.rawData.token),
|
|
163
|
+
{
|
|
164
|
+
body: {
|
|
165
|
+
type: InteractionResponseType.DeferredChannelMessageWithSource
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
APIGuildForumDefaultReactionEmoji,
|
|
3
|
+
APIGuildForumTag,
|
|
4
|
+
APIMessage,
|
|
5
|
+
APIThreadOnlyChannel,
|
|
6
|
+
ChannelType,
|
|
7
|
+
SortOrderType
|
|
8
|
+
} from "discord-api-types/v10"
|
|
9
|
+
import { GuildThreadChannel } from "../structures/GuildThreadChannel.js"
|
|
10
|
+
import { BaseGuildChannel } from "./BaseGuildChannel.js"
|
|
11
|
+
|
|
12
|
+
export abstract class GuildThreadOnlyChannel<
|
|
13
|
+
Type extends ChannelType.GuildForum | ChannelType.GuildMedia
|
|
14
|
+
> extends BaseGuildChannel<Type> {
|
|
15
|
+
/**
|
|
16
|
+
* The topic of the channel.
|
|
17
|
+
*/
|
|
18
|
+
topic?: string | null
|
|
19
|
+
/**
|
|
20
|
+
* The default auto archive duration of the channel.
|
|
21
|
+
*/
|
|
22
|
+
defaultAutoArchiveDuration?: number | null
|
|
23
|
+
/**
|
|
24
|
+
* The available tags to set on posts in the channel.
|
|
25
|
+
*/
|
|
26
|
+
availableTags?: APIGuildForumTag[]
|
|
27
|
+
/**
|
|
28
|
+
* The default thread rate limit per user for the channel.
|
|
29
|
+
*/
|
|
30
|
+
defaultThreadRateLimitPerUser?: number | null
|
|
31
|
+
/**
|
|
32
|
+
* The default reaction emoji for the channel.
|
|
33
|
+
*/
|
|
34
|
+
defaultReactionEmoji?: APIGuildForumDefaultReactionEmoji | null
|
|
35
|
+
/**
|
|
36
|
+
* The default sort order for the channel, by latest activity or by creation date.
|
|
37
|
+
*/
|
|
38
|
+
defaultSortOrder?: SortOrderType | null
|
|
39
|
+
|
|
40
|
+
protected setSpecificData(data: APIThreadOnlyChannel<Type>): void {
|
|
41
|
+
this.topic = data.topic
|
|
42
|
+
this.defaultAutoArchiveDuration = data.default_auto_archive_duration
|
|
43
|
+
this.availableTags = data.available_tags
|
|
44
|
+
this.defaultThreadRateLimitPerUser = data.default_thread_rate_limit_per_user
|
|
45
|
+
this.defaultReactionEmoji = data.default_reaction_emoji
|
|
46
|
+
this.defaultSortOrder = data.default_sort_order
|
|
47
|
+
this.setMoreSpecificData(data)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected abstract setMoreSpecificData(data: APIThreadOnlyChannel<Type>): void
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* You cannot send a message directly to a forum or media channel, so this method throws an error.
|
|
54
|
+
* Use {@link GuildThreadChannel.send} instead, or the alias {@link GuildThreadOnlyChannel.sendToPost} instead, to send a message to the channel's posts.
|
|
55
|
+
*/
|
|
56
|
+
override async send(): Promise<void> {
|
|
57
|
+
throw new Error(
|
|
58
|
+
"You cannot send a message directly to a forum or media channel. Use GuildThreadChannel.send instead, or the alias GuildThreadOnlyChannel.sendToPost instead, to send a message to the channel's posts."
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Send a message to a post in the channel
|
|
64
|
+
* @remarks
|
|
65
|
+
* This is an alias for {@link GuildThreadChannel.send} that will fetch the channel, but if you already have the channel, you can use {@link GuildThreadChannel.send} instead.
|
|
66
|
+
*/
|
|
67
|
+
async sendToPost(message: APIMessage, postId: string): Promise<void> {
|
|
68
|
+
const channel = new GuildThreadChannel(this.client, postId)
|
|
69
|
+
await channel.send(message)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type APIButtonComponent,
|
|
3
|
+
type APIButtonComponentWithSKUId,
|
|
4
|
+
type APIButtonComponentWithURL,
|
|
5
|
+
ButtonStyle,
|
|
6
|
+
ComponentType
|
|
7
|
+
} from "discord-api-types/v10"
|
|
8
|
+
import { BaseComponent } from "../abstracts/BaseComponent.js"
|
|
9
|
+
import type { ButtonInteraction } from "../internals/ButtonInteraction.js"
|
|
10
|
+
|
|
11
|
+
abstract class BaseButton extends BaseComponent {
|
|
12
|
+
type = ComponentType.Button
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The label of the button
|
|
16
|
+
*/
|
|
17
|
+
abstract label: string
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The emoji of the button
|
|
21
|
+
*/
|
|
22
|
+
emoji?: {
|
|
23
|
+
name: string
|
|
24
|
+
id?: string
|
|
25
|
+
animated?: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The style of the button
|
|
30
|
+
*/
|
|
31
|
+
style: ButtonStyle = ButtonStyle.Primary
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The disabled state of the button
|
|
35
|
+
*/
|
|
36
|
+
disabled = false
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export abstract class Button extends BaseButton {
|
|
40
|
+
/**
|
|
41
|
+
* The style of the button
|
|
42
|
+
*/
|
|
43
|
+
abstract style: Exclude<ButtonStyle, ButtonStyle.Link | ButtonStyle.Premium>
|
|
44
|
+
|
|
45
|
+
abstract run(interaction: ButtonInteraction): Promise<void>
|
|
46
|
+
|
|
47
|
+
serialize = (): APIButtonComponent => {
|
|
48
|
+
return {
|
|
49
|
+
type: ComponentType.Button,
|
|
50
|
+
style: this.style,
|
|
51
|
+
label: this.label,
|
|
52
|
+
custom_id: this.customId,
|
|
53
|
+
disabled: this.disabled,
|
|
54
|
+
emoji: this.emoji
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export abstract class LinkButton extends BaseButton {
|
|
60
|
+
customId = ""
|
|
61
|
+
/**
|
|
62
|
+
* The URL that the button links to
|
|
63
|
+
*/
|
|
64
|
+
abstract url: string
|
|
65
|
+
style: ButtonStyle.Link = ButtonStyle.Link
|
|
66
|
+
|
|
67
|
+
serialize = (): APIButtonComponentWithURL => {
|
|
68
|
+
return {
|
|
69
|
+
type: ComponentType.Button,
|
|
70
|
+
url: this.url,
|
|
71
|
+
style: this.style,
|
|
72
|
+
label: this.label,
|
|
73
|
+
disabled: this.disabled,
|
|
74
|
+
emoji: this.emoji
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export abstract class PremiumButton extends BaseButton {
|
|
80
|
+
style: ButtonStyle.Premium = ButtonStyle.Premium
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The SKU ID of the button
|
|
84
|
+
*/
|
|
85
|
+
abstract sku_id: string
|
|
86
|
+
|
|
87
|
+
serialize = (): APIButtonComponentWithSKUId => {
|
|
88
|
+
return {
|
|
89
|
+
style: this.style,
|
|
90
|
+
type: ComponentType.Button,
|
|
91
|
+
disabled: this.disabled,
|
|
92
|
+
sku_id: this.sku_id
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type APIChannelSelectComponent,
|
|
3
|
+
ComponentType
|
|
4
|
+
} from "discord-api-types/v10"
|
|
5
|
+
import { AnySelectMenu } from "../abstracts/AnySelectMenu.js"
|
|
6
|
+
import type { ChannelSelectMenuInteraction } from "../internals/ChannelSelectMenuInteraction.js"
|
|
7
|
+
|
|
8
|
+
export abstract class ChannelSelectMenu extends AnySelectMenu {
|
|
9
|
+
type: ComponentType.ChannelSelect = ComponentType.ChannelSelect
|
|
10
|
+
channelTypes?: APIChannelSelectComponent["channel_types"]
|
|
11
|
+
defaultValues?: APIChannelSelectComponent["default_values"]
|
|
12
|
+
abstract run(interaction: ChannelSelectMenuInteraction): Promise<void>
|
|
13
|
+
|
|
14
|
+
serializeOptions() {
|
|
15
|
+
return {
|
|
16
|
+
type: this.type,
|
|
17
|
+
default_values: this.defaultValues,
|
|
18
|
+
channel_types: this.channelTypes
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|