diff --git a/src/main.rs b/src/main.rs index 2d8948c..403c3b4 100755 --- a/src/main.rs +++ b/src/main.rs @@ -164,11 +164,11 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { #[derive(Deserialize)] struct EmbedProperties { - author: Option<(String, Option)>, + author: Option<(String, String)>, colour: String, description: Option, fields: Option>, - footer: Option<(String, Option)>, + footer: Option<(String, String)>, image: Option, timestamp: Option, title: Option, @@ -194,11 +194,9 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { if input_embed.author != None { let auth = input_embed.author.unwrap(); e.author(|a| { - //assumin first array element is name and second is icon url + //assuming first array element is name and second is icon url a.name(auth.0); - if auth.1 != None { - a.icon_url(auth.1.unwrap()); - } + a.icon_url(auth.1); a }); @@ -222,10 +220,9 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { if input_embed.footer != None { let foot = input_embed.footer.unwrap(); e.footer(|f| { + //assuming first array element is name and second is icon url f.text(foot.0); - if foot.1 != None { - f.icon_url(foot.1.unwrap()); - } + f.icon_url(foot.1); f });