Add thumbnail field to embeds

This commit is contained in:
Agatha Rose 2020-06-11 18:45:06 +03:00
parent 42f2f855c8
commit 825311d9f9
1 changed files with 7 additions and 0 deletions

View File

@ -262,6 +262,7 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
fields: Option<Vec<(String, String, bool)>>,
footer: Option<(String, String)>,
image: Option<String>,
thumbnail: Option<String>,
timestamp: Option<String>,
title: Option<String>,
url: Option<String>,
@ -288,6 +289,7 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
});
}
// Set embed colour unless empty
if input_embed.colour.is_some() {
e.color(Colour::new(
u32::from_str_radix(&input_embed.colour.unwrap(), 16)
@ -321,6 +323,10 @@ fn embed(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
e.image(input_embed.image.unwrap());
}
if input_embed.thumbnail.is_some() {
e.thumbnail(input_embed.thumbnail.unwrap());
}
if input_embed.timestamp.is_some() {
e.timestamp(input_embed.timestamp.unwrap());
}
@ -604,6 +610,7 @@ fn define(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
def.definition.replace(|c| c == '[' || c == ']', ""),
false,
)
.color(0xffd1dc)
})
});
} else {