| @@ -85,8 +85,9 @@ namespace Discord | |||||
| /// given that the <see cref="SystemChannelId"/> has also been set. | /// given that the <see cref="SystemChannelId"/> has also been set. | ||||
| /// A value of <see cref="SystemChannelMessageDeny.GuildBoost"/> will deny guild boost messages from being sent, and allow all | /// A value of <see cref="SystemChannelMessageDeny.GuildBoost"/> will deny guild boost messages from being sent, and allow all | ||||
| /// other types of messages. | /// other types of messages. | ||||
| /// Refer to the extension methods <see cref="GuildExtensions.GetGuildBoostMessagesEnabled(IGuild)"/> and | |||||
| /// <see cref="GuildExtensions.GetWelcomeMessagesEnabled(IGuild)"/> to check if these system channel message types | |||||
| /// Refer to the extension methods <see cref="GuildExtensions.GetGuildBoostMessagesEnabled(IGuild)"/>, | |||||
| /// <see cref="GuildExtensions.GetWelcomeMessagesEnabled(IGuild)"/>, <see cref="GuildExtensions.GetGuildSetupTipMessagesEnabled(IGuild)"/>, | |||||
| /// and <see cref="GuildExtensions.GetGuildWelcomeMessageReplyEnabled(IGuild)"/> to check if these system channel message types | |||||
| /// are enabled, without the need to manipulate the logic of the flag. | /// are enabled, without the need to manipulate the logic of the flag. | ||||
| /// </remarks> | /// </remarks> | ||||
| public Optional<SystemChannelMessageDeny> SystemChannelFlags { get; set; } | public Optional<SystemChannelMessageDeny> SystemChannelFlags { get; set; } | ||||
| @@ -17,6 +17,14 @@ namespace Discord | |||||
| /// <summary> | /// <summary> | ||||
| /// Deny the messages that are sent when a user boosts the guild. | /// Deny the messages that are sent when a user boosts the guild. | ||||
| /// </summary> | /// </summary> | ||||
| GuildBoost = 0b10 | |||||
| GuildBoost = 0b10, | |||||
| /// <summary> | |||||
| /// Deny the messages that are related to guild setup. | |||||
| /// </summary> | |||||
| GuildSetupTip = 0b100, | |||||
| /// <summary> | |||||
| /// Deny the reply with sticker button on welcome messages. | |||||
| /// </summary> | |||||
| WelcomeMessageReply = 0b1000 | |||||
| } | } | ||||
| } | } | ||||
| @@ -20,5 +20,21 @@ namespace Discord | |||||
| /// <returns> A <c>bool</c> indicating if the guild boost messages are enabled in the system channel. </returns> | /// <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) | public static bool GetGuildBoostMessagesEnabled(this IGuild guild) | ||||
| => !guild.SystemChannelFlags.HasFlag(SystemChannelMessageDeny.GuildBoost); | => !guild.SystemChannelFlags.HasFlag(SystemChannelMessageDeny.GuildBoost); | ||||
| /// <summary> | |||||
| /// Gets if guild setup system messages are enabled. | |||||
| /// </summary> | |||||
| /// <param name="guild"> The guild to check. </param> | |||||
| /// <returns> A <c>bool</c> indicating if the guild setup messages are enabled in the system channel. </returns> | |||||
| public static bool GetGuildSetupTipMessagesEnabled(this IGuild guild) | |||||
| => !guild.SystemChannelFlags.HasFlag(SystemChannelMessageDeny.GuildSetupTip); | |||||
| /// <summary> | |||||
| /// Gets if guild welcome messages have a reply with sticker button. | |||||
| /// </summary> | |||||
| /// <param name="guild"> The guild to check. </param> | |||||
| /// <returns> A <c>bool</c> indicating if the guild welcome messages have a reply with sticker button. </returns> | |||||
| public static bool GetGuildWelcomeMessageReplyEnabled(this IGuild guild) | |||||
| => !guild.SystemChannelFlags.HasFlag(SystemChannelMessageDeny.WelcomeMessageReply); | |||||
| } | } | ||||
| } | } | ||||