1 parent f25829d commit d5d8b14Copy full SHA for d5d8b14
1 file changed
src/commands/snippets.rs
@@ -144,15 +144,16 @@ pub async fn remove_snippet(
144
ctx: Context<'_>,
145
#[autocomplete = "autocomplete_snippet"]
146
#[description = "The snippet's id"]
147
- id: String,
+ #[rename = "id"]
148
+ id_and_title: String,
149
) -> Result<(), Error> {
- match get_snippet_lazy(&ctx, &id) {
150
+ match get_snippet(&ctx, &id_and_title) {
151
Some(snippet) => {
152
remove_snippet_confirm(&ctx, &snippet).await?;
153
}
154
None => {
155
let title = &"Failed to remove snippet";
- let content = &&format!("The snippet '{id}' does not exist");
156
+ let content = &&format!("The snippet '{id_and_title}' does not exist");
157
respond_err(&ctx, title, content).await;
158
159
0 commit comments