forked from sorceress/rustcord
Fix headpat command mentions
This commit is contained in:
parent
c164c0762b
commit
98e8481ab8
|
@ -362,9 +362,15 @@ fn ship(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
fn headpat(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
fn headpat(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
||||||
|
let name = match message.mentions.len() {
|
||||||
|
0 => args.rest().trim(),
|
||||||
|
_ => message.mentions[0].name.as_str()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
if let Err(e) = message.channel_id.send_message(&ctx.http, |m| {
|
if let Err(e) = message.channel_id.send_message(&ctx.http, |m| {
|
||||||
m.embed(|e| {
|
m.embed(|e| {
|
||||||
e.title(format!("Sending headpats to **{}**...", args.rest().trim()))
|
e.title(format!("Sending headpats to **{}**...", name))
|
||||||
.image(
|
.image(
|
||||||
"https://i.pinimg.com/originals/83/1a/90/831a903eab6d827dcfd298b9e3196e30.jpg",
|
"https://i.pinimg.com/originals/83/1a/90/831a903eab6d827dcfd298b9e3196e30.jpg",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue