This commit is contained in:
Elnu 2025-03-25 19:22:24 -07:00
parent 665d5c025b
commit eccd55542d
3 changed files with 1299 additions and 506 deletions

1795
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -7,15 +7,15 @@ edition = "2021"
[dependencies]
dotenv = "0.15"
rand = "0.8"
rand = "0.9"
tracing = "0.1"
tracing-subscriber = "0.3"
serde_json = "1.0"
reqwest = "0.11"
reqwest = "0.12"
slug = "0.1"
unicode_hfwidth = "0.2"
fs_extra = "1.3"
poise = "0.5.5"
poise = "0.5.7"
[dependencies.tokio]
version = "1.32"

View file

@ -248,7 +248,7 @@ pub async fn send(ctx: Context<'_>, message: &str, ping: bool, pin: bool) -> Res
}
pub fn random_from_string(string: &str) -> char {
string.chars().choose(&mut rand::thread_rng()).unwrap()
string.chars().choose(&mut rand::rng()).unwrap()
}
pub fn get_so_diagram(kanji: char) -> String {
@ -368,7 +368,7 @@ pub async fn random_kanji(
if subcategory == "ALL" {
let subcategory_key = subcategories
.keys()
.choose(&mut rand::thread_rng())
.choose(&mut rand::rng())
.unwrap();
let list = subcategories[subcategory_key].as_str().unwrap();
let kanji = random_from_string(list);