AutoMod custom block message (#2613)
This commit is contained in:
@@ -21,16 +21,23 @@ namespace Discord
|
||||
/// </summary>
|
||||
public ulong? ChannelId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the custom message that will be shown to members whenever their message is blocked.
|
||||
/// <see langword="null"/> if no message has been set.
|
||||
/// </summary>
|
||||
public Optional<string> CustomMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the duration of which a user will be timed out for breaking this rule. <see langword="null"/> if no timeout duration has been provided.
|
||||
/// </summary>
|
||||
public TimeSpan? TimeoutDuration { get; }
|
||||
|
||||
internal AutoModRuleAction(AutoModActionType type, ulong? channelId, int? duration)
|
||||
internal AutoModRuleAction(AutoModActionType type, ulong? channelId, int? duration, string customMessage)
|
||||
{
|
||||
Type = type;
|
||||
ChannelId = channelId;
|
||||
TimeoutDuration = duration.HasValue ? TimeSpan.FromSeconds(duration.Value) : null;
|
||||
CustomMessage = customMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,12 @@ namespace Discord
|
||||
/// </summary>
|
||||
public const int MaxTimeoutSeconds = 2419200;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the max custom message length AutoMod rule action allowed by Discord.
|
||||
/// </summary>
|
||||
public const int MaxCustomBlockMessageLength = 50;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name for the rule.
|
||||
/// </summary>
|
||||
@@ -146,6 +152,11 @@ namespace Discord
|
||||
/// Gets or sets the duration of which a user will be timed out for breaking this rule.
|
||||
/// </summary>
|
||||
public TimeSpan? TimeoutDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the custom message that will be shown to members whenever their message is blocked.
|
||||
/// </summary>
|
||||
public Optional<string> CustomMessage { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user