From 468f8264d00d1f5c9cacd7f6fa55e861a197e0a1 Mon Sep 17 00:00:00 2001 From: Mustafa Salih ASLIM Date: Fri, 10 Jul 2020 07:13:46 +0300 Subject: [PATCH] fix: unsupported property causes an exception (#1469) 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 c7ff7fa65..a85ef4f0b 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(); }