From 00565690bcfaea7d0a109a1b1a90be881b397af5 Mon Sep 17 00:00:00 2001 From: jellywx Date: Wed, 21 Jul 2021 18:30:43 +0100 Subject: [PATCH] fix for stage channels --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83c048a..702ac53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1837,7 +1837,7 @@ dependencies = [ [[package]] name = "soundfx-rs" -version = "1.3.0" +version = "1.3.1" dependencies = [ "dashmap", "dotenv", diff --git a/Cargo.toml b/Cargo.toml index 6660e5b..ff7c5e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "soundfx-rs" -version = "1.3.0" +version = "1.3.1" authors = ["jellywx "] edition = "2018" diff --git a/src/main.rs b/src/main.rs index 99111d7..04d4c00 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,7 @@ use serenity::{ client::{bridge::gateway::GatewayIntents, Client, Context}, http::Http, model::{ + channel::Channel, guild::Guild, id::{ChannelId, GuildId, UserId}, }, @@ -137,6 +138,12 @@ async fn join_channel( let _ = call.lock().await.deafen(true).await; } + if let Some(Channel::Guild(channel)) = channel_id.to_channel_cached(&ctx).await { + channel + .edit_voice_state(&ctx, ctx.cache.current_user().await, |v| v.suppress(false)) + .await; + } + (call, res) }