feature: #1381 Guild PreferredLocale support (#1387)

* Fix #1381 Guild PreferredLocale support

Adds support for getting and modifying a guild's preferred_locale. This is a language tag in IETF BCP 47 format, which works with the built-in CultureInfo.

While Discord only supports a number of cultures, I think that this restriction should be handled at the API and not by the wrapper. (Also easier on our end)

* Add PreferredCulture to IGuild

This property was defined in RestGuild and SocketGuild, so it only makes sense to make it part of IGuild as well.
This commit is contained in:
Chris Johnston
2019-10-22 19:46:41 -07:00
committed by Christopher F
parent 0bda8a4217
commit a61adb07e0
7 changed files with 65 additions and 0 deletions

View File

@@ -58,5 +58,7 @@ namespace Discord.API
public SystemChannelMessageDeny SystemChannelFlags { get; set; }
[JsonProperty("premium_subscription_count")]
public int? PremiumSubscriptionCount { get; set; }
[JsonProperty("preferred_locale")]
public string PreferredLocale { get; set; }
}
}

View File

@@ -32,5 +32,7 @@ namespace Discord.API.Rest
public Optional<ExplicitContentFilterLevel> ExplicitContentFilter { get; set; }
[JsonProperty("system_channel_flags")]
public Optional<SystemChannelMessageDeny> SystemChannelFlags { get; set; }
[JsonProperty("preferred_locale")]
public string PreferredLocale { get; set; }
}
}