add: individual topic write permissions

This commit is contained in:
trisua 2025-08-04 13:23:27 -04:00
parent 3738a5cd1f
commit 8c779b2f2e
6 changed files with 80 additions and 9 deletions

View file

@ -541,6 +541,8 @@ pub struct ForumTopic {
pub description: String,
pub color: String,
pub position: i32,
#[serde(default)]
pub write_access: CommunityWriteAccess,
}
impl ForumTopic {
@ -549,7 +551,13 @@ impl ForumTopic {
/// # Returns
/// * ID for [`Community`] hashmap
/// * [`ForumTopic`]
pub fn new(title: String, description: String, color: String, position: i32) -> (usize, Self) {
pub fn new(
title: String,
description: String,
color: String,
position: i32,
write_access: CommunityWriteAccess,
) -> (usize, Self) {
(
Snowflake::new().to_string().parse::<usize>().unwrap(),
Self {
@ -557,6 +565,7 @@ impl ForumTopic {
description,
color,
position,
write_access,
},
)
}