v5.0.0 #104
Francessco121
announced in
Announcements
v5.0.0
#104
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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
DiscordMessage) no longer keep a reference to aDiscordHttpClientinternally and therefore no longer have methods for modifying the entity.DiscordHttpClientcalls and can be migrated by just using aDiscordHttpClientinstead (ex.DiscordMessage.Edit()->DiscordHttpClient.EditMessage(DiscordMessage)).DiscordShardCachehas been replaced with the newDiscore.Caching.DiscordMemoryCache.Shard.Cachewas removed in favor of making caching optional for Gateway connections. To get built-in caching behavior back, instantiate the newDiscordMemoryCachewith yourShard. The newDiscordMemoryCacheobject has a nearly identical interface to the oldDiscordShardCache.IDiscordGatewaybreaking changes:OnEventName(e.g.OnMessageCreatedwas renamed toOnMessageCreate).EventNameEventArgs).OnMessageUpdatednow emits aDiscordPartialMessageinstead of a normalDiscordMessage.OnGuildAvailableandOnGuildUnavailablewere merged intoOnGuildCreateandOnGuildDelete. To see whether the guild availability status changed, use the newBecameAvailableandUnavailableproperties in the event args.OnDMChannel*events were removed (bots no longer receive events for DM channels as of Gateway v8).OnChannel*events now emit aDiscordChannelinstead of aDiscordGuildChannel(matches the actual Gateway spec).UpdateStatusAsyncwas renamed toUpdatePresenceAsync.Shardinstances.DiscordVoiceConnection.Shard.ShardVoiceManager(use the newDiscordVoiceConnectionconstructors instead).VoiceConnectionEventArgs.Shard.VoiceConnectionInvalidationReason.BotRemovedFromGuild(this case is now just a normal invalidation).Shard.Voice.Shard.StartAsyncnow requires either aGatewayIntentorShardStartConfigargument.DiscordGametoDiscordActivity(to match Gateway v8 changes).DiscordGameTypetoDiscordActivityType(to match Gateway v8 changes).DiscordUserPresence.Game(useActivities.FirstOrDefault()instead).StatusOptionstoPresenceOptions.PresenceOptionsnow takes a list of activities instead of a singleGame.GameOptionstoActivityOptions.DiscordVoiceConnection.SetSpeakingAsyncwill now throw anInvalidOperationExceptionif called before being fully connected.DiscordVoiceConnection.ClearVoiceBufferwill now throw anInvalidOperationExceptionif called before being fully connected.DiscordVoiceConnection.ConnectAsyncno 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.DiscordPermissionHelper.CanJoinVoiceChannelhelper function.DiscordHttpRateLimitException.Limitis now nullable.DiscordHttpRateLimitException.Resetis now nullable.DiscordHttpRateLimitException.ResetHighPrecisionis now nullable.ShardStartConfig.GatewayLargeThresholdnow defaults to the Gateway's default of 50 (down from 250).DiscordHttpErrorCode.TooManyReactionsrenamed toMaximumReactionsReached.DiscordHttpRateLimitException.RetryAfteris now adoubleand includes millisecond precision.DiscordGuild.IsEmbedEnabledandEmbedChannelId(useIsWidgetEnabledandWidgetChannelIdinstead).DiscordGuildEmbedtoDiscordGuildWidgetSettings.DiscordHttpErrorCode.EmbedDisabledtoWidgetDisabled.ModifyGuildEmbedOptionstoModifyGuildWidgetOptions.DiscordHttpClient.GetGuildEmbedtoGetGuildWidget.DiscordHttpClient.ModifyGuildEmbedtoModifyGuildWidget.ShardFailureReason.IOErrorDiscordHttpClient.BeginGuildPrunenow returns null ifcomputePruneCountis true.Create/EditMessageOptions.EmbedtoEmbedsto support multiple embeds per message.DiscordHttpClient.Create/EditMessagefile attachment overloads have been removed. Instead, please use the newAttachmentsproperty ofCreate/EditMessageOptions.DiscordHttpClient.UseSingleHttpClient(it's no longer needed).DiscordHttpClient.GetUserDMs.Shard.OnReconnectedis now fired at the end of reconnection (as probably expected), rather than the start. This is still guaranteed to be fired beforeOnReady.Create/ModifyGuildOptions.VerificationLevelis now typeGuildVerificationLevel.Create/ModifyGuildOptions.DefaultMessageNotificationsis now typeGuildNotificationOption.DiscordVoiceRegionproperties (SampleHostname,SamplePort,IsVIPOnly).DiscordEmbed.Coloris now typeDiscordColor.DiscordUser.HasTwoFactorAuthtoMfaEnabled.DiscordIntegration.ExpireBehavioris typeIntegrationExpireBehavior.DiscordInvitechanges:TargetUserTypetoTargetType.Channelis now nullable.Inviteris now a property ofDiscordInviteinstead ofDiscordInviteMetadata(should only break reflection).DiscordInviteMetadata.IsRevoked.DiscordInviteChannel.ChannelIdtoId.DiscordInviteGuild.GuildIdtoId.DiscordInviteTargetUserTypetoDiscordInviteTargetType.ShardVoiceManager.GetUsersInVoiceChannel(please useDiscordMemoryCache.GetUsersInVoiceChannelinstead).DiscordGuild.RegionId(deprecated).DiscordPermissionException(was no longer thrown from any normal APIs).DiscordPermissionHelper.AssertPermission(applications should make their own assert helpers usingHasPermission).Additions
ShardStartConfig.IntentsorShard.StartAsync(GatewayIntent).Create/EditMessageOptions.Flags.DiscordAttachment.Description.DiscordAttachment.ContentType.DiscordAttachment.Ephemeral.Shard.OnDisconnected.ShardFailureReason.InvalidIntents.ShardFailureReason.DisallowedIntents.DiscordHttpApiException.Errors.DiscordHttpRateLimitException.Bucket.DiscordVoiceConnection.SetSpeakingAsyncoverload to take newSpeakingFlagparameter for more specific speaking states.DiscordVoiceConnectionconstructors for creating a connection from a shard or a voice bridge.DiscordVoiceConnection.ConnectAsyncparameter for changing the connection timeout period.IDiscordGateway.OnVoiceServerUpdateevent.IDiscordGateway.UpdateVoiceStateAsync.MemberSpeakingEventArgs.SpeakingFlag.DiscordMessage.GuildId.IDiscordGuildMemberbase interface.DiscordPermissionHelper.HasPermissionoverload.DiscordPermissionHelper.CanJoinVoiceChannel.DiscordPermissionHelper.PermissionsToString.VoiceConnectionInvalidationReason.DllNotFound.Changes
DiscordGuildVoiceChannelnow implementsITextChannelto support guild voice text chat.Snowflakenow implementsIEquatable<Snowflake>.DiscordCdnUrlnow implementsIEquatable<DiscordCdnUrl>.Newtonsoft.Json.Bug Fixes
DiscordWebSocketExceptionnot containing anInnerExceptionwhen one was provided.NuGet
Version 5.0.0 can be downloaded via NuGet here.
This discussion was created from the release v5.0.0.
Beta Was this translation helpful? Give feedback.
All reactions