From 62f4861556f63e2648c99315b6d048e891068039 Mon Sep 17 00:00:00 2001 From: minneelyyyy Date: Fri, 11 Oct 2024 21:17:55 -0400 Subject: [PATCH] Revert "minor rewrite to use map" This reverts commit bf80d9a486ab325cd27f412ff9f27f0053fc5012. --- src/commands/dox.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commands/dox.rs b/src/commands/dox.rs index 53694a3..3a27672 100644 --- a/src/commands/dox.rs +++ b/src/commands/dox.rs @@ -52,9 +52,11 @@ pub async fn dox(mut ctx: Context<'_>, show_permissions: Option) -> Result<(), Error> { let user = ctx.http().get_user(user.id).await?; - let member = ctx.guild_id().map( - async move |guild| - guild.member(ctx.http(), user.id).await.ok()).unwrap(); + let member = if let Some(guild) = ctx.guild_id() { + guild.member(ctx.http(), user.id).await.ok() + } else { + None + }; let embed = serenity::CreateEmbed::default() .title(format!("Information about {}", user.name))