Skip to content

Releases: Francessco121/Discore

v5.0.1

22 Mar 05:18
5e03ef8

Choose a tag to compare

This patch updates the voice connection process to use the newer form of IP discovery. The old way was deprecated some time ago and stopped working recently.

Fixes

  • Fixed voice IP discovery.

NuGet

Version 5.0.1 can be downloaded via NuGet here.

v5.0.0

31 Jan 04:19
43fdd89

Choose a tag to compare

Welcome to Discore v5!

Discore v5 includes a decent amount of changes. Please review the 4.x to 5.x migration guide and the changelog below.

Breaking Changes

  • Discore now targets .NET 6.0.
  • Discord entities (such as DiscordMessage) no longer keep a reference to a DiscordHttpClient internally and therefore no longer have methods for modifying the entity.
    • All removed methods were just shortcuts for DiscordHttpClient calls and can be migrated by just using a DiscordHttpClient instead (ex. DiscordMessage.Edit() -> DiscordHttpClient.EditMessage(DiscordMessage)).
  • Caching breaking changes:
    • DiscordShardCache has been replaced with the new Discore.Caching.DiscordMemoryCache.
    • Shard.Cache was removed in favor of making caching optional for Gateway connections. To get built-in caching behavior back, instantiate the new DiscordMemoryCache with your Shard. The new DiscordMemoryCache object has a nearly identical interface to the old DiscordShardCache.
    • DM channels are no longer cached since the Gateway no longer sends 'Channel Create' events for DMs as of v8.
  • IDiscordGateway breaking changes:
    • Events have been renamed to be more consistent. All new event names follow the pattern OnEventName (e.g. OnMessageCreated was renamed to OnMessageCreate).
    • Events now emit unique event args per event instead of some events sharing arg types (arg class names now follow the pattern EventNameEventArgs).
    • OnMessageUpdated now emits a DiscordPartialMessage instead of a normal DiscordMessage.
    • OnGuildAvailable and OnGuildUnavailable were merged into OnGuildCreate and OnGuildDelete. To see whether the guild availability status changed, use the new BecameAvailable and Unavailable properties in the event args.
    • OnDMChannel* events were removed (bots no longer receive events for DM channels as of Gateway v8).
    • OnChannel* events now emit a DiscordChannel instead of a DiscordGuildChannel (matches the actual Gateway spec).
    • UpdateStatusAsync was renamed to UpdatePresenceAsync.
  • Voice breaking changes:
    • Voice connections are now decoupled from Shard instances.
    • Removed DiscordVoiceConnection.Shard.
    • Removed ShardVoiceManager (use the new DiscordVoiceConnection constructors instead).
    • Removed VoiceConnectionEventArgs.Shard.
    • Removed VoiceConnectionInvalidationReason.BotRemovedFromGuild (this case is now just a normal invalidation).
    • Removed Shard.Voice.
  • Shard.StartAsync now requires either a GatewayIntent or ShardStartConfig argument.
  • Renamed DiscordGame to DiscordActivity (to match Gateway v8 changes).
  • Renamed DiscordGameType to DiscordActivityType (to match Gateway v8 changes).
  • Removed DiscordUserPresence.Game (use Activities.FirstOrDefault() instead).
  • Renamed StatusOptions to PresenceOptions.
    • PresenceOptions now takes a list of activities instead of a single Game.
  • Renamed GameOptions to ActivityOptions.
  • DiscordVoiceConnection.SetSpeakingAsync will now throw an InvalidOperationException if called before being fully connected.
  • DiscordVoiceConnection.ClearVoiceBuffer will now throw an InvalidOperationException if called before being fully connected.
  • DiscordVoiceConnection.ConnectAsync no longer checks if the application is allowed to join the voice channel. If the application is not allowed to join the connection will still fail, but it will be attempted.
    • To get this functionality back, please use the new DiscordPermissionHelper.CanJoinVoiceChannel helper function.
  • DiscordHttpRateLimitException.Limit is now nullable.
  • DiscordHttpRateLimitException.Reset is now nullable.
  • DiscordHttpRateLimitException.ResetHighPrecision is now nullable.
  • ShardStartConfig.GatewayLargeThreshold now defaults to the Gateway's default of 50 (down from 250).
  • DiscordHttpErrorCode.TooManyReactions renamed to MaximumReactionsReached.
  • DiscordHttpRateLimitException.RetryAfter is now a double and includes millisecond precision.
  • Guild embeds are replaced with guild widgets (API v8 change):
    • Removed DiscordGuild.IsEmbedEnabled and EmbedChannelId (use IsWidgetEnabled and WidgetChannelId instead).
    • Renamed DiscordGuildEmbed to DiscordGuildWidgetSettings.
    • Renamed DiscordHttpErrorCode.EmbedDisabled to WidgetDisabled.
    • Renamed ModifyGuildEmbedOptions to ModifyGuildWidgetOptions.
    • Renamed DiscordHttpClient.GetGuildEmbed to GetGuildWidget.
    • Renamed DiscordHttpClient.ModifyGuildEmbed to ModifyGuildWidget.
  • Removed deprecated ShardFailureReason.IOError
  • DiscordHttpClient.BeginGuildPrune now returns null if computePruneCount is true.
  • Renamed Create/EditMessageOptions.Embed to Embeds to support multiple embeds per message.
  • DiscordHttpClient.Create/EditMessage file attachment overloads have been removed. Instead, please use the new Attachments property of Create/EditMessageOptions.
  • Removed DiscordHttpClient.UseSingleHttpClient (it's no longer needed).
  • Removed deprecated DiscordHttpClient.GetUserDMs.
  • Shard.OnReconnected is now fired at the end of reconnection (as probably expected), rather than the start. This is still guaranteed to be fired before OnReady.
  • Create/ModifyGuildOptions.VerificationLevel is now type GuildVerificationLevel.
  • Create/ModifyGuildOptions.DefaultMessageNotifications is now type GuildNotificationOption.
  • Removed deprecated/removed DiscordVoiceRegion properties (SampleHostname, SamplePort, IsVIPOnly).
  • DiscordEmbed.Color is now type DiscordColor.
  • Renamed DiscordUser.HasTwoFactorAuth to MfaEnabled.
  • DiscordIntegration.ExpireBehavior is type IntegrationExpireBehavior.
  • DiscordInvite changes:
    • Renamed TargetUserType to TargetType.
    • Channel is now nullable.
    • Inviter is now a property of DiscordInvite instead of DiscordInviteMetadata (should only break reflection).
  • Removed DiscordInviteMetadata.IsRevoked.
  • Renamed DiscordInviteChannel.ChannelId to Id.
  • Renamed DiscordInviteGuild.GuildId to Id.
  • Renamed DiscordInviteTargetUserType to DiscordInviteTargetType.
  • Removed ShardVoiceManager.GetUsersInVoiceChannel (please use DiscordMemoryCache.GetUsersInVoiceChannel instead).
  • Removed DiscordGuild.RegionId (deprecated).
  • Removed DiscordPermissionException (was no longer thrown from any normal APIs).
  • Removed DiscordPermissionHelper.AssertPermission (applications should make their own assert helpers using HasPermission).

Additions

  • Added support for creating and editing messages with multiple embeds and/or multiple attachments.
  • Added support for Gateway intents.
    • Intents can be specified using ShardStartConfig.Intents or Shard.StartAsync(GatewayIntent).
  • Added Create/EditMessageOptions.Flags.
  • Added DiscordAttachment.Description.
  • Added DiscordAttachment.ContentType.
  • Added DiscordAttachment.Ephemeral.
  • Added Shard.OnDisconnected.
  • Added ShardFailureReason.InvalidIntents.
  • Added ShardFailureReason.DisallowedIntents.
  • Added DiscordHttpApiException.Errors.
  • Added DiscordHttpRateLimitException.Bucket.
  • Added DiscordVoiceConnection.SetSpeakingAsync overload to take new SpeakingFlag parameter for more specific speaking states.
  • Added DiscordVoiceConnection constructors for creating a connection from a shard or a voice bridge.
  • Added a DiscordVoiceConnection.ConnectAsync parameter for changing the connection timeout period.
  • Added IDiscordGateway.OnVoiceServerUpdate event.
  • Added IDiscordGateway.UpdateVoiceStateAsync.
  • Added MemberSpeakingEventArgs.SpeakingFlag.
  • Added DiscordMessage.GuildId.
  • Added IDiscordGuildMember base interface.
  • Added more flexible DiscordPermissionHelper.HasPermission overload.
  • Added DiscordPermissionHelper.CanJoinVoiceChannel.
  • Added DiscordPermissionHelper.PermissionsToString.
  • Added VoiceConnectionInvalidationReason.DllNotFound.

Changes

  • Discore now fully annotates nullable reference types!
  • Discore now supports Discord API/Gateway v10.
  • Discore now supports voice Gateway v4.
  • DiscordGuildVoiceChannel now implements ITextChannel to support guild voice text chat.
  • Snowflake now implements IEquatable<Snowflake>.
  • DiscordCdnUrl now implements IEquatable<DiscordCdnUrl>.
  • Removed dependency on Newtonsoft.Json.

Bug Fixes

  • Fixed race condition that occurred when the application is kicked from a voice channel.
  • Fixed DiscordWebSocketException not containing an InnerException when one was provided.
  • Miscellaneous internal bug fixes found thanks to nullable reference type annotations.

NuGet

Version 5.0.0 can be downloaded via NuGet here.

v4.5.0

10 Dec 01:31
5cf2110

Choose a tag to compare

This release adds support for some small newer Discord API features, such as getting custom user statuses and creating reply messages.

New Message Create/Edit Options (#85)

  • Added AllowedMentions property to CreateMessageOptions and EditMessageOptions for avoiding accidental mentions in messages.
  • Added CreateMessageOptions.MessageReference for creating reply messages.
  • Added new DiscordMessageFlags:
    • SourceMessageDeleted
    • Urgent
    • HasThread
    • Ephemeral
    • Loading

New DiscordGame (Activity) Properties (#92)

Information such as custom user statuses and rich presence details can now be read.

  • Added new DiscordGame properties:
    • CreatedAt
    • Timestamps
    • ApplicationId
    • Details
    • State
    • Emoji
    • Party
    • Assets
    • Secrets
    • Instance
    • Flags
    • Buttons
  • Added new DiscordGameTypes:
    • Listening
    • Watching
    • Custom
    • Competing

New GuildPrune Parameters (#84)

  • Added includeRoles parameter to GetGuildPruneCount and BeginGuildPrune for pruning users with specific roles.
  • Added computePruneCount parameter to BeginGuildPrune to allow reduced execution time for large guilds.
  • The days parameter of GetGuildPruneCount and BeginGuildPrune is now nullable (when null Discord will use their own default).

New CDN URL Builders (#95)

  • Added new static DiscordCdnUrl builders and their DiscordCdnUrlTypes:
    • ApplicationCover
    • ApplicationAsset
    • AchievementIcon
    • StickerPackBanner
    • TeamIcon
    • Sticker
    • RoleIcon

NuGet

Version 4.5.0 can be downloaded via NuGet here.

v4.4.1

21 Mar 19:22
f5eba41

Choose a tag to compare

This patch addresses issues with stopping Shards. Calling Shard.StopAsync will now behave as expected. (#82)

Fixes

  • DiscordClientWebSocket no longer erroneously sends a close acknowledgment when receiving a remote close after starting a close itself locally.
  • GatewaySocket no longer erroneously attempts to reconnect when receiving a remote close after starting a close itself locally.

NuGet

Version 4.4.1 can be downloaded via NuGet here.

v4.4.0

05 Sep 16:57

Choose a tag to compare

Update For Discord API Domain Migration (#79)

On November 7, 2020 Discord will be dropping support for the discordapp.com domain in favor of the new discord.com domain. Notably however, the CDN will not be changing domains. This update includes internal changes to address this migration.

API calls through Discore versions below 4.4.0 will cease to work on November 7, 2020.
CDN URLs produced by Discore will continue to work.

User Presence Additions (#75)

  • Added DiscordUserPresence.Activities.
  • Added DiscordUserPresence.ClientStatus.

NuGet

Version 4.4.0 can be downloaded via NuGet here.

v4.3.1

16 Oct 23:19

Choose a tag to compare

This patch addresses the overlooked implementation for news and store channels as well as other miscellaneous bug fixes.

Fixes

  • Added missing DiscordGuildNewsChannel and DiscordGuildStoreChannel classes.
  • Added missing DiscordHttpClient methods: ModifyNewsChannel and ModifyStoreChannel.
  • Added missing DiscordShardCache methods: GetGuildNewsChannel and GetGuildStoreChannel.
  • Fixed IDiscordGateway.OnGuildChannelCreated not firing for category, news, and store channels.
  • Fixed IDiscordGateway.OnGuildChannelUpdated not firing for news and store channels.
  • Fixed IDiscordGateway.OnGuildChannelRemoved not firing for news and store channels.
  • Fixed DiscordShardCache never containing news and store channels.
  • Fixed DiscordChannel.IsGuildChannel returning false for news and store channels.
  • Fixed DiscordGuildMember.GuildId being an empty snowflake when the member was retrieved from a DiscordHttpClient.

NuGet

Version 4.3.1 can be downloaded via NuGet here.

v4.3.0

03 Oct 21:20

Choose a tag to compare

Additions

New Channel Types (#64)

  • Added DiscordChannelType.GuildNews
  • Added DiscordChannelType.GuildStore

New Invite Properties (#58)

  • Added DiscordInvite.TargetUser
  • Added DiscordInvite.TargetUserType
  • Added DiscordInvite.ApproximatePresenceCount
  • Added DiscordInvite.ApproximateMemberCount
  • Added new enum DiscordInviteTargetUserType

New GetInvite Parameter

DiscordHttpClient.GetInvite now has a new optional parameter withCounts, which when specified as true will return a DiscordInvite with both ApproximatePresenceCount and ApproximateMemberCount filled out.

New Guild Properties (#62)

  • Added DiscordGuild.MaxPresences
  • Added DiscordGuild.MaxMembers
  • Added DiscordGuild.VanityUrlCode
  • Added DiscordGuild.Description
  • Added DiscordGuild.Banner
  • Added DiscordGuild.PremiumTier
  • Added DiscordGuild.PremiumSubscriptionCount
  • Added new enum GuildPremiumTier
  • Added DiscordCdnUrl.ForGuildBanner
  • Added DiscordCdnUrlType.GuildBanner

Constants For Guild Features (#63)

  • A new static class is available named DiscordGuildFeature which contains constants for each guild feature such as "ANIMATED_ICON".
  • Added DiscordGuild.HasFeature as an alternative to searching DiscordGuild.Features

New Message Metadata (#65)

  • Added DiscordMessage.Member
  • Added DiscordMessage.MentionedChannels (note: this is only available for crossposted messages)
  • Added DiscordMessage.Activity
  • Added DiscordMessage.Application
  • Added DiscordMessage.MessageReference
  • Added DiscordMessage.Flags
  • Added new enum DiscordMessageActivityType
  • Added new enum DiscordMessageFlags
  • Added new class DiscordChannelMention
  • Added new class DiscordMessageActivity
  • Added new class DiscordMessageApplication
  • Added new class DiscordMessageMember
  • Added new class DiscordMessageReference

New Message Types (#66)

  • Added DiscordMessageType.UserPremiumGuildSubscription
  • Added DiscordMessageType.UserPremiumGuildSubscriptionTier1
  • Added DiscordMessageType.UserPremiumGuildSubscriptionTier2
  • Added DiscordMessageType.UserPremiumGuildSubscriptionTier3
  • Added DiscordMessageType.ChannelFollowAdd

Guild Member Permission Extensions (#67)

All of the existing methods in DiscordPermissionHelper are now available as extension methods off of DiscordGuildMember.

  • Added ext DiscordGuildMember.HasPermission
  • Added ext DiscordGuildMember.AssertPermission

Changes

Deprecated API For Listing Open DM Channels

Bots have not been able to use API features related to listing open DM channels for a while now.

  • Deprecated DiscordHttpClient.GetUserDMs

Deprecated OAuth2-only User Properties

Bots never had access to some user properties that have been in Discore for a while, these are now deprecated. If Discore ever adds full support for OAuth2 applications, these will come back. For now, since these properties will always be null, they will be marked as obsolete as a warning that they shouldn't be relied upon currently.

  • Deprecated DiscordUser.HasTwoFactorAuth
  • Deprecated DiscordUser.IsVerified
  • Deprecated DiscordUser.Email

Rate Limit Improvements (#55, #57)

  • Discore now correctly handles rate-limit buckets, this will further reduce the chance 429 encounters
  • All API requests now take advantage of the new millisecond precision for rate-limit timestamps

Miscellaneous

  • Discore will now log a warning if a Gateway connection ends up with different shard information than what was specified during the connection. This should never (and probably will not) ever happen, but now will properly be logged if it does.

Updated Dependencies

  • ConcurrentHashSet: 1.0.2 -> 1.1.0
  • Newtonsoft.Json: 10.0.3 -> 12.0.2
  • Nito.AsyncEx.Coordination: 1.0.2 -> 5.0.0
  • System.ValueTuple: 4.4.0 -> 4.5.0

NuGet

Version 4.3.0 can be downloaded via NuGet here.

v4.2.1

26 Mar 01:09

Choose a tag to compare

Changes

  • Voice connections now use a dedicated thread (per connection) instead of async/await internally. This fixes many performance and audio quality issues since these connections are very performance sensitive.

NuGet

Version 4.2.1 can be downloaded via NuGet here.

v4.2.0

03 Oct 19:09

Choose a tag to compare

Changes

  • Discore no longer creates/uses the discore-local-storage.json file. This file can be removed from any projects using Discore (#51).
  • ShardFailureReason.IOError has been deprecated as it can no longer occur (#51).
  • Internal fixes/tweaks to improve stability (#52).

NuGet

Version 4.2.0 can be downloaded via NuGet here.

v4.1.3

28 Apr 21:44

Choose a tag to compare

Bug Fixes

  • Tweak to bring voice UDP connections more inline with API documentation fixes (see discord/discord-api-docs#588) (#50).
  • Minor log message fixes for voice connections.

NuGet

Version 4.1.3 can be downloaded via NuGet here.