diff --git a/DisCatSharp.Docs/articles/toc.yml b/DisCatSharp.Docs/articles/toc.yml index 39d9f30a6..92bd4be1b 100644 --- a/DisCatSharp.Docs/articles/toc.yml +++ b/DisCatSharp.Docs/articles/toc.yml @@ -1,121 +1,107 @@ - name: Preamble href: preamble.md -- name: Changelog - items: - - name: Version 10.1.0 - href: important_changes/10_1_0.md - - name: Version 10.0.0 - href: important_changes/10_0_0.md - - name: Version 9.9.0 - href: important_changes/9_9_0.md - - name: Version 9.8.5 - href: important_changes/9_8_5.md - - name: Version 9.8.4 - href: important_changes/9_8_4.md - - name: Version 9.8.3 - href: important_changes/9_8_3.md - - name: Version 9.8.2 - href: important_changes/9_8_2.md +- name: Changelogs + href: ../changelogs/index.md - name: The Basics items: - name: Creating a Bot Account href: basics/bot_account.md - name: Writing Your First Bot href: basics/first_bot.md - name: Bot as Hosted Service href: basics/web_app.md - name: Project Templates href: basics/templates.md - name: Beyond Basics items: - name: Events href: beyond_basics/events.md - name: Logging href: beyond_basics/logging/default.md items: - name: The Default Logger href: beyond_basics/logging/default.md - name: Third Party Loggers href: beyond_basics/logging/third_party.md - name: Dependency Injection Loggers href: beyond_basics/logging/di.md - name: Intents href: beyond_basics/intents.md - name: Sharding href: beyond_basics/sharding.md - name: Message Builder href: beyond_basics/messagebuilder.md - name: Components items: - name: Buttons href: beyond_basics/components/buttons.md - name: Select Menu href: beyond_basics/components/select_menus.md - name: Workarounds href: beyond_basics/workarounds.md - name: Modules items: - name: Application Commands items: - name: Introduction href: modules/application_commands/intro.md - name: Options href: modules/application_commands/options.md - name: Events href: modules/application_commands/events.md - name: Translations items: - name: Using Translations href: modules/application_commands/translations/using.md - name: Translation Reference href: modules/application_commands/translations/reference.md - name: Modals href: modules/application_commands/modals.md - name: Paginated Modals href: modules/application_commands/paginated_modals.md - name: CommandsNext items: - name: Introduction href: modules/commandsnext/intro.md - name: Command Attributes href: modules/commandsnext/command_attributes.md - name: Dependency Injection href: modules/commandsnext/dependency_injection.md - name: Customization items: - name: Help Formatter href: modules/commandsnext/help_formatter.md - name: Argument Converters href: modules/commandsnext/argument_converters.md - name: Command Handler href: modules/commandsnext/command_handler.md - name: Audio items: - name: Lavalink items: - name: Setup href: modules/audio/lavalink/setup.md - name: Configuration href: modules/audio/lavalink/configuration.md - name: Music Commands href: modules/audio/lavalink/music_commands.md - name: Advanced href: modules/audio/lavalink/advanced.md - name: VoiceNext items: - name: Prerequisites href: modules/audio/voicenext/prerequisites.md - name: Transmitting href: modules/audio/voicenext/transmit.md - name: Receiving href: modules/audio/voicenext/receive.md - name: Interactivity href: modules/interactivity.md - name: Miscellaneous items: - name: Nightly Builds href: misc/nightly_builds.md - name: Reporting Issues href: misc/reporting_issues.md - name: Hosting href: misc/hosting.md diff --git a/DisCatSharp.Docs/changelogs/index.md b/DisCatSharp.Docs/changelogs/index.md new file mode 100644 index 000000000..40b8753de --- /dev/null +++ b/DisCatSharp.Docs/changelogs/index.md @@ -0,0 +1,8 @@ +--- +uid: changelogs +title: Changelogs +--- + +# Changelogs + +Please select the changelog you want to view from the left side. diff --git a/DisCatSharp.Docs/changelogs/toc.yml b/DisCatSharp.Docs/changelogs/toc.yml new file mode 100644 index 000000000..27f2fec94 --- /dev/null +++ b/DisCatSharp.Docs/changelogs/toc.yml @@ -0,0 +1,20 @@ +- name: Changelogs + items: + - name: Version 10.X + items: + - name: Version 10.1.0 + href: v10/10_1_0.md + - name: Version 10.0.0 + href: v10/10_0_0.md + - name: Version 9.X + items: + - name: Version 9.0.0 + href: v9/9_0_0.md + - name: Version 9.8.5 + href: v9/9_8_5.md + - name: Version 9.8.4 + href: v9/9_8_4.md + - name: Version 9.8.3 + href: v9/9_8_3.md + - name: Version 9.8.2 + href: v9/9_8_2.md diff --git a/DisCatSharp.Docs/articles/important_changes/10_0_0.md b/DisCatSharp.Docs/changelogs/v10/10_0_0.md similarity index 96% rename from DisCatSharp.Docs/articles/important_changes/10_0_0.md rename to DisCatSharp.Docs/changelogs/v10/10_0_0.md index ed1299ac3..0a8de497a 100644 --- a/DisCatSharp.Docs/articles/important_changes/10_0_0.md +++ b/DisCatSharp.Docs/changelogs/v10/10_0_0.md @@ -1,25 +1,25 @@ --- -uid: important_changes_10_0_0 +uid: changelogs_v10_10_0_0 title: Version 10.0.0 --- # Upgrade from **9.9.0** to **10.0.0** ## What is new in DisCatSharp? - Advanced dependency injection system - Support for API v10 - Message content intent - Properly working application command localization - Optimized lib code - Pre-implementation of upcoming things - Support for [Channel Type](xref:DisCatSharp.Enums.ChannelType) `Forum` (WIP) ## What changed? To get message content with API v10, you have to enable the message content intent in the developer portal AND specify the [DiscordIntent](xref:DisCatSharp.DiscordIntents) `MessageContent`. Otherwise you won't receive message contents from guild messages where the bot isn't mentioned. ## Backwards Compatibility You can always choose to use a previous API version. I.e. if you want to use API V9, you can use `DiscordIntents.AllV9Less` to enable all intents that are valid for this version. diff --git a/DisCatSharp.Docs/articles/important_changes/10_1_0.md b/DisCatSharp.Docs/changelogs/v10/10_1_0.md similarity index 98% rename from DisCatSharp.Docs/articles/important_changes/10_1_0.md rename to DisCatSharp.Docs/changelogs/v10/10_1_0.md index 84e913059..630d6a47f 100644 --- a/DisCatSharp.Docs/articles/important_changes/10_1_0.md +++ b/DisCatSharp.Docs/changelogs/v10/10_1_0.md @@ -1,136 +1,136 @@ --- -uid: important_changes_10_1_0 +uid: changelogs_v10_10_1_0 title: Version 10.1.0 --- # Upgrade from **10.0.0** to **10.1.0** ## What is new in DisCatSharp? - Rework of [ApplicationCommands](xref:api_discatsharp_applicationcommands_index) - Support for [DiscordGuild.DisableInvitesAsync](xref:DisCatSharp.Entities.DiscordGuild#DisCatSharp_Entities_DiscordGuild_DisableInvitesAsync_System_String_) - Full support for [Forum](xref:DisCatSharp.Enums.ChannelType) [Channels](xref:DisCatSharp.Entities.DiscordChannel) - Support for [Spotify](xref:DisCatSharp.Lavalink.LavalinkSearchType) and [Apple Music](xref:DisCatSharp.Lavalink.LavalinkSearchType) in [DisCatSharp.Lavalink](xref:api_discatsharp_lavalink_index). See [Lavalink Advanced Usage](xref:modules_audio_lavalink_advanced) for more information. - Documentation has a bunch of new and reworked articles! ____ ## What changed? > [!WARNING] > This release contains breaking changes. Please read the changelog carefully. > Some bug fixes aren't noted here. ### All packages NuGet packages now support [Source Link](https://docs.microsoft.com/en-us/dotnet/standard/library-guidance/sourcelink) & [Deterministic Builds](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/code-generation). - Updated the NuGet specs to be compatible with NuGet Gallery. - Changed PackageLicenseUrl to PackageLicenseFile and included the top-level [LICENSE.md](https://github.com/Aiko-IT-Systems/DisCatSharp/blob/main/LICENSE.md) - Changed PackageIconUrl to PackageIcon and included [DisCatSharp.Logos/logobig.png](https://github.com/Aiko-IT-Systems/DisCatSharp/blob/main/DisCatSharp.Logos/logobig.png) > [!CAUTION] > We've fixed various namespaces. Please make sure to update your code accordingly. ### DisCatSharp - Implemented Forum Channels - Added fields to [DiscordChannel](xref:DisCatSharp.Entities.DiscordChannel): - [PostCreateUserRateLimit](xref:DisCatSharp.Entities.DiscordChannel#DisCatSharp_Entities_DiscordChannel_PostCreateUserRateLimit) - [DefaultReactionEmoji](xref:DisCatSharp.Entities.DiscordChannel#DisCatSharp_Entities_DiscordChannel_DefaultReactionEmoji) with the type of [ForumReactionEmoji](xref:DisCatSharp.Entities.ForumReactionEmoji) - [AvailableTags](xref:DisCatSharp.Entities.DiscordChannel#DisCatSharp_Entities_DiscordChannel_AvailableTags) - Added fields to [DiscordThreadChannel](xref:DisCatSharp.Entities.DiscordThreadChannel): - [TotalMessagesSent](xref:DisCatSharp.Entities.DiscordThreadChannel#DisCatSharp_Entities_DiscordThreadChannel_TotalMessagesSent) - [AppliedTags](xref:DisCatSharp.Entities.DiscordThreadChannel#DisCatSharp_Entities_DiscordThreadChannel_AppliedTags) - Added entity [ForumPostTag](xref:DisCatSharp.Entities.ForumPostTag) - Added function to create a forum through the guild entity [CreateForumChannelAsync](xref:DisCatSharp.Entities.DiscordGuild#DisCatSharp_Entities_DiscordGuild_CreateForumChannelAsync_System_String_DisCatSharp_Entities_DiscordChannel_DisCatSharp_Entities_Optional_System_String__IEnumerable_DisCatSharp_Entities_DiscordOverwriteBuilder__System_Nullable_System_Boolean__DisCatSharp_Entities_Optional_DisCatSharp_Entities_ForumReactionEmoji__DisCatSharp_Entities_Optional_System_Nullable_System_Int32___DisCatSharp_Entities_Optional_System_Nullable_System_Int32___DisCatSharp_ThreadAutoArchiveDuration_System_String_) - Added functions to modify a forum channel [ModifyForumAsync](xref:DisCatSharp.Entities.DiscordChannel#DisCatSharp_Entities_DiscordChannel_ModifyForumAsync_Action_DisCatSharp_Net_Models_ForumChannelEditModel__) - Added forum post tag operations on threads - Added disable invites for [DiscordGuild](xref:DisCatSharp.Entities.DiscordGuild) - Added new function [EnableInvitesAsync](xref:DisCatSharp.Entities.DiscordGuild#DisCatSharp_Entities_DiscordGuild_EnableInvitesAsync_System_String_) - Added new function [DisableInvitesAsync](xref:DisCatSharp.Entities.DiscordGuild#DisCatSharp_Entities_DiscordGuild_DisableInvitesAsync_System_String_) - The ordered channel methods and fields in [DiscordChannel](xref:DisCatSharp.Entities.DiscordChannel) now include Forum Channels - Added [DiscordMember.DisconnectFromVoiceAsync](xref:DisCatSharp.Entities.DiscordMember#DisCatSharp_Entities_DiscordMember_DisconnectFromVoiceAsync) - Added [Avatar Decorations](xref:DisCatSharp.Entities.DiscordUser#DisCatSharp_Entities_DiscordUser_AvatarDecorationUrl) - Added [Theme Colors](xref:DisCatSharp.Entities.DiscordUser#DisCatSharp_Entities_DiscordUser_ThemeColors) - Added support for the `X-Discord-Locale` Header in the [DiscordConfiguration](xref:DisCatSharp.DiscordConfiguration#DisCatSharp_DiscordConfiguration_Locale) - Added support for sending component-only messages - Implemented `ResumeGatewayUrl` - Added [GuildFeatures](xref:DisCatSharp.Entities.GuildFeatures): - [GuildHomeTest](xref:DisCatSharp.Entities.GuildFeatures#DisCatSharp_Entities_GuildFeatures_GuildHomeTest) (Experimental) - [InvitesDisabled](xref:DisCatSharp.Entities.GuildFeatures#DisCatSharp_Entities_GuildFeatures_InvitesDisabled) - Implemented DiscordWebhookBuilder.WithThreadName to create forum posts via a webhook - Added [ApplicationFlags.ApplicationCommandBadge](xref:DisCatSharp.ApplicationFlags) - Added a bypassCache option to [DiscordChannel.GetMessageAsync](xref:DisCatSharp.Entities.DiscordChannel#DisCatSharp_Entities_DiscordChannel_GetMessageAsync_System_UInt64_System_Boolean_) - Added the new field `AppPermissions` to the interaction entity and the context entities. - Added function [DiscordGuild.EnableMfaAsync](xref:DisCatSharp.Entities.DiscordGuild#DisCatSharp_Entities_DiscordGuild_EnableMfaAsync_System_String_) - Added function [DiscordGuild.DisableMfaAsync](xref:DisCatSharp.Entities.DiscordGuild#DisCatSharp_Entities_DiscordGuild_DisableMfaAsync_System_String_)

