Skip to content

Commit

Permalink
add avatar_url option to /edit mate
Browse files Browse the repository at this point in the history
fun fact: this commit was made entirely in emacs. for better or worse
  • Loading branch information
Ruthenic committed Dec 23, 2023
1 parent d04c3b0 commit 586f061
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/target
/.env
/dev-database
/dev-database
*.*#
*.*#*
8 changes: 5 additions & 3 deletions src/commands/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub async fn mate(
bool,
>,
#[description = "the new avatar to use when proxying"] avatar: Option<serenity::Attachment>,
#[description = "a link to an avatar to use when proxying"] avatar_url: Option<String>,
#[description = "the mate's bio"] bio: Option<String>,
#[description = "the mate's pronouns"] pronouns: Option<String>,
#[description = "a signature to add to any proxied messages (ie `💙- text`)"] signature: Option<
Expand All @@ -42,7 +43,7 @@ pub async fn mate(

let mates_collection = database.collection::<DBMate>("mates");

let mut avatar_url = None;
let mut avatar_url = avatar_url;

if let Some(avatar) = avatar {
avatar_url = Some(
Expand All @@ -52,8 +53,9 @@ pub async fn mate(
name.clone(),
avatar,
)
.await?,
);
.await?
)

}

get_mate(&mates_collection, ctx.author().id, name.clone())
Expand Down

0 comments on commit 586f061

Please sign in to comment.