|
|
|
@ -38,7 +38,7 @@ pub async fn poll_races(ctx: Arc<Context>)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//println!("\tGame: {}\n\tCategory: {}", race["category"]["name"], race["goal"]["name"]);
|
|
|
|
//println!("\tGame: {}\n\tCategory: {}", race["category"]["name"], race["goal"]["name"]);
|
|
|
|
let key = race["name"].to_string().strip_prefix("\"").unwrap().to_string();
|
|
|
|
let key = race["name"].to_string().strip_prefix("\"").unwrap().to_string();
|
|
|
|
if key.starts_with("sm") || key.starts_with("smr") || key.starts_with("smz3")
|
|
|
|
if key.starts_with("sm") || key.starts_with("smr")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let race = Race::from_json(race);
|
|
|
|
let race = Race::from_json(race);
|
|
|
|
if !races.contains_key(&key)
|
|
|
|
if !races.contains_key(&key)
|
|
|
|
@ -68,7 +68,7 @@ pub async fn poll_races(ctx: Arc<Context>)
|
|
|
|
|
|
|
|
|
|
|
|
// TEST ANNOUNCEMENT
|
|
|
|
// TEST ANNOUNCEMENT
|
|
|
|
//utils::Logger::log_message((*ctx).clone(), &format!("Goal set: {} for: {}", races[&key].goal, races[&key].url)).await;
|
|
|
|
//utils::Logger::log_message((*ctx).clone(), &format!("Goal set: {} for: {}", races[&key].goal, races[&key].url)).await;
|
|
|
|
|
|
|
|
|
|
|
|
let msg = format!("Goal set: {} for: {}", races[&key].goal, races[&key].url);
|
|
|
|
let msg = format!("Goal set: {} for: {}", races[&key].goal, races[&key].url);
|
|
|
|
utils::send_msg((*ctx).clone(), ChannelId(RACE_CHANNEL_ID), &msg).await;
|
|
|
|
utils::send_msg((*ctx).clone(), ChannelId(RACE_CHANNEL_ID), &msg).await;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|