From 8b4a1d7a6ba5fe65c948a1f1fa48b9ef2f66cc1a Mon Sep 17 00:00:00 2001 From: Mustafa Salih ASLIM Date: Mon, 30 Mar 2020 15:44:52 +0300 Subject: [PATCH] unsupported property causes an exception fix for: https://github.com/discord-net/Discord.Net/issues/1436 `SlowModeInterval` property causes an exception for Announcement Channel feature if it is enabled on discord. Should be checked whether it is specified or not before set to property. --- src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs b/src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs index dc86327bd..eb9f73fb2 100644 --- a/src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs +++ b/src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs @@ -42,7 +42,8 @@ namespace Discord.Rest base.Update(model); CategoryId = model.CategoryId; Topic = model.Topic.Value; - SlowModeInterval = model.SlowMode.Value; + if (model.SlowMode.IsSpecified) + SlowModeInterval = model.SlowMode.Value; IsNsfw = model.Nsfw.GetValueOrDefault(); }