Update !ping to not mention users

This commit is contained in:
Agatha Rose 2020-06-11 16:39:43 +03:00
parent e53eb8adf2
commit 0b9dc15067
1 changed files with 10 additions and 3 deletions

View File

@ -15,7 +15,12 @@ use serenity::{
Args, CheckResult, CommandError, CommandOptions, CommandResult, DispatchError, Reason,
StandardFramework,
},
model::{channel::Message, gateway::Ready, id::{ChannelId, UserId}, user::OnlineStatus},
model::{
channel::Message,
gateway::Ready,
id::{ChannelId, UserId},
user::OnlineStatus,
},
prelude::*,
};
use std::collections::hash_map::DefaultHasher;
@ -166,7 +171,9 @@ fn ping(ctx: &mut Context, message: &Message) -> CommandResult {
None => return Err(CommandError("Could not get latency!".to_string())),
};
let _ = message.reply(&ctx, format!("Pong! Latency: {}ms", ping));
let _ = message
.channel_id
.say(&ctx, format!("Pong! Latency: {}ms", ping));
Ok(())
}
@ -654,7 +661,7 @@ fn pinned(ctx: &mut Context, message: &Message, mut args: Args) -> CommandResult
}
let target_channel = match args.single::<ChannelId>() {
Ok(v) => v,
Err(_) => message.channel_id
Err(_) => message.channel_id,
};
let pinned = match target_channel.pins(&ctx.http) {
Ok(v) => v,