diff options
Diffstat (limited to '')
| -rw-r--r-- | Cargo.lock | 2 | ||||
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/commands/autocomplete.rs | 10 |
3 files changed, 8 insertions, 6 deletions
| @@ -4391,7 +4391,7 @@ dependencies = [ | |||
| 4391 | 4391 | ||
| 4392 | [[package]] | 4392 | [[package]] |
| 4393 | name = "senator-sperma" | 4393 | name = "senator-sperma" |
| 4394 | version = "0.2.1" | 4394 | version = "0.2.2" |
| 4395 | dependencies = [ | 4395 | dependencies = [ |
| 4396 | "chrono", | 4396 | "chrono", |
| 4397 | "cron", | 4397 | "cron", |
| @@ -1,6 +1,6 @@ | |||
| 1 | [package] | 1 | [package] |
| 2 | name = "senator-sperma" | 2 | name = "senator-sperma" |
| 3 | version = "0.2.1" | 3 | version = "0.2.2" |
| 4 | edition = "2024" | 4 | edition = "2024" |
| 5 | 5 | ||
| 6 | [profile.dev] | 6 | [profile.dev] |
diff --git a/src/commands/autocomplete.rs b/src/commands/autocomplete.rs index 497aec9..422ab2d 100644 --- a/src/commands/autocomplete.rs +++ b/src/commands/autocomplete.rs | |||
| @@ -49,10 +49,12 @@ pub async fn audio_file<'a>( | |||
| 49 | let Some(label) = filename_label(&rp) else { | 49 | let Some(label) = filename_label(&rp) else { |
| 50 | continue; | 50 | continue; |
| 51 | }; | 51 | }; |
| 52 | ctx.data() | 52 | // Stash under the choice VALUE (`rp`), not the display label: |
| 53 | .ac_stash(ctx.author().id, label.clone(), hit) | 53 | // the command receives `rp` as its argument and looks the hit |
| 54 | .await; | 54 | // up by that same key, so the cached link is reused instead of |
| 55 | eprintln!("[DEBUG] -> cached as {label:?}"); | 55 | // triggering a fresh copyparty search. |
| 56 | ctx.data().ac_stash(ctx.author().id, rp.clone(), hit).await; | ||
| 57 | eprintln!("[DEBUG] -> cached as {rp:?}"); | ||
| 56 | choices.push(serenity::AutocompleteChoice::new(label.clone(), rp)); | 58 | choices.push(serenity::AutocompleteChoice::new(label.clone(), rp)); |
| 57 | if choices.len() >= 25 { | 59 | if choices.len() >= 25 { |
| 58 | break; | 60 | break; |
