* add new MessageTypes * Add new properties to the updated models * add the SystemChannelMessageDeny unsure if there would be a better name for this enum, given it's inverted nature, open for suggestions * add PremiumTier flag, add Guild description property * add method for getting vanity image from CDN * make the size of GetGuildVanityUrl optional * lint: remove commented out code from prev commit * add a None flag to SystemChannelMessage enum * implement the new modify guild params * implement additional model properties in IGuild types * implement GuildMember PremiumSince * docs: reword size param explanation * add extension methods that make it easier to check the SystemChannelMessage flags for end users because the flag is inverted, this ideally should make it easier for the user. it may also be useful to do something similar for modifying this property * docs: correct typo from copy-paste * add the premium_subscription_count property * fix vanity url code and banner switchup a mistake was made somewhere, that's all I know for sure * clarify remark on inverted logic for system channel flags * fix PremiumSubscriptionCount optional value * add another example to the systemchannelflags xmldoc remark * docs: fix typos, clarify wording * use DateTimeOffset for PremiumSince, follow conventions from other prop
25 lines
1.0 KiB
C#
25 lines
1.0 KiB
C#
namespace Discord
|
|
{
|
|
/// <summary>
|
|
/// An extension class for <see cref="IGuild"/>.
|
|
/// </summary>
|
|
public static class GuildExtensions
|
|
{
|
|
/// <summary>
|
|
/// Gets if welcome system messages are enabled.
|
|
/// </summary>
|
|
/// <param name="guild"> The guild to check. </param>
|
|
/// <returns> A <c>bool</c> indicating if the welcome messages are enabled in the system channel. </returns>
|
|
public static bool GetWelcomeMessagesEnabled(this IGuild guild)
|
|
=> !guild.SystemChannelFlags.HasFlag(SystemChannelMessageDeny.WelcomeMessage);
|
|
|
|
/// <summary>
|
|
/// Gets if guild boost system messages are enabled.
|
|
/// </summary>
|
|
/// <param name="guild"> The guild to check. </param>
|
|
/// <returns> A <c>bool</c> indicating if the guild boost messages are enabled in the system channel. </returns>
|
|
public static bool GetGuildBoostMessagesEnabled(this IGuild guild)
|
|
=> !guild.SystemChannelFlags.HasFlag(SystemChannelMessageDeny.GuildBoost);
|
|
}
|
|
}
|