Update !ping to not mention users

This commit is contained in:
Agatha Rose 2020-06-11 16:39:43 +03:00
parent fa0e51697b
commit 4a43bf6218
No known key found for this signature in database
GPG Key ID: 3F9F2317B3D5C3AC
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,