diff --git a/youmubot-cf/src/announcer.rs b/youmubot-cf/src/announcer.rs index 3729423..e324990 100644 --- a/youmubot-cf/src/announcer.rs +++ b/youmubot-cf/src/announcer.rs @@ -58,11 +58,11 @@ fn update_user( cfu.rating = info.rating; let mut send_message = |rc: RatingChange| -> CommandResult { - let (contest, _, _) = - codeforces::Contest::standings(reqwest, rc.contest_id, |f| f.limit(1, 1))?; let channels = channels_list.get_or_insert_with(|| channels.channels_of(http.clone(), user_id)); - for channel in channels { + if channels.is_empty() { return Ok(()); } + let (contest, _, _) = + codeforces::Contest::standings(reqwest, rc.contest_id, |f| f.limit(1, 1))?; for channel in channels { if let Err(e) = channel.send_message(http.http(), |e| { e.content(format!("Rating change for {}!", user_id.mention())) .embed(|c| {