Table of Contents

Upgrade from 10.1.0 to 10.2.0

What is new in DisCatSharp?

This release contains changes from Hacktoberfest tasks.

What changed?

We worked hard during hacktober to make the lib better. Here's what we did:


10.2.0-hacktober-001

Changelog

+ Added stickers to guild preview (Task 3)

Pull Requests

Contributors


10.2.0-hacktober-002

* 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

Contributors

New Articles


10.2.0-hacktober-003

* Reworked various thinks like lists, arrays, namespaces

Pull Requests

Contributors


10.2.0-hacktober-004

+ Added DiscordClient.GetGuildWidgetAsync
+ Added DiscordClient.TryGetGuildWidgetAsync
* Fixed a bug in guild widgets

Pull Requests

Contributors


10.2.0-hacktober-005

* Fixed the presence update event
- Removed PresenceUpdateEventArgs.UserBefore
- Removed PresenceUpdateEventArgs.UserAfter

Contributors


10.2.0-hacktober-006

* Fixed ModifyCommunitySettingsAsync (channels are now required to set when modifying the community state)

Pull Requests

Contributors


10.2.0-hacktober-007

* 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

Contributors


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.

- 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:

Enums

DisCatSharp.Interactivity

InteractivityExtension:

Message Extension:

Example

[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

Contributors


10.2.0-hacktober-010

+ Added method to look up additional infos about applications (rpc endpoint)

Documentation

Contributors