Skip to content

Commit

Permalink
it still didnt work on docker but now it does
Browse files Browse the repository at this point in the history
  • Loading branch information
ana-rchy committed May 13, 2024
1 parent 9376d2b commit b3ebc06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ pub async fn fact_check(ctx: Context<'_>) -> Result<(), Error> {


async fn get_fact_check_image() -> File {
let paths = std::fs::read_dir("assets/fact_check/").unwrap();
let mut exec_path = std::env::current_exe().unwrap();
exec_path.pop();

let paths = std::fs::read_dir(format!("{}/assets/fact_check/", exec_path.display())).unwrap();
let mut images: Vec<String> = vec![];
for path in paths {
images.push(path.unwrap().path().display().to_string());
images.push(format!("{}", path.unwrap().path().display().to_string()));
}

let rand_index = rand::random::<usize>() % images.len();
Expand Down

0 comments on commit b3ebc06

Please sign in to comment.