-- Reworked component result for modal submits [*DC1](xref:important_changes_10_1_0#dc1) +- Reworked component result for modal submits [*DC1](xref:changelogs_v9_10_1_0#dc1) - Reworked [DiscordIntegration](xref:DisCatSharp.Entities.DiscordIntegration) to include the new fields - Added [SubscriberCount](xref:DisCatSharp.Entities.DiscordIntegration#DisCatSharp_Entities_DiscordIntegration_SubscriberCount) - Added [Revoked](xref:DisCatSharp.Entities.DiscordIntegration#DisCatSharp_Entities_DiscordIntegration_Revoked) - Added [Application](xref:DisCatSharp.Entities.DiscordIntegration#DisCatSharp_Entities_DiscordIntegration_Application) - Added [Scopes](xref:DisCatSharp.Entities.DiscordIntegration#DisCatSharp_Entities_DiscordIntegration_Scopes) - Removed int ExpireBehavior - Added [ExpireBehavior](xref:DisCatSharp.Entities.DiscordIntegration#DisCatSharp_Entities_DiscordIntegration_ExpireBehavior) as new enum [IntegrationExpireBehavior](xref:DisCatSharp.Enums.IntegrationExpireBehavior) - Reworked [DiscordConnection](xref:DisCatSharp.Entities.DiscordConnection) to include the new fields * Removed int Visibility * Added [Visibility](xref:DisCatSharp.Entities.DiscordConnection#DisCatSharp_Entities_DiscordConnection_Visibility) as new enum [ConnectionVisibilityType](xref:DisCatSharp.Enums.ConnectionVisibilityType) * Added [TwoWayLink](xref:DisCatSharp.Entities.DiscordConnection#DisCatSharp_Entities_DiscordConnection_TwoWayLink) - [DiscordClient.ReconnectAsync](xref:DisCatSharp.DiscordClient#DisCatSharp_DiscordClient_ReconnectAsync_System_Boolean_) param startNewSession now defaults to `true` - Moved guild related enums from the [DisCatSharp](xref:DisCatSharp) to the [DisCatSharp.Enums](xref:DisCatSharp.Enums) namespace - Fixed webhooks for threads - Dropped support for channel banners, it sadly never made its way into discord ### DisCatSharp.ApplicationCommands - Added support for slash commands in shards - Added Translation Generator & Exporter (see [here](xref:DisCatSharp.ApplicationCommands.ApplicationCommandsConfiguration#DisCatSharp_ApplicationCommands_ApplicationCommandsConfiguration_GenerateTranslationFilesOnly)) - Added [DiscordClient.RemoveGlobalApplicationCommandsAsync](xref:DisCatSharp.DiscordClient#DisCatSharp_DiscordClient_RemoveGlobalApplicationCommandsAsync) - Implemented support for minimum_length and maximum_length for application command options - Added [MinimumLengthAttribute](xref:DisCatSharp.ApplicationCommands.Attributes.MinimumLengthAttribute). Minimum `int` if set: 0. Valid for: `string` - Added [MaximumLengthAttribute](xref:DisCatSharp.ApplicationCommands.Attributes.MaximumLengthAttribute). Minimum `int` if set: 1. Valid for: `string` - Changed namespaces * [DisCatSharp.ApplicationCommands](xref:DisCatSharp.ApplicationCommands) * [DisCatSharp.ApplicationCommands.Attributes](xref:DisCatSharp.ApplicationCommands.Attributes) * [DisCatSharp.ApplicationCommands.Context](xref:DisCatSharp.ApplicationCommands.Context) * [DisCatSharp.ApplicationCommands.Exceptions](xref:DisCatSharp.ApplicationCommands.Exceptions) - Renamed MinimumAttribute to [MinimumValueAttribute](xref:DisCatSharp.ApplicationCommands.Attributes.MinimumValueAttribute). Valid for: `int`, `long` & `double` - Renamed MaximumAttribute & [MaximumValueAttribute](xref:DisCatSharp.ApplicationCommands.Attributes.MaximumValueAttribute). Valid for: `int`, `long` & `double` - Proper exception log when registering app commands fails - Reworked [translation](xref:modules_application_commands_translations_using) for application commands - Reworked application command registration - Fixed `DmPermissions` check for Application Commands on registration - Fixed double interaction bug - Fixed `int` > `long` cast exception - Fixed a bug where the default help command would not work if auto defer was enabled - Various bug fixes - Removed `ApplicationCommandsExtension.CleanGuildCommandsAsync()` - Removed `ApplicationCommandsExtension.CleanGlobalCommandsAsync()` ### DisCatSharp.Lavalink - Added support for apple music & spotify search ____ ## Other changes Please compare the commits on [GitHub](https://github.com/Aiko-IT-Systems/DisCatSharp/compare/10.0.0...v10.1.0) ## Information to other [Discord Features](https://discord.com/developers/docs/change-log) - We won't implement AutoMod for a while, as it takes a lot of time to implement and we don't have the time for it right now. - DiscordMember Timeout Events are still buggy, we have it on our list of bugs to fix, but it's not a priority right now. ## Diff Changes ### DC1 DiscordInteractionData: Pulled up the component results from modal submits for easier access ```diff - IEnumerable Options + IReadOnlyList Options - IEnumerable Components + IReadOnlyList Components ``` DiscordActionRowComponentResult: ```diff - List Components + IReadOnlyList Components ``` diff --git a/DisCatSharp.Docs/articles/important_changes/9_8_2.md b/DisCatSharp.Docs/changelogs/v9/9_8_2.md similarity index 99% rename from DisCatSharp.Docs/articles/important_changes/9_8_2.md rename to DisCatSharp.Docs/changelogs/v9/9_8_2.md index 091208108..d5841c9e6 100644 --- a/DisCatSharp.Docs/articles/important_changes/9_8_2.md +++ b/DisCatSharp.Docs/changelogs/v9/9_8_2.md @@ -1,135 +1,135 @@ --- -uid: important_changes_9_8_2 +uid: changelogs_v9_9_8_2 title: Version 9.8.2 --- # What changed? Discord [changed](https://discord.com/developers/docs/interactions/slash-commands) **SlashCommands** into **Application Commands** in favor of the new context menu stuff. You can read about it [here](https://discord.com/developers/docs/interactions/application-commands). ## Upgrade from **DisCatSharp.SlashCommands** to **DisCatSharp.ApplicationCommands** In **DisCatSharp.SlashCommands** you used Application Commands like this: ```cs // Usage directives using DisCatSharp.SlashCommands; using DisCatSharp.SlashCommands.EventArgs; // Extension public static SlashCommandsExtension Slash; // Injecting SlashCommands Client.UseSlashCommands(); Slash = Client.GetSlashCommands(); // Registration of commands and events Slash.SlashCommandErrored += Slash_SlashCommandErrored; Slash.SlashCommandExecuted += Slash_SlashCommandExecuted; Slash.RegisterCommands(); // Events public static Task Slash_SlashCommandExecuted(SlashCommandsExtension sender, SlashCommandExecutedEventArgs e) { Console.WriteLine($"Slash/Info: {e.Context.CommandName}"); return Task.CompletedTask; } public static Task Slash_SlashCommandErrored(SlashCommandsExtension sender, SlashCommandErrorEventArgs e) { Console.WriteLine($"Slash/Error: {e.Exception.Message} | CN: {e.Context.CommandName} | IID: {e.Context.InteractionId}"); return Task.CompletedTask; } // Commands using DisCatSharp; using DisCatSharp.Entities; using DisCatSharp.SlashCommands; using DisCatSharp.SlashCommands.Attributes; namespace TestBot.SlashCommands { internal class Main : SlashCommandModule { [SlashCommand("test", "A slash command made to test the DisCatSharp library!")] public static async Task TestCommand(InteractionContext ctx) { await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource); await Task.Delay(5000); await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("5 second delay complete!")); } } } ``` In **DisCatSharp.ApplicationCommands** you use them like this: ```cs // Usage directives using DisCatSharp.ApplicationCommands; using DisCatSharp.ApplicationCommands.EventArgs; // Extension public static ApplicationCommandsExtension ApplicationCommands; // Injecting SlashCommands Client.UseApplicationCommands(); ApplicationCommands = Client.GetApplicationCommands(); // Registration of commands and events ApplicationCommands.SlashCommandExecuted += Ac_SlashCommandExecuted; ApplicationCommands.SlashCommandErrored += Ac_SlashCommandErrored; /* New stuff - context menu */ ApplicationCommands.ContextMenuExecuted += Ac_ContextMenuExecuted; ApplicationCommands.ContextMenuErrored += Ac_ContextMenuErrored; ApplicationCommands.RegisterCommands(); // Events public static Task Ac_SlashCommandExecuted(ApplicationCommandsExtension sender, SlashCommandExecutedEventArgs e) { Console.WriteLine($"Slash/Info: {e.Context.CommandName}"); return Task.CompletedTask; } public static Task Ac_SlashCommandErrored(ApplicationCommandsExtension sender, SlashCommandErrorEventArgs e) { Console.WriteLine($"Slash/Error: {e.Exception.Message} | CN: {e.Context.CommandName} | IID: {e.Context.InteractionId}"); return Task.CompletedTask; } public static Task Ac_ContextMenuExecuted(ApplicationCommandsExtension sender, ContextMenuExecutedEventArgs e) { Console.WriteLine($"Slash/Info: {e.Context.CommandName}"); return Task.CompletedTask; } public static Task Ac_ContextMenuErrored(ApplicationCommandsExtension sender, ContextMenuErrorEventArgs e) { Console.WriteLine($"Slash/Error: {e.Exception.Message} | CN: {e.Context.CommandName} | IID: {e.Context.InteractionId}"); return Task.CompletedTask; } // Commands using DisCatSharp; using DisCatSharp.Entities; using DisCatSharp.Enums; using DisCatSharp.ApplicationCommands; using DisCatSharp.ApplicationCommands.Attributes; namespace TestBot.ApplicationCommands { internal class Main : ApplicationCommandsModule { [SlashCommand("test", "A slash command made to test the DisCatSharp library!")] public static async Task TestCommand(InteractionContext ctx) { await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource); await Task.Delay(5000); await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("5 second delay complete!")); } } } ``` diff --git a/DisCatSharp.Docs/articles/important_changes/9_8_3.md b/DisCatSharp.Docs/changelogs/v9/9_8_3.md similarity index 99% rename from DisCatSharp.Docs/articles/important_changes/9_8_3.md rename to DisCatSharp.Docs/changelogs/v9/9_8_3.md index 087aeee35..65c8ca737 100644 --- a/DisCatSharp.Docs/articles/important_changes/9_8_3.md +++ b/DisCatSharp.Docs/changelogs/v9/9_8_3.md @@ -1,74 +1,74 @@ --- -uid: important_changes_9_8_3 +uid: changelogs_v9_9_8_3 title: Version 9.8.3 --- # What changed? We [changed](https://canary.discord.com/channels/858089281214087179/858099438580006913/890973133148926004) the option to restrict channel types in Slash Commands to an extra Attribute named `ChannelTypes` in favor of the application command autocompletion. You can read about it [here](https://github.com/discord/discord-api-docs/pull/3849). ## Upgrade from **9.8.2** to **9.8.3** In **DisCatSharp.ApplicationCommands** you restricted channel types like this: ```cs [SlashCommand("openstage", "Opens a stage")] public static async Task OpenStageAsync(InteractionContext ctx, [Option("stage", "Stage Channel", ChannelType.Stage)] DiscordChannel stage, [Option("topic", "Topic of stage")] string topic, [Option("notify", "Whether to notify people")] bool notify = false, [Option("make_public", "Whether the stage channel will be public")] bool make_public = false) { try { await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource, new DiscordInteractionResponseBuilder().WithContent("Opening stage").AsEphemeral(true)); await stage.OpenStageAsync(topic, notify, make_public ? StagePrivacyLevel.PUBLIC : StagePrivacyLevel.GUILD_ONLY); await ctx.EditResponseAsync(new() { Content = "Stage channel has been successfully opened." }); } catch (Exception ex) { await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent(ex.Message + " " + ex.StackTrace)); } } ``` In **DisCatSharp.ApplicationCommands** you restrict channel types now like this: ```cs [SlashCommand("openstage", "Opens a stage")] public static async Task OpenStageAsync(InteractionContext ctx, [Option("stage", "Stage Channel"), ChannelTypes(ChannelType.Stage)] DiscordChannel stage, [Option("topic", "Topic of stage")] string topic, [Option("notify", "Whether to notify people")] bool notify = false, [Option("make_public", "Whether the stage channel will be public")] bool make_public = false) { try { await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource, new DiscordInteractionResponseBuilder().WithContent("Opening stage").AsEphemeral(true)); await stage.OpenStageAsync(topic, notify, make_public ? StagePrivacyLevel.PUBLIC : StagePrivacyLevel.GUILD_ONLY); await ctx.EditResponseAsync(new() { Content = "Stage channel has been successfully opened." }); } catch (Exception ex) { await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent(ex.Message + " " + ex.StackTrace)); } } ``` ## New function: Application Command Autocompletion: Examples: > Autocomplete Option: https://github.com/Aiko-IT-Systems/DisCatSharp.Examples/blob/main/ApplicationCommands/src/Commands/Tags.cs#L34 > Autocomplete Provider: https://github.com/Aiko-IT-Systems/DisCatSharp.Examples/blob/main/ApplicationCommands/src/Commands/Tags.cs#L168 Docs: https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.Attributes.AutocompleteAttribute.html https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.Attributes.IAutocompleteProvider.html https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplicationCommandAutocompleteChoice.html https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.OptionAttribute.html#DisCatSharp_ApplicationCommands_OptionAttribute__ctor_System_String_System_String_System_Boolean_ diff --git a/DisCatSharp.Docs/articles/important_changes/9_8_4.md b/DisCatSharp.Docs/changelogs/v9/9_8_4.md similarity index 99% rename from DisCatSharp.Docs/articles/important_changes/9_8_4.md rename to DisCatSharp.Docs/changelogs/v9/9_8_4.md index 1d0b6192f..b529d6221 100644 --- a/DisCatSharp.Docs/articles/important_changes/9_8_4.md +++ b/DisCatSharp.Docs/changelogs/v9/9_8_4.md @@ -1,136 +1,136 @@ --- -uid: important_changes_9_8_4 +uid: changelogs_v9_9_8_4 title: Version 9.8.4 --- # Upgrade from **9.8.3** to **9.8.4** ## What is new in #discatsharp? - Components - Scheduled Events - New Application Fields - A ExecuteRawRequest Method - Threads - Hosting Packages - New Templates - Better Guild Channel Operations - New Permissions - New Application Command Permission (Not v2 yet) - A new Logo :3 :heart: ## What changed? ### Threads We have fixed many bugs in threads over time, and they work completely now. - [DisCatSharp.Net.Models.ThreadEditModel](https://docs.dcs.aitsys.dev/api/DisCatSharp.Net.Models.ThreadEditModel.html) has a new field called [PerUserRateLimit](https://docs.dcs.aitsys.dev/api/DisCatSharp.Net.Models.ThreadEditModel.html#DisCatSharp_Net_Models_ThreadEditModel_PerUserRateLimit). - [DisCatSharp.Entities.DiscordThreadChannel](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordThreadChannel.html) now supports [DisCatSharp.Entities.DiscordThreadChannel#GetMemberAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordThreadChannel.html?q=DiscordThreadChannel#DisCatSharp_Entities_DiscordThreadChannel_GetMemberAsync_System_UInt64_) ### Components We support every Component available on the API. ### Discord Application Object [DiscordApplication](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplication.html) now includes the property fields: - [CustomInstallUrl](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplication.html#DisCatSharp_Entities_DiscordApplication_CustomInstallUrl) - [InstallParams](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplication.html#DisCatSharp_Entities_DiscordApplication_InstallParams) - [Tags](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordApplication.html#DisCatSharp_Entities_DiscordApplication_Tags) You can find the settings for these fields in the [Discord Developer Portal](https://discord.com/developers/applications). ### Scheduled Events The new scheduled events are already fully supported by us. **Entities:** - [DisCatSharp.Entities.DiscordScheduledEvent](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordScheduledEvent.html) - [DisCatSharp.Entities.DiscordScheduledEventEntityMetadata](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordScheduledEventEntityMetadata.html) - [DisCatSharp.Entities.DiscordScheduledEventUser](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordScheduledEventUser.html) **Emums:** - [DisCatSharp.ScheduledEventEntityType](https://docs.dcs.aitsys.dev/api/DisCatSharp.ScheduledEventEntityType.html) - [DisCatSharp.ScheduledEventStatus](https://docs.dcs.aitsys.dev/api/DisCatSharp.ScheduledEventStatus.html) **Events:** - [DisCatSharp.EventArgs.GuildScheduledEventCreateEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventCreateEventArgs.html) - [DisCatSharp.EventArgs.GuildScheduledEventUpdateEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventUpdateEventArgs.html) - [DisCatSharp.EventArgs.GuildScheduledEventDeleteEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventDeleteEventArgs.html) - [DisCatSharp.EventArgs.GuildScheduledEventUserAddEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventUserAddEventArgs.html) - [DisCatSharp.EventArgs.GuildScheduledEventUserRemoveEventArgs](https://docs.dcs.aitsys.dev/api/DisCatSharp.EventArgs.GuildScheduledEventUserRemoveEventArgs.html) **Models:** - [DisCatSharp.Net.Models.ScheduledEventEditModel](https://docs.dcs.aitsys.dev/events/api/DisCatSharp.Net.Models.ScheduledEventEditModel.html) **Extra Properties:** - [DisCatSharp.Entities.DiscordGuild#ScheduledEvents](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_ScheduledEvents) **Extra Methods:** - [DisCatSharp.Entities.DiscordGuild#CreateScheduledEventAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_CreateScheduledEventAsync_System_String_DateTimeOffset_System_Nullable_DateTimeOffset__DisCatSharp_Entities_DiscordChannel_DisCatSharp_Entities_DiscordScheduledEventEntityMetadata_System_String_DisCatSharp_ScheduledEventEntityType_System_String_) - [DisCatSharp.Entities.DiscordGuild#CreateExternalScheduledEventAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_CreateExternalScheduledEventAsync_System_String_DateTimeOffset_DateTimeOffset_System_String_System_String_System_String_) - [DisCatSharp.Entities.DiscordGuild#GetScheduledEventAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GetScheduledEventAsync_DisCatSharp_Entities_DiscordScheduledEvent_System_Nullable_System_Boolean__) - [DisCatSharp.Entities.DiscordGuild#GetScheduledEventsAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GetScheduledEventsAsync_System_Nullable_System_Boolean__) - [DisCatSharp.Entities.DiscordChannel#CreateScheduledEventAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_CreateScheduledEventAsync_System_String_DateTimeOffset_System_String_System_String_) ### Audit Log - [DisCatSharp.Entities.DiscordAuditLogGuildEntry](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAuditLogGuildEntry.html) has the new field [PremiumProgressBarChange](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAuditLogGuildEntry.html#DisCatSharp_Entities_DiscordAuditLogGuildEntry_PremiumProgressBarChange) - Added [DisCatSharp.Entities.DiscordAuditLogScheduledEventEntry](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAuditLogScheduledEventEntry.html) ### Enums We've updated some enums to reflect the [API Documentation](https://discord.com/developers/docs/intro) of Discord: - [DisCatSharp.PremiumTier](https://docs.dcs.aitsys.dev/api/DisCatSharp.PremiumTier.html) - [DisCatSharp.StagePrivacyLevel](https://docs.dcs.aitsys.dev/api/DisCatSharp.StagePrivacyLevel.html) - [DisCatSharp.UserFlags](https://docs.dcs.aitsys.dev/api/DisCatSharp.UserFlags.html) ### DisCatSharp.CommandsNext - `RequireDiscordEmployeeAttribute` is now `RequireStaffAttribute` - `RequireDiscordCertifiedModeratorAttribute` is now `RequireCertifiedModeratorAttribute` ### ExecuteRawRequest We added the [ExecuteRawRequestAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.DiscordClient.html#DisCatSharp_DiscordClient_ExecuteRawRequestAsync_RestRequestMethod_System_String_System_Object_System_String_Dictionary_System_String_System_String__System_Nullable_System_Double__) method. ### Better Guild Channel Operations We did some engineering in the Discord API to create a method which gets an [ordered channel dictionary](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_OrderedChannels). Furthermore, we added a few new functions to [DisCatSharp.Entities.DiscordGuild](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.): - [DisCatSharp.Entities.DiscordGuild#GetOrderedChannels](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GetOrderedChannels) - [DisCatSharp.Entities.DiscordGuild#GetOrderedChannelsAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GetOrderedChannelsAsync) And a couple more methods to [DisCatSharp.Entities.DiscordChannel](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel): - [DisCatSharp.Entities.DiscordChannel#GetMinPosition](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_GetMinPosition) - [DisCatSharp.Entities.DiscordChannel#GetMaxPosition](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_GetMaxPosition) - [DisCatSharp.Entities.DiscordChannel#ModifyPositionAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_ModifyPositionAsync_System_Int32_System_String_) - [DisCatSharp.Entities.DiscordChannel#RefreshPositionsAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_RefreshPositionsAsync) - [DisCatSharp.Entities.DiscordChannel#ModifyPositionInCategorySmartAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_ModifyPositionInCategoryAsync_System_Int32_System_String_) - [DisCatSharp.Entities.DiscordChannel#ModifyParentAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_ModifyParentAsync_DisCatSharp_Entities_DiscordChannel_System_Nullable_System_Boolean__System_String_) - [DisCatSharp.Entities.DiscordChannel#RemoveParentAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordChannel.html#DisCatSharp_Entities_DiscordChannel_RemoveParentAsync_System_String_) ### New Permissions - SendMessagesInThreads - StartEmbeddedActivities - ManageEvents ### New Application Command Permission (Not v2 yet) - [DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext#AddUser](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext.html#DisCatSharp_ApplicationCommands_ApplicationCommandsPermissionContext_AddUser_System_UInt64_System_Boolean_) - [DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext#AddRole](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext.html#DisCatSharp_ApplicationCommands_ApplicationCommandsPermissionContext_AddRole_System_UInt64_System_Boolean_) - [DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext#AddChannel](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsPermissionContext.html#DisCatSharp_ApplicationCommands_ApplicationCommandsPermissionContext_AddChannel_System_UInt64_System_Boolean_) ### New Templates We added a few templates for you: - [DisCatSharp.ProjectTemplates](https://github.com/Aiko-IT-Systems/DisCatSharp.ProjectTemplates) - [DisCatSharp.TemplateBot](https://github.com/Aiko-IT-Systems/DisCatSharp.TemplateBot) ### Hosting Packages You can run your bot as a hosted service now! If you're interested, check out this [article](https://docs.dcs.aitsys.dev/articles/basics/web_app.html). You can also check out our new [templates](https://docs.dcs.aitsys.dev/articles/basics/templates.html)! diff --git a/DisCatSharp.Docs/articles/important_changes/9_8_5.md b/DisCatSharp.Docs/changelogs/v9/9_8_5.md similarity index 99% rename from DisCatSharp.Docs/articles/important_changes/9_8_5.md rename to DisCatSharp.Docs/changelogs/v9/9_8_5.md index 286107fe7..26200ac55 100644 --- a/DisCatSharp.Docs/articles/important_changes/9_8_5.md +++ b/DisCatSharp.Docs/changelogs/v9/9_8_5.md @@ -1,171 +1,171 @@ --- -uid: important_changes_9_8_5 +uid: changelogs_v9_9_8_5 title: Version 9.8.5 --- # Upgrade from **9.8.4** to **9.8.5** ## What is new in DisCatSharp? - Enforced Naming Conventions - Reworked ApplicationCommands Module - Timeouts - RestClient - DisCatSharp.Common Extensions - Attachment manipulation and alt text - Modals - Slash Attachments ## What changed? ### ApplicationCommands Module First of all, the complete module was rewritten to be significant faster. We could decrease the application command startup to ~30 seconds. Before it was like 5 minutes for big bots. On startup, depending on the size, it can take a few minutes till application commands can be used. The lib automatically catches this during the startup and warns the user. We added `GuildCommands` & `GlobalCommands` to the [Application​Commands​Extension](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#properties). Every guild command will be added to [DiscordGuild.RegisteredApplicationCommands](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_RegisteredApplicationCommands) and the permissions to [DiscordGuild.GuildApplicationCommandPermissions](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_GuildApplicationCommandPermissions) Furthermore: - Instead of registering commands when the client is ready, it waits for all guilds to be downloaded. - The module now checks for existing commands and only executes API calls when needed. #### Default Help Module You can add `EnableDefaultHelp = false` in the [ApplicationCommandsConfiguration](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsConfiguration.html#DisCatSharp_ApplicationCommands_ApplicationCommandsConfiguration_EnableDefaultHelp) to disable the module. If not supplied, DisCatSharp automatically generates a global `/help` command. Many thanks to Will for adding this to our lib ❤️ ##### Example ```csharp DiscordClient.UseApplicationCommands(new ApplicationCommandsConfiguration() { EnableDefaultHelp = true }); ``` #### Permissions You can now set [global permissions](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsGlobalPermissionContext.html) ❤️ But we had to change the way the module works for it. The new methods for adding commands are now: - Global Commands ```csharp ApplicationCommandsExtension.RegisterGlobalCommands(perms => { perms.AddRole(some_cool_guild_id, some_cool_role_id, false); }); ``` - Guild Commands ```csharp ApplicationCommandsExtension.RegisterGuildCommands(some_cool_guild_id, perms => { perms.AddRole(some_cool_role_id, true); }); ``` #### Options & Attributes Discord supports integers as input but we only added `long` for some unknown reason. We added to the Option type [number](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommandOptionType.html) now `int`. #### Events We added the following events for you: - [ApplicationCommandsModuleReady](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#DisCatSharp_ApplicationCommands_ApplicationCommandsExtension_ApplicationCommandsModuleReady) Fired when the module finished the basic startup. - [ApplicationCommandsModuleStartupFinished](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#DisCatSharp_ApplicationCommands_ApplicationCommandsExtension_ApplicationCommandsModuleStartupFinished) Fired when all commands are registered. - [GuildApplicationCommandsRegistered](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#DisCatSharp_ApplicationCommands_ApplicationCommandsExtension_GuildApplicationCommandsRegistered) Fired when guild commands in a guild finished the registration. - [GlobalApplicationCommandsRegistered](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.ApplicationCommandsExtension.html#DisCatSharp_ApplicationCommands_ApplicationCommandsExtension_GlobalApplicationCommandsRegistered) Fired when global commands finished the registration. ### Timeouts #### Methods You have the following methods to use timeouts: - [DiscordGuild.TimeoutAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_TimeoutAsync_System_UInt64_System_DateTime_System_String_) - has three overloads - [DiscordGuild.RemoveTimeoutAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordGuild.html#DisCatSharp_Entities_DiscordGuild_RemoveTimeoutAsync_System_UInt64_System_String_) - [DiscordMember.TimeoutAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMember.html#DisCatSharp_Entities_DiscordMember_TimeoutAsync_System_DateTime_System_String_) - has three overloads - [DiscordMember.RemoveTimeoutAsync](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMember.html#DisCatSharp_Entities_DiscordMember_RemoveTimeoutAsync_System_String_) #### Properties We added a property called [CommunicationDisabledUntil](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMember.html#DisCatSharp_Entities_DiscordMember_CommunicationDisabledUntil) to [DiscordMember](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMember.html) #### Events (Unstable) We added the following events for timeouts: - [GuildMemberTimeoutAdded](https://docs.dcs.aitsys.dev/api/DisCatSharp.DiscordClient.html#DisCatSharp_DiscordClient_GuildMemberTimeoutAdded) Fired when a timeout gets added. - [GuildMemberTimeoutChanged](https://docs.dcs.aitsys.dev/api/DisCatSharp.DiscordClient.html#DisCatSharp_DiscordClient_GuildMemberTimeoutChanged) Fired when a timeout gets updated. - [GuildMemberTimeoutRemoved](https://docs.dcs.aitsys.dev/api/DisCatSharp.DiscordClient.html#DisCatSharp_DiscordClient_GuildMemberTimeoutRemoved) Fired when a timeout gets removed. #### Auditlogs You can find the documentation for the timeout auditlog [here](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAuditLogMemberUpdateEntry.html#DisCatSharp_Entities_DiscordAuditLogMemberUpdateEntry_AddedRoles). ### RestClient (Experimental) We exposed our internal http client as the property [RestClient](https://docs.dcs.aitsys.dev/api/DisCatSharp.BaseDiscordClient.html#DisCatSharp_BaseDiscordClient_RestClient) on [DiscordBaseClient](https://docs.dcs.aitsys.dev/api/DisCatSharp.BaseDiscordClient.html) ### DisCatSharp.Common We added the following RegEx to this extension: - [RegularExpressions.CommonRegEx](https://docs.dcs.aitsys.dev/api/DisCatSharp.Common.RegularExpressions.CommonRegEx.html) - [RegularExpressions.DiscordRegEx](https://docs.dcs.aitsys.dev/api/DisCatSharp.Common.RegularExpressions.DiscordRegEx.html) We use them mostly internally ### Attachments You can now set the alt text on your attachments! Visit the following docs for more infos: [DiscordMessageFile.Description](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordMessageFile.html#DisCatSharp_Entities_DiscordMessageFile_Description) [DiscordAttachment.Description](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordAttachment.html#DisCatSharp_Entities_DiscordAttachment_Description) Our last changelogs for that: ```diff + Added support for file description (aka. Alt Text) You can supply a description to {DiscordMessageBuilder|DiscordFollowupMessageBuilder|DiscordInteractionResponseBuilder|DiscordWebhookBuilder}.WithFile You can view the description property of files with {DiscordMessageFile|DiscordAttachment}.Description + Added function DiscordWebhookBuilder.KeepAttachments This allows you to add / modify & replace / keep attachments on DiscordWebhookBuilders. + Full support for attachment operations on messages, webhooks & interactions Methods are now ModifyAttachments, KeepAttachments & ClearAttachments ``` Snippet: ```csharp [Command("ufwd"), Description(Download a jpg file from an url and upload upload it to discord with a description (alt text).")] public async Task UploadFileWithDescriptionAsync(CommandContext ctx, [Description("Url of file")] string url, [RemainingText, Description("Description of file")] string description) { Uri uri = new(url); var stream = await ctx.Client.RestClient.GetStreamAsync(uri); DiscordMessageBuilder builder = new(); builder.WithFile("test.jpg", stream, false, description); await ctx.RespondAsync(builder); } ``` ## Additional Notes ### Users `DiscordClient.GetUserAsync` defaults now to `fetch=true`. ### Interaction Locales We already support the newly introduced `locale` and `guild_locale` fields on interactions! - [ApplicationCommands.BaseContext.Locale](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.BaseContext.html#DisCatSharp_ApplicationCommands_BaseContext_Locale) - [ApplicationCommands.BaseContext.GuildLocale](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.BaseContext.html#DisCatSharp_ApplicationCommands_BaseContext_GuildLocale) - [ApplicationCommands.AutocompleteContext.Locale](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.BaseContext.html#DisCatSharp_ApplicationCommands_AutocompleteContext_Locale) - [ApplicationCommands.AutocompleteContext.GuildLocale](https://docs.dcs.aitsys.dev/api/DisCatSharp.ApplicationCommands.BaseContext.html#DisCatSharp_ApplicationCommands_AutocompleteContext_GuildLocale) - [DiscordInteraction.Locale](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordInteraction.html#DisCatSharp_Entities_DiscordInteraction_Locale) - [DiscordInteraction.GuildLocale](https://docs.dcs.aitsys.dev/api/DisCatSharp.Entities.DiscordInteraction.html#DisCatSharp_Entities_DiscordInteraction_GuildLocale) ### Modals & Slash Attachments These who things are still in private beta sadly, but we added it already. Docs will be added on release from discord's side. ### Application Command Translations Wait.. this is a thing?! YES!!!! It's not yet released but I know that you love to see upcoming things. So feel free to take a look into [Articles](https://docs.dcs.aitsys.dev/articles/application_commands/translations/using.html). diff --git a/DisCatSharp.Docs/articles/important_changes/9_9_0.md b/DisCatSharp.Docs/changelogs/v9/9_9_0.md similarity index 96% rename from DisCatSharp.Docs/articles/important_changes/9_9_0.md rename to DisCatSharp.Docs/changelogs/v9/9_9_0.md index 001bc634d..21fb62bb4 100644 --- a/DisCatSharp.Docs/articles/important_changes/9_9_0.md +++ b/DisCatSharp.Docs/changelogs/v9/9_9_0.md @@ -1,22 +1,22 @@ --- -uid: important_changes_9_9_0 +uid: changelogs_v9_9_9_0 title: Version 9.9.0 --- # Upgrade from **9.8.6** to **9.9.0** ## What is new in DisCatSharp? - Slash Attachments - [DisCatSharp.Common.RegularExpressions](xref:DisCatSharp.Common.RegularExpressions) ## What changed? This will be a quick one: - [DiscordInvite](xref:DisCatSharp.Entities.DiscordInvite) has the property `InviteTarget` to support user invites. - A few NRE's where fixed - Guild scheduled events support uploading a cover image - [DiscordThreadChannel](xref:DisCatSharp.Entities.DiscordThreadChannel) has the new property `CreateTimestamp` - The AsEphemeral functions defaulting to `true` now - Slash Attachments fully works - You can let the [ApplicationCommandsModule](xref:DisCatSharp.ApplicationCommands.ApplicationCommandsModule) auto defer all responses diff --git a/DisCatSharp.Docs/docfx.json b/DisCatSharp.Docs/docfx.json index ffbedbf62..c238ec19c 100644 --- a/DisCatSharp.Docs/docfx.json +++ b/DisCatSharp.Docs/docfx.json @@ -1,263 +1,265 @@ { "metadata":[ { "src":[ { "src":"../DisCatSharp/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.Interactivity/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.Interactivity", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.Common/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.Common", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.Hosting/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.Hosting", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.Configuration/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.Configuration", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.ApplicationCommands/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.ApplicationCommands", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.CommandsNext/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.CommandsNext", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.Hosting.DependencyInjection/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.Hosting.DependencyInjection", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.Lavalink/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.Lavalink", "filter":"filter_config.yml" }, { "src":[ { "src":"../DisCatSharp.VoiceNext/", "files":[ "**.csproj" ], "exclude":[ "**/obj/**", "**/bin/**" ] } ], "dest":"api/DisCatSharp.VoiceNext", "filter":"filter_config.yml" } ], "build":{ "xrefService":[ "https://xref.docs.microsoft.com/query?uid={uid}" ], "content":[ { "files":[ "api/**/**.yml", "api/**/**.md", "api/**.yml", "api/**.md" ] }, { "files":[ "**.md", "toc.yml", "faq/**.yml", "faq/**.md", "articles/**.yml", "articles/**.md", + "changelogs/**.yml", + "changelogs/**.md", "natives/**.yml", "natives/**.md" ], "exclude":[ "**/bin/**", "**/obj/**", "_site/**", "dcs/**" ] } ], "resource":[ { "files":[ "images/**", "natives/**.zip" ], "exclude":[ "**/bin/**", "**/obj/**", "_site/**", "images/_**" ] } ], "overwrite":[ { "files":[ ], "exclude":[ "**/bin/**", "**/obj/**", "_site/**" ] } ], "dest":"_site", "globalMetadata":{ "_appTitle": "DisCatSharp Docs", "_appName": "DisCatSharp", "_appFooter": "Made with ♥ by AITSYS", "_copyrightFooter": "© Aiko IT Systems. All rights reserved.", "_enableSearch":true, "_disableSideFilter": false, "_enableNewTab":true, "_disableContribution": false, "_disableBreadcrumb": false, "_gitUrlPattern":"git", "_gitContribute":{ "repo":"https://github.com/Aiko-IT-Systems/DisCatSharp", "branch":"main" } }, "disableGitFeatures":false, "exportRawModel":true, "globalMetadataFiles":[ ], "fileMetadataFiles":[ ], "template":[ "dcs" ], "postProcessors":[ "ExtractSearchIndex", "CustomMemberIndexer" ], "noLangKeyword":false, "keepFileLink":false, "cleanupCacheHistory":false, "sitemap":{ "baseUrl":"https://docs.discatsharp.tech/", "changefreq":"daily", "priority":1.0 } } } diff --git a/DisCatSharp.Docs/toc.yml b/DisCatSharp.Docs/toc.yml index 31a3ef7fb..6c27a4a6f 100644 --- a/DisCatSharp.Docs/toc.yml +++ b/DisCatSharp.Docs/toc.yml @@ -1,8 +1,10 @@ - name: Articles href: articles/ +- name: Changelogs + href: changelogs/index.md - name: FAQ href: faq.md - name: API Documentation href: api/index.md - name: Voice Natives href: natives/index.md