diff --git a/src/lib.rs b/src/lib.rs index 2327d2f..a158c72 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -156,6 +156,10 @@ pub async fn run_contest( if contest.counts.is_empty() { announcement.delete(&ctx.http).await?; } else { + if pin_announcement { + announcement.unpin(&ctx.http).await?; + } + // send ranking message channel_id .send_message(&ctx.http, |m| { @@ -177,9 +181,5 @@ pub async fn run_contest( .await?; } - if pin_announcement { - announcement.unpin(&ctx.http).await?; - } - Ok(()) }