@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,60 @@
|
|
|
1
|
+
import { ApplicationCommandOptionType, ApplicationCommandType, InteractionType } from "discord-api-types/v10";
|
|
2
|
+
import { Command } from "../classes/Command.js";
|
|
3
|
+
import { BaseInteraction } from "./BaseInteraction.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a command interaction
|
|
6
|
+
*/
|
|
7
|
+
export class CommandInteraction extends BaseInteraction {
|
|
8
|
+
options = {};
|
|
9
|
+
constructor(client, data, command) {
|
|
10
|
+
super(client, data);
|
|
11
|
+
if (data.type !== InteractionType.ApplicationCommand) {
|
|
12
|
+
throw new Error("Invalid interaction type was used to create this class");
|
|
13
|
+
}
|
|
14
|
+
if (data.data.type !== ApplicationCommandType.ChatInput) {
|
|
15
|
+
throw new Error("Invalid command type was used to create this class");
|
|
16
|
+
}
|
|
17
|
+
if (command &&
|
|
18
|
+
command instanceof Command &&
|
|
19
|
+
data.data.type === ApplicationCommandType.ChatInput) {
|
|
20
|
+
this.options = this.parseOptions(command, (data.data.options ??
|
|
21
|
+
[]));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
parseOptions = (command, options) => {
|
|
25
|
+
const result = {};
|
|
26
|
+
for (const option of options) {
|
|
27
|
+
const optionData = command.options?.find((x) => x.name === option.name);
|
|
28
|
+
if (!optionData) {
|
|
29
|
+
result[option.name] = undefined;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
switch (optionData.type) {
|
|
33
|
+
case ApplicationCommandOptionType.String:
|
|
34
|
+
result[option.name] = option.value;
|
|
35
|
+
break;
|
|
36
|
+
case ApplicationCommandOptionType.Integer:
|
|
37
|
+
result[option.name] = option.value;
|
|
38
|
+
break;
|
|
39
|
+
case ApplicationCommandOptionType.Boolean:
|
|
40
|
+
result[option.name] = option.value;
|
|
41
|
+
break;
|
|
42
|
+
case ApplicationCommandOptionType.User:
|
|
43
|
+
result[option.name] = option.value;
|
|
44
|
+
break;
|
|
45
|
+
case ApplicationCommandOptionType.Channel:
|
|
46
|
+
result[option.name] = option.value;
|
|
47
|
+
break;
|
|
48
|
+
case ApplicationCommandOptionType.Role:
|
|
49
|
+
result[option.name] = option.value;
|
|
50
|
+
break;
|
|
51
|
+
case ApplicationCommandOptionType.Mentionable:
|
|
52
|
+
result[option.name] = option.value;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=CommandInteraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandInteraction.js","sourceRoot":"","sources":["../../../src/structures/CommandInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,4BAA4B,EAC5B,sBAAsB,EACtB,eAAe,EAEf,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IACtD,OAAO,GAIH,EAAE,CAAA;IACN,YACC,MAAc,EACd,IAAsC,EACtC,OAAqB;QAErB,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;QACnB,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe,CAAC,kBAAkB,EAAE,CAAC;YACtD,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC1E,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAsB,CAAC,SAAS,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;QACtE,CAAC;QACD,IACC,OAAO;YACP,OAAO,YAAY,OAAO;YAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,sBAAsB,C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BACN,KAAK,4BAA4B,CAAC,IAAI;wBACrC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAe,CAAA;wBAC5C,MAAK;oBACN,KAAK,4BAA4B,CAAC,WAAW;wBAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,KAAe,CAAA;wBAC5C,MAAK;gBACP,CAAC;YACF,CAAC;QACF,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC,CAAA;CACD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Base } from "./Base.js";
|
|
2
|
+
import type { APIMessageComponentInteraction } from "discord-api-types/v10";
|
|
3
|
+
export declare class ComponentHandler extends Base {
|
|
4
|
+
handleInteraction(data: APIMessageComponentInteraction): Promise<false | undefined>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=ComponentHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentHandler.d.ts","sourceRoot":"","sources":["../../../src/structures/ComponentHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,KAAK,EAEX,8BAA8B,EAE9B,MAAM,uBAAuB,CAAA;AAa9B,qBAAa,gBAAiB,SAAQ,IAAI;IACnC,iBAAiB,CAAC,IAAI,EAAE,8BAA8B;CA2D5D"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Base } from "./Base.js";
|
|
2
|
+
import { Button } from "../classes/Button.js";
|
|
3
|
+
import { ButtonInteraction } from "./ButtonInteraction.js";
|
|
4
|
+
import { RoleSelectMenu } from "../classes/RoleSelectMenu.js";
|
|
5
|
+
import { ChannelSelectMenu } from "../classes/ChannelSelectMenu.js";
|
|
6
|
+
import { MentionableSelectMenu } from "../classes/MentionableSelectMenu.js";
|
|
7
|
+
import { StringSelectMenu } from "../classes/StringSelectMenu.js";
|
|
8
|
+
import { UserSelectMenu } from "../classes/UserSelectMenu.js";
|
|
9
|
+
import { RoleSelectMenuInteraction } from "./RoleSelectMenuInteraction.js";
|
|
10
|
+
import { UserSelectMenuInteraction } from "./UserSelectMenuInteraction.js";
|
|
11
|
+
import { StringSelectMenuInteraction } from "./StringSelectMenuInteraction.js";
|
|
12
|
+
import { MentionableSelectMenuInteraction } from "./MentionableSelectMenuInteraction.js";
|
|
13
|
+
import { ChannelSelectMenuInteraction } from "./ChannelSelectMenuInteraction.js";
|
|
14
|
+
export class ComponentHandler extends Base {
|
|
15
|
+
async handleInteraction(data) {
|
|
16
|
+
const allComponents = this.client.commands
|
|
17
|
+
.filter((x) => x.components && x.components.length > 0)
|
|
18
|
+
.flatMap((x) => x.components);
|
|
19
|
+
const component = allComponents.find((x) => x.customId === data.data.custom_id &&
|
|
20
|
+
x.type === data.data.component_type);
|
|
21
|
+
if (!component)
|
|
22
|
+
return false;
|
|
23
|
+
if (component instanceof Button) {
|
|
24
|
+
const interaction = new ButtonInteraction(this.client, data);
|
|
25
|
+
if (component.defer)
|
|
26
|
+
await interaction.defer();
|
|
27
|
+
await component.run(interaction);
|
|
28
|
+
}
|
|
29
|
+
else if (component instanceof RoleSelectMenu) {
|
|
30
|
+
const interaction = new RoleSelectMenuInteraction(this.client, data);
|
|
31
|
+
if (component.defer)
|
|
32
|
+
await interaction.defer();
|
|
33
|
+
await component.run(interaction);
|
|
34
|
+
}
|
|
35
|
+
else if (component instanceof ChannelSelectMenu) {
|
|
36
|
+
const interaction = new ChannelSelectMenuInteraction(this.client, data);
|
|
37
|
+
if (component.defer)
|
|
38
|
+
await interaction.defer();
|
|
39
|
+
await component.run(interaction);
|
|
40
|
+
}
|
|
41
|
+
else if (component instanceof MentionableSelectMenu) {
|
|
42
|
+
const interaction = new MentionableSelectMenuInteraction(this.client, data);
|
|
43
|
+
if (component.defer)
|
|
44
|
+
await interaction.defer();
|
|
45
|
+
await component.run(interaction);
|
|
46
|
+
}
|
|
47
|
+
else if (component instanceof StringSelectMenu) {
|
|
48
|
+
const interaction = new StringSelectMenuInteraction(this.client, data);
|
|
49
|
+
if (component.defer)
|
|
50
|
+
await interaction.defer();
|
|
51
|
+
await component.run(interaction);
|
|
52
|
+
}
|
|
53
|
+
else if (component instanceof UserSelectMenu) {
|
|
54
|
+
const interaction = new UserSelectMenuInteraction(this.client, data);
|
|
55
|
+
if (component.defer)
|
|
56
|
+
await interaction.defer();
|
|
57
|
+
await component.run(interaction);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
throw new Error(`Unknown component with type ${data.data.component_type} and custom ID ${data.data.custom_id}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=ComponentHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentHandler.js","sourceRoot":"","sources":["../../../src/structures/ComponentHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAO1D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC1E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAA;AACxF,OAAO,EAAE,4BAA4B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elType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a DM between two users.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DmChannel extends BaseChannel<ChannelType.DM> {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the channel. This is always null for DM channels.
|
|
9
|
+
*/
|
|
10
|
+
name?: null;
|
|
11
|
+
type: ChannelType.DM;
|
|
12
|
+
protected setSpecificData(data: APIDMChannel): void;
|
|
13
|
+
/**
|
|
14
|
+
* Send a message to the channel
|
|
15
|
+
*/
|
|
16
|
+
send(message: APIMessage): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=DmChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DmChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/DmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,WAAW,EAEX,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW,CAAC,WAAW,CAAC,EAAE,CAAC;IACzD;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAO;IAClB,IAAI,EAAE,WAAW,CAAC,EAAE,CAAiB;IAErC,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,YAAY;IAI5C;;OAEG;IACG,IAAI,CAAC,OAAO,EAAE,UAAU;CAK9B"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChannelType, Routes } from "discord-api-types/v10";
|
|
2
|
+
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a DM between two users.
|
|
5
|
+
*/
|
|
6
|
+
export class DmChannel extends BaseChannel {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the channel. This is always null for DM channels.
|
|
9
|
+
*/
|
|
10
|
+
name = null;
|
|
11
|
+
type = ChannelType.DM;
|
|
12
|
+
setSpecificData(data) {
|
|
13
|
+
this.name = data.name;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Send a message to the channel
|
|
17
|
+
*/
|
|
18
|
+
async send(message) {
|
|
19
|
+
this.client.rest.post(Routes.channelMessages(this.id), {
|
|
20
|
+
body: { ...message }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=DmChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DmChannel.js","sourceRoot":"","sources":["../../../src/structures/DmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,WAAW,EACX,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAEzD;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,WAA2B;IACzD;;OAEG;IACH,IAAI,GAAU,IAAI,CAAA;IAClB,IAAI,GAAmB,WAAW,CAAC,EAAE,CAAA;IAE3B,eAAe,CAAC,IAAkB;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;IACtB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,OAAmB;QAC7B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YACtD,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE;SACpB,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { type APIGroupDMChannel, ChannelType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
|
+
import { Message } from "./Message.js";
|
|
4
|
+
import { User } from "./User.js";
|
|
5
|
+
/**
|
|
6
|
+
* Represents a group DM channel.
|
|
7
|
+
*/
|
|
8
|
+
export declare class GroupDmChannel extends BaseChannel<ChannelType.GroupDM> {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the channel.
|
|
11
|
+
*/
|
|
12
|
+
name?: string | null;
|
|
13
|
+
/**
|
|
14
|
+
* The recipients of the channel.
|
|
15
|
+
*/
|
|
16
|
+
recipients?: User[];
|
|
17
|
+
type: ChannelType.GroupDM;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the application that created the channel, if it was created by a bot.
|
|
20
|
+
*/
|
|
21
|
+
applicationId?: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* The icon hash of the channel.
|
|
24
|
+
*/
|
|
25
|
+
icon?: string | null;
|
|
26
|
+
/**
|
|
27
|
+
* The ID of the user who created the channel.
|
|
28
|
+
*/
|
|
29
|
+
ownerId?: string | null;
|
|
30
|
+
/**
|
|
31
|
+
* The ID of the last message sent in the channel.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* 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.
|
|
35
|
+
*/
|
|
36
|
+
lastMessageId?: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the channel is managed by an Oauth2 application.
|
|
39
|
+
*/
|
|
40
|
+
managed?: boolean | null;
|
|
41
|
+
protected setSpecificData(data: APIGroupDMChannel): void;
|
|
42
|
+
/**
|
|
43
|
+
* Get the URL of the channel's icon.
|
|
44
|
+
*/
|
|
45
|
+
get iconUrl(): string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Get the owner of the channel.
|
|
48
|
+
*/
|
|
49
|
+
get owner(): User;
|
|
50
|
+
/**
|
|
51
|
+
* The last message sent in the channel.
|
|
52
|
+
*
|
|
53
|
+
* @remarks
|
|
54
|
+
* 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.
|
|
55
|
+
* This will always return a partial message, so you can use {@link Message.fetch} to get the full message data.
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
get lastMessage(): Message | null;
|
|
59
|
+
/**
|
|
60
|
+
* Set the name of the channel
|
|
61
|
+
* @param name The new name of the channel
|
|
62
|
+
*/
|
|
63
|
+
setName(name: string): Promise<void>;
|
|
64
|
+
addRecipient(user: User | string): Promise<void>;
|
|
65
|
+
removeRecipient(user: User | string): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=GroupDmChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupDmChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GroupDmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,iBAAiB,EACtB,WAAW,EAEX,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC;IACnE;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,EAAE,CAAA;IACnB,IAAI,EAAE,WAAW,CAAC,OAAO,CAAsB;IAC/C;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAExB,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,iBAAiB;IAUjD;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,GAAG,IAAI,CAI3B;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,IAAI,CAGhB;IAED;;;;;;;OAOG;IACH,IAAI,WAAW,mBAMd;IAED;;;OAGG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM;IASpB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;IAiBhC,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;CAYzC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ChannelType, Routes } from "discord-api-types/v10";
|
|
2
|
+
import { BaseChannel } from "../abstracts/BaseChannel.js";
|
|
3
|
+
import { Message } from "./Message.js";
|
|
4
|
+
import { User } from "./User.js";
|
|
5
|
+
/**
|
|
6
|
+
* Represents a group DM channel.
|
|
7
|
+
*/
|
|
8
|
+
export class GroupDmChannel extends BaseChannel {
|
|
9
|
+
/**
|
|
10
|
+
* The name of the channel.
|
|
11
|
+
*/
|
|
12
|
+
name;
|
|
13
|
+
/**
|
|
14
|
+
* The recipients of the channel.
|
|
15
|
+
*/
|
|
16
|
+
recipients;
|
|
17
|
+
type = ChannelType.GroupDM;
|
|
18
|
+
/**
|
|
19
|
+
* The ID of the application that created the channel, if it was created by a bot.
|
|
20
|
+
*/
|
|
21
|
+
applicationId;
|
|
22
|
+
/**
|
|
23
|
+
* The icon hash of the channel.
|
|
24
|
+
*/
|
|
25
|
+
icon;
|
|
26
|
+
/**
|
|
27
|
+
* The ID of the user who created the channel.
|
|
28
|
+
*/
|
|
29
|
+
ownerId;
|
|
30
|
+
/**
|
|
31
|
+
* The ID of the last message sent in the channel.
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* 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.
|
|
35
|
+
*/
|
|
36
|
+
lastMessageId;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the channel is managed by an Oauth2 application.
|
|
39
|
+
*/
|
|
40
|
+
managed;
|
|
41
|
+
setSpecificData(data) {
|
|
42
|
+
this.name = data.name;
|
|
43
|
+
this.recipients = data.recipients?.map((x) => new User(this.client, x));
|
|
44
|
+
this.applicationId = data.application_id;
|
|
45
|
+
this.icon = data.icon;
|
|
46
|
+
this.ownerId = data.owner_id;
|
|
47
|
+
this.lastMessageId = data.last_message_id;
|
|
48
|
+
this.managed = data.managed;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get the URL of the channel's icon.
|
|
52
|
+
*/
|
|
53
|
+
get iconUrl() {
|
|
54
|
+
return this.icon
|
|
55
|
+
? `https://cdn.discordapp.com/channel-icons/${this.id}/${this.icon}.png`
|
|
56
|
+
: null;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get the owner of the channel.
|
|
60
|
+
*/
|
|
61
|
+
get owner() {
|
|
62
|
+
if (!this.ownerId)
|
|
63
|
+
throw new Error("Cannot get owner without owner ID");
|
|
64
|
+
return new User(this.client, this.ownerId);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The last message sent in the channel.
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* 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.
|
|
71
|
+
* This will always return a partial message, so you can use {@link Message.fetch} to get the full message data.
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
get lastMessage() {
|
|
75
|
+
if (!this.lastMessageId)
|
|
76
|
+
return null;
|
|
77
|
+
return new Message(this.client, {
|
|
78
|
+
id: this.lastMessageId,
|
|
79
|
+
channel_id: this.id
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Set the name of the channel
|
|
84
|
+
* @param name The new name of the channel
|
|
85
|
+
*/
|
|
86
|
+
async setName(name) {
|
|
87
|
+
await this.client.rest.patch(Routes.channel(this.id), {
|
|
88
|
+
body: {
|
|
89
|
+
name
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
this.name = name;
|
|
93
|
+
}
|
|
94
|
+
async addRecipient(user) {
|
|
95
|
+
await this.client.rest.put(Routes.channelRecipient(this.id, typeof user === "string" ? user : user.id));
|
|
96
|
+
if (this.recipients)
|
|
97
|
+
this.recipients.push(typeof user === "string" ? new User(this.client, user) : user);
|
|
98
|
+
else
|
|
99
|
+
this.recipients = [
|
|
100
|
+
typeof user === "string" ? new User(this.client, user) : user
|
|
101
|
+
];
|
|
102
|
+
}
|
|
103
|
+
async removeRecipient(user) {
|
|
104
|
+
await this.client.rest.delete(Routes.channelRecipient(this.id, typeof user === "string" ? user : user.id));
|
|
105
|
+
if (this.recipients)
|
|
106
|
+
this.recipients = this.recipients.filter((x) => x.id !== (typeof user === "string" ? user : user.id));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=GroupDmChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupDmChannel.js","sourceRoot":"","sources":["../../../src/structures/GroupDmChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,WAAW,EACX,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,WAAgC;IACnE;;OAEG;IACH,IAAI,CAAgB;IACpB;;OAEG;IACH,UAAU,CAAS;IACnB,IAAI,GAAwB,WAAW,CAAC,OAAO,CAAA;IAC/C;;OAEG;IACH,aAAa,CAAgB;IAC7B;;OAEG;IACH,IAAI,CAAgB;IACpB;;OAEG;IACH,OAAO,CAAgB;IACvB;;;;;OAKG;IACH,aAAa,CAAgB;IAC7B;;OAEG;IACH,OAAO,CAAiB;IAEd,eAAe,CAAC,IAAuB;QAChD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC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C,CAAC,IAAI,CAAC,EAAE,CAAC,CAC3D,CAAA;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type APIGuild, type RESTPostAPIGuildRoleJSONBody } from "discord-api-types/v10";
|
|
2
|
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import type { Client } from "../classes/Client.js";
|
|
4
|
+
import { Role } from "./Role.js";
|
|
5
|
+
export declare class Guild extends Base {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the guild
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* The name of the guild.
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The description of the guild.
|
|
16
|
+
*/
|
|
17
|
+
description?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* The icon hash of the guild.
|
|
20
|
+
* You can use {@link Guild.iconUrl} to get the URL of the icon.
|
|
21
|
+
*/
|
|
22
|
+
icon?: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* The splash hash of the guild.
|
|
25
|
+
* You can use {@link Guild.splashUrl} to get the URL of the splash.
|
|
26
|
+
*/
|
|
27
|
+
splash?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* The ID of the owner of the guild.
|
|
30
|
+
*/
|
|
31
|
+
ownerId?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the guild is a partial guild (meaning it does not have all the data).
|
|
34
|
+
* If this is true, you should use {@link Guild.fetch} to get the full data of the guild.
|
|
35
|
+
*/
|
|
36
|
+
partial: boolean;
|
|
37
|
+
private rawData;
|
|
38
|
+
constructor(client: Client, rawDataOrId: APIGuild | string);
|
|
39
|
+
private setData;
|
|
40
|
+
/**
|
|
41
|
+
* Fetch updated data for this guild.
|
|
42
|
+
* If the guild is partial, this will fetch all the data for the guild and populate the fields.
|
|
43
|
+
* If the guild is not partial, all fields will be updated with new values from Discord.
|
|
44
|
+
*/
|
|
45
|
+
fetch(): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Leave the guild
|
|
48
|
+
*/
|
|
49
|
+
leave(): Promise<unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* Create a role in the guild
|
|
52
|
+
*/
|
|
53
|
+
createRole(data: RESTPostAPIGuildRoleJSONBody): Promise<Role>;
|
|
54
|
+
/**
|
|
55
|
+
* Get the URL of the guild's icon
|
|
56
|
+
*/
|
|
57
|
+
get iconUrl(): string | null;
|
|
58
|
+
/**
|
|
59
|
+
* Get the URL of the guild's splash
|
|
60
|
+
*/
|
|
61
|
+
get splashUrl(): string | null;
|
|
62
|
+
/**
|
|
63
|
+
* Get all roles in the guild
|
|
64
|
+
*/
|
|
65
|
+
get roles(): Role[];
|
|
66
|
+
/**
|
|
67
|
+
* Fetch a channel from the guild by ID
|
|
68
|
+
*/
|
|
69
|
+
fetchChannel(channelId: string): Promise<import("./DmChannel.js").DmChannel | import("./GroupDmChannel.js").GroupDmChannel | import("./GuildTextChannel.js").GuildTextChannel | import("./GuildStageOrVoiceChannel.js").GuildVoiceChannel | import("./GuildCategoryChannel.js").GuildCategoryChannel | import("./GuildAnnouncementChannel.js").GuildAnnouncementChannel | import("./GuildThreadChannel.js").GuildThreadChannel<import("discord-api-types/v10").ThreadChannelType> | import("./GuildStageOrVoiceChannel.js").GuildStageChannel | import("./GuildForumChannel.js").GuildForumChannel | import("./GuildMediaChannel.js").GuildMediaChannel | null>;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=Guild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Guild.d.ts","sourceRoot":"","sources":["../../../src/structures/Guild.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,QAAQ,EAEb,KAAK,4BAA4B,EAEjC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,qBAAa,KAAM,SAAQ,IAAI;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAA;IAEhB,OAAO,CAAC,OAAO,CAAwB;gBAE3B,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,GAAG,MAAM;IAa1D,OAAO,CAAC,OAAO;IAWf;;;;OAIG;IACG,KAAK;IASX;;OAEG;IACG,KAAK;IAIX;;OAEG;IACG,UAAU,CAAC,IAAI,EAAE,4BAA4B;IASnD;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,GAAG,IAAI,CAI3B;IAED;;OAEG;IACH,IAAI,SAAS,IAAI,MAAM,GAAG,IAAI,CAI7B;IAED;;OAEG;IACH,IAAI,KAAK,WAIR;IAED;;OAEG;IACG,YAAY,CAAC,SAAS,EAAE,MAAM;CAMpC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Routes } from "discord-api-types/v10";
|
|
2
|
+
import { Base } from "../abstracts/Base.js";
|
|
3
|
+
import { channelFactory } from "../factories/channelFactory.js";
|
|
4
|
+
import { Role } from "./Role.js";
|
|
5
|
+
export class Guild extends Base {
|
|
6
|
+
/**
|
|
7
|
+
* The ID of the guild
|
|
8
|
+
*/
|
|
9
|
+
id;
|
|
10
|
+
/**
|
|
11
|
+
* The name of the guild.
|
|
12
|
+
*/
|
|
13
|
+
name;
|
|
14
|
+
/**
|
|
15
|
+
* The description of the guild.
|
|
16
|
+
*/
|
|
17
|
+
description;
|
|
18
|
+
/**
|
|
19
|
+
* The icon hash of the guild.
|
|
20
|
+
* You can use {@link Guild.iconUrl} to get the URL of the icon.
|
|
21
|
+
*/
|
|
22
|
+
icon;
|
|
23
|
+
/**
|
|
24
|
+
* The splash hash of the guild.
|
|
25
|
+
* You can use {@link Guild.splashUrl} to get the URL of the splash.
|
|
26
|
+
*/
|
|
27
|
+
splash;
|
|
28
|
+
/**
|
|
29
|
+
* The ID of the owner of the guild.
|
|
30
|
+
*/
|
|
31
|
+
ownerId;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the guild is a partial guild (meaning it does not have all the data).
|
|
34
|
+
* If this is true, you should use {@link Guild.fetch} to get the full data of the guild.
|
|
35
|
+
*/
|
|
36
|
+
partial;
|
|
37
|
+
rawData = null;
|
|
38
|
+
constructor(client, rawDataOrId) {
|
|
39
|
+
super(client);
|
|
40
|
+
if (typeof rawDataOrId === "string") {
|
|
41
|
+
this.id = rawDataOrId;
|
|
42
|
+
this.partial = true;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.rawData = rawDataOrId;
|
|
46
|
+
this.id = rawDataOrId.id;
|
|
47
|
+
this.partial = false;
|
|
48
|
+
this.setData(rawDataOrId);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
setData(data) {
|
|
52
|
+
if (!data)
|
|
53
|
+
throw new Error("Cannot set data without having data... smh");
|
|
54
|
+
this.rawData = data;
|
|
55
|
+
this.name = data.name;
|
|
56
|
+
this.description = data.description;
|
|
57
|
+
this.icon = data.icon;
|
|
58
|
+
this.splash = data.splash;
|
|
59
|
+
this.ownerId = data.owner_id;
|
|
60
|
+
this.partial = false;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Fetch updated data for this guild.
|
|
64
|
+
* If the guild is partial, this will fetch all the data for the guild and populate the fields.
|
|
65
|
+
* If the guild is not partial, all fields will be updated with new values from Discord.
|
|
66
|
+
*/
|
|
67
|
+
async fetch() {
|
|
68
|
+
const newData = (await this.client.rest.get(Routes.guild(this.id)));
|
|
69
|
+
if (!newData)
|
|
70
|
+
throw new Error(`Guild ${this.id}not found`);
|
|
71
|
+
this.setData(newData);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Leave the guild
|
|
75
|
+
*/
|
|
76
|
+
async leave() {
|
|
77
|
+
return await this.client.rest.delete(Routes.guild(this.id));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Create a role in the guild
|
|
81
|
+
*/
|
|
82
|
+
async createRole(data) {
|
|
83
|
+
const role = (await this.client.rest.post(Routes.guildRoles(this.id), {
|
|
84
|
+
body: {
|
|
85
|
+
...data
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
88
|
+
return new Role(this.client, role);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get the URL of the guild's icon
|
|
92
|
+
*/
|
|
93
|
+
get iconUrl() {
|
|
94
|
+
return this.icon
|
|
95
|
+
? `https://cdn.discordapp.com/icons/${this.id}/${this.icon}.png`
|
|
96
|
+
: null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get the URL of the guild's splash
|
|
100
|
+
*/
|
|
101
|
+
get splashUrl() {
|
|
102
|
+
return this.splash
|
|
103
|
+
? `https://cdn.discordapp.com/splashes/${this.id}/${this.splash}.png`
|
|
104
|
+
: null;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get all roles in the guild
|
|
108
|
+
*/
|
|
109
|
+
get roles() {
|
|
110
|
+
const roles = this.rawData?.roles;
|
|
111
|
+
if (!roles)
|
|
112
|
+
throw new Error("Cannot get roles without having data... smh");
|
|
113
|
+
return roles.map((role) => new Role(this.client, role));
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Fetch a channel from the guild by ID
|
|
117
|
+
*/
|
|
118
|
+
async fetchChannel(channelId) {
|
|
119
|
+
const channel = (await this.client.rest.get(Routes.channel(channelId)));
|
|
120
|
+
return channelFactory(this.client, channel);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=Guild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Guild.js","sourceRoot":"","sources":["../../../src/structures/Guild.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,MAAM,EACN,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,OAAO,KAAM,SAAQ,IAAI;IAC9B;;OAEG;IACH,EAAE,CAAQ;IACV;;OAEG;IACH,IAAI,CAAS;IACb;;OAEG;IACH,WAAW,CAAgB;IAC3B;;;OAGG;IACH,IAAI,CAAgB;IACpB;;;OAGG;IACH,MAAM,CAAgB;IACtB;;OAEG;IACH,OAAO,CAAS;IAEhB;;;OAGG;IACH,OAAO,CAAS;IAER,OAAO,GAAoB,IAAI,CAAA;IAEvC,YAAY,MAAc,EAAE,WAA8B;QACzD,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;IAEO,OAAO,CAAC,IAAyB;QACxC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,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C,CAAC;IAED;;OAEG;IACH,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,IAAI;YACf,CAAC,CAAC,oCAAoC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,MAAM;YAChE,CAAC,CAAC,IAAI,CAAA;IACR,CAAC;IAED;;OAEG;IACH,IAAI,SAAS;QACZ,OAAO,IAAI,CAAC,MAAM;YACjB,CAAC,CAAC,uCAAuC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,MAAM,MAAM;YACrE,CAAC,CAAC,IAAI,CAAA;IACR,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACR,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAA;QACjC,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAA;QAC1E,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IACxD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,SAAiB;QACnC,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAC1C,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CACzB,CAAe,CAAA;QAChB,OAAO,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;CACD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ChannelType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseGuildTextChannel } from "../abstracts/BaseGuildTextChannel.js";
|
|
3
|
+
import type { GuildTextChannel } from "./GuildTextChannel.js";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a guild announcement channel.
|
|
6
|
+
*/
|
|
7
|
+
export declare class GuildAnnouncementChannel extends BaseGuildTextChannel<ChannelType.GuildAnnouncement> {
|
|
8
|
+
type: ChannelType.GuildAnnouncement;
|
|
9
|
+
protected setMoreSpecificData(): void;
|
|
10
|
+
follow(targetChannel: GuildTextChannel | string): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=GuildAnnouncementChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuildAnnouncementChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildAnnouncementChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAU,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,oBAAoB,CAAC,WAAW,CAAC,iBAAiB,CAAC;IAChG,IAAI,EAAE,WAAW,CAAC,iBAAiB,CAAgC;IACnE,SAAS,CAAC,mBAAmB;IAEvB,MAAM,CAAC,aAAa,EAAE,gBAAgB,GAAG,MAAM;CAQrD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChannelType, Routes } from "discord-api-types/v10";
|
|
2
|
+
import { BaseGuildTextChannel } from "../abstracts/BaseGuildTextChannel.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a guild announcement channel.
|
|
5
|
+
*/
|
|
6
|
+
export class GuildAnnouncementChannel extends BaseGuildTextChannel {
|
|
7
|
+
type = ChannelType.GuildAnnouncement;
|
|
8
|
+
setMoreSpecificData() { }
|
|
9
|
+
async follow(targetChannel) {
|
|
10
|
+
await this.client.rest.put(Routes.channelFollowers(this.id), {
|
|
11
|
+
body: {
|
|
12
|
+
webhook_channel_id: typeof targetChannel === "string" ? targetChannel : targetChannel.id
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=GuildAnnouncementChannel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuildAnnouncementChannel.js","sourceRoot":"","sources":["../../../src/structures/GuildAnnouncementChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAA;AAG3E;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,oBAAmD;IAChG,IAAI,GAAkC,WAAW,CAAC,iBAAiB,CAAA;IACzD,mBAAmB,KAAI,CAAC;IAElC,KAAK,CAAC,MAAM,CAAC,aAAwC;QACpD,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE;YAC5D,IAAI,EAAE;gBACL,kBAAkB,EACjB,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,EAAE;aACrE;SACD,CAAC,CAAA;IACH,CAAC;CACD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChannelType } from "discord-api-types/v10";
|
|
2
|
+
import { BaseGuildChannel } from "../abstracts/BaseGuildChannel.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents a guild category channel.
|
|
5
|
+
*/
|
|
6
|
+
export declare class GuildCategoryChannel extends BaseGuildChannel<ChannelType.GuildCategory> {
|
|
7
|
+
protected setSpecificData(): void;
|
|
8
|
+
/**
|
|
9
|
+
* You cannot send a message to a category channel, so this method throws an error
|
|
10
|
+
*/
|
|
11
|
+
send(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=GuildCategoryChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GuildCategoryChannel.d.ts","sourceRoot":"","sources":["../../../src/structures/GuildCategoryChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,gBAAgB,CAAC,WAAW,CAAC,aAAa,CAAC;IACpF,SAAS,CAAC,eAAe;IAEzB;;OAEG;IACY,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC"}
|