late-submissions
Elnu 3 years ago
parent 66b52c491d
commit c8a20147e5

@ -13,13 +13,28 @@ async fn challenge(ctx: &Context, msg: &Message) -> CommandResult {
let challenge = { let challenge = {
let mut max = 0; let mut max = 0;
for path in paths { for path in paths {
let number = path.unwrap().path().file_stem().unwrap().to_str().unwrap().parse::<i32>().unwrap(); let number = path
.unwrap()
.path()
.file_stem()
.unwrap()
.to_str()
.unwrap()
.parse::<i32>()
.unwrap();
if number > max { if number > max {
max = number; max = number;
} }
} }
max max
}; };
msg.reply(&ctx.http, format!("Tegaki Tuesday #{n}: https://tegakituesday.com/{n}", n = challenge)).await?; msg.reply(
&ctx.http,
format!(
"Tegaki Tuesday #{n}: https://tegakituesday.com/{n}",
n = challenge
),
)
.await?;
Ok(()) Ok(())
} }

@ -1,3 +1,3 @@
pub mod challenge;
pub mod kanji; pub mod kanji;
pub mod owner; pub mod owner;
pub mod challenge;

@ -12,7 +12,7 @@ mod commands;
use std::{collections::HashSet, env, sync::Arc}; use std::{collections::HashSet, env, sync::Arc};
use commands::{kanji::*, owner::*, challenge::*}; use commands::{challenge::*, kanji::*, owner::*};
use serenity::{ use serenity::{
async_trait, async_trait,
client::bridge::gateway::ShardManager, client::bridge::gateway::ShardManager,

Loading…
Cancel
Save