Minor cleanup

This commit is contained in:
EvilDeaaaadd 2020-01-16 22:40:12 +02:00
parent 7ade211de6
commit 4cd7ee7e4f
3 changed files with 6 additions and 6 deletions

2
Cargo.lock generated
View File

@ -1194,7 +1194,7 @@ dependencies = [
[[package]] [[package]]
name = "rustcord" name = "rustcord"
version = "0.2.6" version = "0.2.7"
dependencies = [ dependencies = [
"owoify 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "owoify 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "rustcord" name = "rustcord"
version = "0.2.6" version = "0.2.7"
authors = ["Agatha <@protonmail.com>"] authors = ["Agatha <@protonmail.com>"]
edition = "2018" edition = "2018"

View File

@ -135,7 +135,7 @@ fn list_srv(ctx: &mut Context, message: &Message) -> CommandResult {
} }
let _ = message.channel_id.say( let _ = message.channel_id.say(
&ctx.http, &ctx.http,
list.replace("@everyone", "@\u{200B}everyone").to_string(), list.replace("@everyone", "@\u{200B}everyone"),
); );
Ok(()) Ok(())
@ -399,15 +399,15 @@ fn compare_bot(ctx: &mut Context, message: &Message, mut args: Args) -> CommandR
#[aliases("what's this")] #[aliases("what's this")]
fn what(ctx: &mut Context, message: &Message, args: Args) -> CommandResult { fn what(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
let text: String = args.rest().trim().to_string(); let text: String = args.rest().trim().to_string();
let defs = &urbandict::get_definitions(&text.to_string()); let defs = &urbandict::get_definitions(&text);
match defs { match defs {
Err(_e) => { Err(_e) => {
let _ = message let _ = message
.channel_id .channel_id
.say(&ctx.http, format!("Invalid query >w<")); .say(&ctx.http, "Invalid query >w<".to_string());
} }
Ok(v) => { Ok(v) => {
if v.len() > 0 { if !v.is_empty() {
let def = &v[0]; let def = &v[0];
let _ = message.channel_id.send_message(&ctx.http, |m| { let _ = message.channel_id.send_message(&ctx.http, |m| {
m.embed(|e| { m.embed(|e| {