use Option::and_then
This commit is contained in:
@@ -63,8 +63,7 @@ pub async fn dox(mut ctx: Context<'_>,
|
|||||||
.title(format!("Information about {}", user.name))
|
.title(format!("Information about {}", user.name))
|
||||||
.description(get_dox_output(
|
.description(get_dox_output(
|
||||||
&mut ctx, &user, member.as_ref(), show_permissions.unwrap_or(false)))
|
&mut ctx, &user, member.as_ref(), show_permissions.unwrap_or(false)))
|
||||||
.colour(member.map(|m| m.colour(ctx.cache()))
|
.colour(member.and_then(|m| m.colour(ctx.cache()))
|
||||||
.unwrap_or(None)
|
|
||||||
.unwrap_or(user.accent_colour.unwrap_or(Colour::from_rgb(255, 255, 255))))
|
.unwrap_or(user.accent_colour.unwrap_or(Colour::from_rgb(255, 255, 255))))
|
||||||
.image(user.face());
|
.image(user.face());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user