Browse Source

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.
tags/2.3.0
Mustafa Salih ASLIM GitHub 4 years ago
parent
commit
468f8264d0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs

+ 2
- 1
src/Discord.Net.Rest/Entities/Channels/RestTextChannel.cs View File

@@ -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();
}



Loading…
Cancel
Save