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
This commit is contained in:
parent
cfd051be3f
commit
af50d54729
1 changed files with 3 additions and 2 deletions
|
@ -93,6 +93,7 @@ pub fn get_self_vc_id_cached(ctx: &Context, guild_id: &GuildId) -> Option<Channe
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn get_self_vc_id(ctx: &Context, guild_id: &GuildId) -> Result<ChannelId, Error> {
|
pub async fn get_self_vc_id(ctx: &Context, guild_id: &GuildId) -> Result<ChannelId, Error> {
|
||||||
let channel_id = get_vc_id(ctx, guild_id, &ctx.cache.current_user().id).await;
|
let user_id = ctx.cache.current_user().id;
|
||||||
channel_id // This throws errors in main.rs for some reason
|
|
||||||
|
get_vc_id(ctx, guild_id, &user_id).await
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue