Make !pfp fall back to current user

This commit is contained in:
Agatha Lovelace 2020-06-18 15:34:44 +03:00
parent b6fac54462
commit 766de88a33
No known key found for this signature in database
GPG Key ID: 2DB18BA2E0A80BC3
1 changed files with 2 additions and 2 deletions

View File

@ -701,9 +701,9 @@ fn define(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
#[command] #[command]
fn pfp(ctx: &mut Context, message: &Message) -> CommandResult { fn pfp(ctx: &mut Context, message: &Message) -> CommandResult {
// Get username from first mention, otherwise use input text // Get username from first mention, otherwise use current username
let user = match message.mentions.len() { let user = match message.mentions.len() {
0 => return Err(CommandError("Please specify a username!".to_string())), 0 => &message.author,
_ => &message.mentions[0], _ => &message.mentions[0],
}; };