From 586f061ac6f7eddc127c655ac80244ff2f16552b Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Sat, 23 Dec 2023 14:44:00 -0500 Subject: [PATCH] add avatar_url option to /edit mate fun fact: this commit was made entirely in emacs. for better or worse --- .gitignore | 4 +++- src/commands/edit.rs | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index cdc9518..d602599 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /target /.env -/dev-database \ No newline at end of file +/dev-database +*.*# +*.*#* \ No newline at end of file diff --git a/src/commands/edit.rs b/src/commands/edit.rs index 0e1d590..165b84b 100644 --- a/src/commands/edit.rs +++ b/src/commands/edit.rs @@ -32,6 +32,7 @@ pub async fn mate( bool, >, #[description = "the new avatar to use when proxying"] avatar: Option, + #[description = "a link to an avatar to use when proxying"] avatar_url: Option, #[description = "the mate's bio"] bio: Option, #[description = "the mate's pronouns"] pronouns: Option, #[description = "a signature to add to any proxied messages (ie `💙- text`)"] signature: Option< @@ -42,7 +43,7 @@ pub async fn mate( let mates_collection = database.collection::("mates"); - let mut avatar_url = None; + let mut avatar_url = avatar_url; if let Some(avatar) = avatar { avatar_url = Some( @@ -52,8 +53,9 @@ pub async fn mate( name.clone(), avatar, ) - .await?, - ); + .await? + ) + } get_mate(&mates_collection, ctx.author().id, name.clone())