forked from DiscordBots/Rustendo
feat: added getting data from discord
This commit is contained in:
parent
4d6e665a3b
commit
cfd051be3f
3 changed files with 63 additions and 15 deletions
|
@ -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.",
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue