smol bot
small fixes
| -rw-r--r-- | rust-toolchain.toml | 2 | ||||
| -rw-r--r-- | src/bot/mod.rs | 2 | ||||
| -rw-r--r-- | src/bot/search.rs | 10 |
3 files changed, 10 insertions, 4 deletions
diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..e5d982c --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly-2024-06-20" diff --git a/src/bot/mod.rs b/src/bot/mod.rs index f288db1..1a7ccd8 100644 --- a/src/bot/mod.rs +++ b/src/bot/mod.rs @@ -223,7 +223,7 @@ async fn handle_message( // add :) repo.own().await.insert( new_message.id.get(), - (m.author.name.clone(), m.author.id.get()), + (new_message.author.name.clone(), new_message.author.id.get()), ); use emoji::named::*; if repo.id == 925674713429184564 && !cfg!(debug_assertions) { diff --git a/src/bot/search.rs b/src/bot/search.rs index d7b4364..5fdcfb4 100644 --- a/src/bot/search.rs +++ b/src/bot/search.rs @@ -121,9 +121,13 @@ pub struct Data { } pub fn dir(x: u64) -> Option<impl Iterator<Item = PathBuf>> { - std::fs::read_dir(Path::new("repo").join(super::SPECIAL[&x].d)) - .ok() - .map(|x| x.filter_map(Result::ok).map(move |f| f.path())) + std::fs::read_dir( + Path::new("repos") + .join("cd8a83f57821034") + .join(super::SPECIAL[&x].d), + ) + .ok() + .map(|x| x.filter_map(Result::ok).map(move |f| f.path())) } pub fn files() -> impl Iterator<Item = (PathBuf, u64)> { |