fix: allow removing channel slowmode (#836)

Signed-off-by: Zomatree <me@zomatree.live>
This commit is contained in:
Zomatree
2026-07-03 03:23:52 +01:00
committed by GitHub
parent 59f6e012f8
commit 21daf3aec6
4 changed files with 14 additions and 0 deletions

View File

@@ -161,6 +161,7 @@ auto_derived!(
Icon,
DefaultPermissions,
Voice,
Slowmode,
}
);
@@ -554,6 +555,12 @@ impl Channel {
}
_ => {}
},
FieldsChannel::Slowmode => match self {
Self::TextChannel { slowmode, .. } => {
slowmode.take();
}
_ => {}
}
}
}
@@ -777,6 +784,7 @@ impl IntoDocumentPath for FieldsChannel {
FieldsChannel::Icon => "icon",
FieldsChannel::DefaultPermissions => "default_permissions",
FieldsChannel::Voice => "voice",
FieldsChannel::Slowmode => "slowmode",
})
}
}

View File

@@ -319,6 +319,7 @@ impl From<FieldsChannel> for crate::FieldsChannel {
FieldsChannel::Icon => crate::FieldsChannel::Icon,
FieldsChannel::DefaultPermissions => crate::FieldsChannel::DefaultPermissions,
FieldsChannel::Voice => crate::FieldsChannel::Voice,
FieldsChannel::Slowmode => crate::FieldsChannel::Slowmode,
}
}
}
@@ -330,6 +331,7 @@ impl From<crate::FieldsChannel> for FieldsChannel {
crate::FieldsChannel::Icon => FieldsChannel::Icon,
crate::FieldsChannel::DefaultPermissions => FieldsChannel::DefaultPermissions,
crate::FieldsChannel::Voice => FieldsChannel::Voice,
crate::FieldsChannel::Slowmode => FieldsChannel::Slowmode,
}
}
}

View File

@@ -164,6 +164,7 @@ auto_derived!(
Icon,
DefaultPermissions,
Voice,
Slowmode,
}
/// New webhook information

View File

@@ -221,6 +221,9 @@ pub async fn edit(
v0::FieldsChannel::Voice => {
voice.take();
}
v0::FieldsChannel::Slowmode => {
slowmode.take();
}
_ => {}
}
}