[Feature] Default thread ratelimit in guild text channels (#2622)
* initial commit * mocked bruh
This commit is contained in:
@@ -9,9 +9,6 @@ internal class ModifyForumChannelParams : ModifyTextChannelParams
|
||||
[JsonProperty("available_tags")]
|
||||
public Optional<ModifyForumTagParams[]> Tags { get; set; }
|
||||
|
||||
[JsonProperty("default_thread_rate_limit_per_user")]
|
||||
public Optional<int> DefaultSlowModeInterval { get; set; }
|
||||
|
||||
[JsonProperty("rate_limit_per_user")]
|
||||
public Optional<int> ThreadCreationInterval { get; set; }
|
||||
|
||||
|
||||
@@ -7,9 +7,14 @@ namespace Discord.API.Rest
|
||||
{
|
||||
[JsonProperty("topic")]
|
||||
public Optional<string> Topic { get; set; }
|
||||
|
||||
[JsonProperty("nsfw")]
|
||||
public Optional<bool> IsNsfw { get; set; }
|
||||
|
||||
[JsonProperty("rate_limit_per_user")]
|
||||
public Optional<int> SlowModeInterval { get; set; }
|
||||
|
||||
[JsonProperty("default_thread_rate_limit_per_user")]
|
||||
public Optional<int> DefaultSlowModeInterval { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace Discord.Rest
|
||||
Deny = overwrite.Permissions.DenyValue.ToString()
|
||||
}).ToArray()
|
||||
: Optional.Create<API.Overwrite[]>(),
|
||||
DefaultSlowModeInterval = args.DefaultSlowModeInterval
|
||||
};
|
||||
return await client.ApiClient.ModifyGuildChannelAsync(channel.Id, apiArgs, options).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace Discord.Rest
|
||||
public bool IsNsfw { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public ThreadArchiveDuration DefaultArchiveDuration { get; private set; }
|
||||
/// <inheritdoc />
|
||||
public int DefaultSlowModeInterval { get; private set; }
|
||||
|
||||
internal RestTextChannel(BaseDiscordClient discord, IGuild guild, ulong id)
|
||||
: base(discord, guild, id)
|
||||
@@ -52,6 +54,8 @@ namespace Discord.Rest
|
||||
DefaultArchiveDuration = model.AutoArchiveDuration.Value;
|
||||
else
|
||||
DefaultArchiveDuration = ThreadArchiveDuration.OneDay;
|
||||
|
||||
DefaultSlowModeInterval = model.ThreadRateLimitPerUser.GetValueOrDefault(0);
|
||||
// basic value at channel creation. Shouldn't be called since guild text channels always have this property
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user