Table of Contents

Upgrade from 10.3.0 to 10.4.0


Note

DisCatSharp is now compiled with .NET 7.0.

Important

The namespaces were adjusted to fit the actual location.


What Is New In DisCatSharp?


🆕 Added DisCatSharp Analyzer to help you write better code

🆕 Support for the new Username System

🆕 Support for Linked Roles

🆕 Support for Application Subscriptions aka Premium Apps

🆕 Support for Voice Messages

🆕 Support for sending @silent messages

🧪 Partial support for role subscriptions

🧪 Partial support for burst reactions

🧪 Partial support for onboarding

🛠️ Fixed a bug where various flag enums were missing the [Flags] annotation.


What Changed?


DisCatSharp

DiscordClient

➕ Added GenerateInAppOauthFor to generate an oauth link for other apps.

➕ Added GetCurrentApplicationInfoAsync to get the current application info.

➕ Added the GuildAuditLogEntryCreated to the DiscordClient. The implementation is currently unstable.

➕ Added AutoModerationConfiguration and AutoModerationExecution to DiscordIntent. This is included in AllUnprivileged and All.

➕ Added TryGetPublishedListings to get the published premium sku listings for an application.

⚠️ Removed GuildBans from DiscordIntents and replaced it with GuildModeration.

DiscordConfiguration

⚠️ Deprecated UseCanary & UsePtb.

➕ Added ApiChannel.

UseCanary & UsePtb temporarily set ApiChannel internally:

/// <summary>
///     <para>Sets the proxy to use for HTTP and WebSocket connections to Discord.</para>
///     <para>Defaults to <see langword="null" />.</para>
/// </summary>
public IWebProxy? Proxy { internal get; set; } = null;

/// <summary>
///     <para>Sets the timeout for HTTP requests.</para>
///     <para>Set to <see cref="System.Threading.Timeout.InfiniteTimeSpan" /> to disable timeouts.</para>
///     <para>Defaults to 20 seconds.</para>

DiscordApplication

➕ Added ApproximateGuildCount to get the approximate guild count.

➕ Added InteractionsEndpointUrl to get the interactions endpoint url set in the developer portal.

➕ Added RedirectUris to get the redirect uris set in the developer portal.

➕ Added Guild to get the guild this application is linked to as support server.

➕ Added support for application subscriptions. See this for more information.

➕ Added enum DisCatSharp.Enums.ApplicationCommandContexts. This field isn't added for now.

DiscordInteraction

➕ Added the options AsSilentMessage and SuppressEmbeds to DiscordFollowupMessageBuilder, DiscordInteractionResponseBuilder and DiscordWebhookBuilder.

➕ Added Entitlements to get the entitlements for premium apps.

➕ Added InteractionResponseType InteractionRequireEntitlement.

DiscordRole

➕ Added IsLinkedRole to DiscordRole.Tags to check whether this role is a linked role.

➕ Added SubscriptionListingId to DiscordRole.Tags to get the subscription listing id.

➕ Added AvailableForPurchase to DiscordRole.Tags to check whether this role is available for purchase.

DiscordGuild

➕ Added SafetyAlertsChannel to get the safety alerts channel and the corresponding function ModifySafetyAlertsSettingsAsync to modify the safety alerts settings.

AutomodRule

➕ Added MentionRaidProtectionEnabled to AutomodTriggerMetadata.

➕ Added TriggerType EnforceServerRules. This is currently in alpha.

DiscordChannel

➕ Added scheduledEventId to DiscordChannel.OpenStageAsync to create a stage channel bound to a scheduled event.

➕ Added new ChannelFlags:

  • IsBroadcasting
  • IsRoleSubscriptionTemplatePreviewChannel
  • ApplicationShelfConsent
  • SummariesDisabled
  • IsMediaChannel
  • IsScheduledForDeletion
  • ClydeAi
  • IsGuildResourceChannel
  • IsSpam

⚠️ Removed privacyLevel from DiscordChannel.OpenStageAsync as it's no longer supported by discord.

