From af50d5472957bca7fe0c42dfb5aa4d7dfe16dba6 Mon Sep 17 00:00:00 2001 From: Miguel da Mota Date: Wed, 6 Mar 2024 09:13:23 +0100 Subject: [PATCH] fix: `get_self_vc_id` throws an error The problem was that `ctx.cache.current_user()` uses an Arc and needs to get the value first before passing it to as a parameter. Assigning it to a variable first and referencing it, fixes the issue --- src/util/user_util.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/user_util.rs b/src/util/user_util.rs index 8bfd6ad..3f70c58 100644 --- a/src/util/user_util.rs +++ b/src/util/user_util.rs @@ -93,6 +93,7 @@ pub fn get_self_vc_id_cached(ctx: &Context, guild_id: &GuildId) -> Option Result { - let channel_id = get_vc_id(ctx, guild_id, &ctx.cache.current_user().id).await; - channel_id // This throws errors in main.rs for some reason + let user_id = ctx.cache.current_user().id; + + get_vc_id(ctx, guild_id, &user_id).await }