Skip to content

Commit

Permalink
Update src/builder/edit_channel.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Alex M. M. <[email protected]>
  • Loading branch information
rhgndf and arqunis committed Oct 16, 2024
1 parent 825af1e commit c490aba
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/builder/edit_channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use super::CreateForumTag;
use crate::http::CacheHttp;
#[cfg(feature = "http")]
use crate::internal::prelude::*;
use crate::json::*;
use crate::model::prelude::*;

/// A builder to edit a [`GuildChannel`] for use via [`GuildChannel::edit`].
Expand Down Expand Up @@ -337,10 +336,21 @@ 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?;
}

Expand Down

0 comments on commit c490aba

Please sign in to comment.