feat: added getting data from discord

This commit is contained in:
moonleay 2024-03-05 12:08:19 +01:00
parent 4d6e665a3b
commit cfd051be3f
Signed by: moonleay
GPG key ID: 82667543CCD715FB
3 changed files with 63 additions and 15 deletions

View file

@ -30,18 +30,18 @@ pub async fn run(ctx: &Context, command: &CommandInteraction) -> CreateEmbed {
println!("Guild ID: {:?}", guild_id);
let connect_to = get_vc_id(ctx, &guild_id, &command.user.id).expect("Cannot get channel id");
let connect_to = get_vc_id(ctx, &guild_id, &command.user.id).await.expect("Cannot get channel id");
let manager = &songbird::get(ctx)
.await
.expect("Cannot get Songbird.")
.clone();
if !user_util::is_self_connected_to_vc(ctx, &guild_id) {
if !user_util::is_self_connected_to_vc(ctx, &guild_id).await {
// self is connected to vc, check if user is in same vc
let self_channel = user_util::get_self_vc_id(ctx, &guild_id);
let self_channel = user_util::get_self_vc_id(ctx, &guild_id).await;
if self_channel.is_none() {
if self_channel.is_err() {
return Embed::create(
username,
"I am not in a VC.",

View file

@ -14,7 +14,7 @@ pub async fn run(ctx: &Context, command: &CommandInteraction) -> CreateEmbed {
}
};
if !user_util::is_self_connected_to_vc(ctx, guild_id) {
if !user_util::is_self_connected_to_vc_cached(ctx, guild_id) {
// Bot is not connectd to vc; no need to dc
return Embed::create(
username,