diff --git a/DisCatSharp.Docs/changelogs/toc.yml b/DisCatSharp.Docs/changelogs/toc.yml index 52dd01a6e..82a5529bf 100644 --- a/DisCatSharp.Docs/changelogs/toc.yml +++ b/DisCatSharp.Docs/changelogs/toc.yml @@ -1,22 +1,24 @@ - name: Changelog Intro href: index.md - name: Changelogs items: - name: Version 10.X items: + - name: \[PRE\] Version 10.2.0 + href: v10/10_2_0.md - 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.9.0 href: v9/9_9_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/changelogs/v10/10_2_0.md b/DisCatSharp.Docs/changelogs/v10/10_2_0.md new file mode 100644 index 000000000..e1918f349 --- /dev/null +++ b/DisCatSharp.Docs/changelogs/v10/10_2_0.md @@ -0,0 +1,188 @@ +--- +uid: changelogs_v10_10_2_0 +title: [PRE] Version 10.2.0 +--- + +# Upgrade from **10.1.0** to **10.2.0-hacktober** + +## What is new in DisCatSharp? +This release contains changes from Hacktoberfest tasks. + +## What changed? + +> [!WARNING] + > The changelog isn't complete yet due to Hacktoberfest + +____ + +### 10.2.0-hacktober-001 + +#### Changelog +```diff ++ Added stickers to guild preview (Task 3) +``` + +#### Pull Requests +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/206 + +#### Contributors +- [Mira](https://github.com/TheXorog) + +____ + +### 10.2.0-hacktober-002 + +```diff +* Reworked activity invite creation +* Fixed forum channel creation, it now actually creates a forum (type 15) channel ++ Added article for available activities *1 +``` + +#### Pull Requests +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/208 +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/209 + +#### Contributors +- [Sh1be](https://github.com/xMaxximum) +- [Lulalaby](https://github.com/Lulalaby) + +#### New Articles +- [Voice Activities](xref:misc_voice_activities) + +____ + +### 10.2.0-hacktober-003 + +```diff +* Reworked various thinks like lists, arrays, namespaces +``` + +#### Pull Requests +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/210 + +#### Contributors +- [Lulalaby](https://github.com/Lulalaby) + +____ + +### 10.2.0-hacktober-004 + +```diff ++ Added DiscordClient.GetGuildWidgetAsync ++ Added DiscordClient.TryGetGuildWidgetAsync +* Fixed a bug in guild widgets +``` + +#### Pull Requests +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/211 +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/212 + +#### Contributors +- [Mira](https://github.com/TheXorog) + +____ + +### 10.2.0-hacktober-005 + +```diff +* Fixed the presence update event +- Removed PresenceUpdateEventArgs.UserBefore +- Removed PresenceUpdateEventArgs.UserAfter +``` + +#### Contributors +- [Lulalaby](https://github.com/Lulalaby) + +____ + +### 10.2.0-hacktober-006 + +```diff +* Fixed ModifyCommunitySettingsAsync (channels are now required to set when modifying the community state) +``` + +#### Pull Requests +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/213 + +#### Contributors +- [Sh1be](https://github.com/xMaxximum) + +____ + +### 10.2.0-hacktober-007 + +```diff +* Reworked guild features +* Changed the HasXy methods to flags (Enums) ++ Created a method for the enum named HasFeature(GuildFeatureFlag) ++ Created a method for the guild features to dynamically generate a string list of features +``` + +#### Pull Requests +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/214 + +#### Contributors +- [Sh1be](https://github.com/xMaxximum) + +____ + +### 10.2.0-hacktober-008 + +> [!WARNING] + > This version contains breaking changes + +#### Note +This version adds support for user, role, channel & mentionable selects in both the main lib as well in interactivity. + +```diff +- DiscordSelectComponent was removed and replaced by ++ DiscordStringSelectComponent + DiscordStringSelectComponentOption ++ Select component types have the base class DiscordBaseSelect from now on +* Interactivity for selects where changed in the InteractivityExtension, as well in the MessageExtension to have an additional required parameter before the timeout override called selectType. You need to specify for which select type you're waiting for +``` + +#### Documentation + +##### DisCatSharp Package + +Entities: +- [DiscordBaseSelectComponent](xref:DisCatSharp.Entities.DiscordBaseSelectComponent) > and the sub classes +[DiscordStringSelectComponentOption](xref:DisCatSharp.Entities.DiscordStringSelectComponentOption) (Replaces `DiscordSelectComponentOption`) + +Enums +- [ComponentType](xref:DisCatSharp.Enums.ComponentType) + +##### DisCatSharp.Interactivity + +InteractivityExtension: +- [WaitForSelectAsync](xref:DisCatSharp.Interactivity.InteractivityExtension#DisCatSharp_Interactivity_InteractivityExtension_WaitForSelectAsync_DisCatSharp_Entities_DiscordMessage_DisCatSharp_Entities_DiscordUser_System_String_DisCatSharp_Enums_ComponentType_CancellationToken_) and additional functions + +Message Extension: +- [WaitForSelectAsync](xref:DisCatSharp.Interactivity.Extensions.MessageExtensions#DisCatSharp_Interactivity_Extensions_MessageExtensions_WaitForSelectAsync_DisCatSharp_Entities_DiscordMessage_DisCatSharp_Entities_DiscordUser_System_String_DisCatSharp_Enums_ComponentType_CancellationToken_) and additional functions + +#### Example +```cs +[SlashCommand(name: "test_select", description: "Testing select")] +public static async Task TestSelectAsync(InteractionContext ctx) +{ + await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource, new DiscordInteractionResponseBuilder().AsEphemeral()); + DiscordWebhookBuilder builder = new(); + builder.WithContent(content: "Testing user select"); + builder.AddComponents(new DiscordUserSelectComponent(label: "User to select", custom_id: "select_test_001", min_options: 1, max_options: 2, disabled: false)); + var msg = await ctx.EditResponseAsync(builder); + var inter = await ctx.Client.GetInteractivity().WaitForSelectAsync(message: msg, id: "select_test_001", selectType: ComponentType.UserSelect, timespan: TimeSpan.FromSeconds(30)); + if (!inter.TimedOut) + { + await inter.Result.Interaction.CreateResponseAsync(InteractionResponseType.DeferredMessageUpdate); + await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent(content: $"Selected {string.Join(" & ", inter.Result.Values)}")); + await ctx.Channel.SendMessageAsync(content: $"Ping pong {string.Join(" & ", inter.Result.Interaction.Data.Resolved.Users.Values.Select(x => x.Mention))}"); + } +} +``` + +#### Pull Requests +- https://github.com/Aiko-IT-Systems/DisCatSharp/pull/218 + +#### Contributors +- [Lulalaby](https://github.com/Lulalaby) +- [Mira](https://github.com/TheXorog)