DiscordThreadChannel

➕ Added LockAsync to lock a thread.

➕ Added UnlockAsync to unlock a thread.

➕ You can now pin posts in forum channels.

Thread members are now paginated.

⚠️ Deprecated parameter locked from ArchiveAsync as it's no longer supported by discord.

DiscordMessage

➕ Added support for voice messages. Flag IsVoiceMessage is set to represented if the message is a voice message.

➕ Added new MessageTypes:

  • PrivateChannelIntegrationAdded
  • PrivateChannelIntegrationRemoved
  • PremiumReferral

DiscordAttachment

➕ Added DurationSecs to get the duration of a voice message.

➕ Added WaveForm to get the waveform of a voice message. This is a base64 encoded byte-array representing a sampled waveform.

DiscordReaction

Warning

Reactions are undergoing a rework which is not covered in this release.

🧪 Partial support for burst reactions.

DiscordUser

➕ Added CreateDmChannelAsync to create a dm channel with this user.

➕ Added SendMessageAsync to send a message to this user.

➕ Added Collaborator and RestrictedCollaborator to UserFlags to check whether this user is a collaborator.

➕ Added support for the new Username System. See this for more information.

➕ Added GlobalName to get the global name of this user.

➕ Added UsernameWithGlobalName to get the username with the global name of this user.

➕ Added IsMigrated to check whether this user is migrated to the new Username System.

🛠️ Fixed a bug causing Locale to be null.

⚠️ Deprecated UsernameWithDiscriminator.

⚠️ Deprecated Discriminator.

DiscordMember

➕ Added method VerifyAsync to verify a member. This skips the verification requirements when onboarding is enabled.

➕ Added method UnverifyAsync to unverify a member.

➕ Added new MemberFlags:

  • BypassesVerification
  • StartedOnboarding
  • CompletedOnboarding
  • IsGuest
  • StartedHomeActions
  • CompletedHomeActions
  • AutomodQuarantinedUsernameOrGuildNickname
  • AutomodQuarantinedBio

DiscordInvite

➕ Added new TargetTypes.

➕ Added new InviteFlags.

Permissions

➕ Added CreateGuildExpressions

➕ Added CreateEvents

➕ Added UseSoundboard

➕ Added UseExternalSounds

➕ Added SendVoiceMessages

⚠️ Renamed ManageExpressions to ManageGuildExpressions

⚠️ Removed ManageEmojisAndStickers

Formatter

🛠️ All methods are now extension methods.

➕ Added support for extended markdown.

DisCatSharp.ApplicationCommands

➕ You can now register guild commands via assembly. This doesn't support translations tho.

➕ Added Entitlements to BaseContext.

➕ Added support for application subscriptions.

➕ Added ApplicationCommandRequireEntitlementAttribute to require an entitlement to execute a command.

🛠️ Fixed a bug preventing you to set DmPermission for ContextMenu commands.

DisCatSharp.VoiceNext

🛠️ Fixed the ip discovery used to connect to discord voice servers.

Discord changed this suddenly without heads up.

Thanks to disgo for helping out.


Username System Change


Official resources:


Application Subscription


We would like to announce that we have added partial support for Discord's Premium Apps feature. However, please note that this feature is currently in alpha and may not be fully supported by our library as library developers don't get access to the documentation for it.

Premium Apps allow developers to provide premium commands for which users can subscribe via in-app purchases. If a user is not subscribed, bots will respond with a message asking them to subscribe. If they are subscribed, the command payload from Discord to the bot will have a SKU ID set, indicating that the user or server is subscribed.

Although our library has implemented support for this feature, you might need to make adjustments to your code to fully utilize it. If you encounter any issues or require assistance, please inform us so that we can address the issue within the library.


Pull Requests

Full Changes


Contributors


Special Thanks

This release special thanks go to:

  • snek for helping out with details about the premium apps implementation 😝
  • TopiSenpai for helping out with fixing the ip discovery
  • quinchs for advising a good change I (Lala) totally forgot about
  • JuliaJJ for helping out with design choice