From 6c475115753828cda5317ef86859ccd2422e5aa0 Mon Sep 17 00:00:00 2001 From: rhgndf <16336768+rhgndf@users.noreply.github.com> Date: Wed, 16 Oct 2024 20:08:32 +0800 Subject: [PATCH] Update src/builder/edit_channel.rs Co-authored-by: Alex M. M. --- src/builder/edit_channel.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/builder/edit_channel.rs b/src/builder/edit_channel.rs index c6e688aa8c2..17d7a4f2cb7 100644 --- a/src/builder/edit_channel.rs +++ b/src/builder/edit_channel.rs @@ -337,10 +337,15 @@ impl<'a> Builder for EditChannel<'a> { } } - if let Some(ref status) = self.status { + if let Some(status) = &self.status { + #[derive(Serialize)] + struct EditVoiceStatusBody<'a> { + status: &'a str, + } + cache_http .http() - .edit_voice_status(ctx, &json!({ "status": status }), self.audit_log_reason) + .edit_voice_status(ctx, &EditVoiceStatusBody { status: status.as_str() }, self.audit_log_reason) .await?; }