Make !pfp fall back to current user
This commit is contained in:
parent
58dc9358e9
commit
4f83ece8f8
|
@ -701,9 +701,9 @@ fn define(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
|||
|
||||
#[command]
|
||||
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() {
|
||||
0 => return Err(CommandError("Please specify a username!".to_string())),
|
||||
0 => &message.author,
|
||||
_ => &message.mentions[0],
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue