From 74f795e1b0d78c8f8d44b42069d6d45729cd0c13 Mon Sep 17 00:00:00 2001 From: Agatha Rose Date: Sat, 27 Jul 2019 15:08:05 +0300 Subject: [PATCH] Headpats --- src/main.rs | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index ac70f9e..5c5eab0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,8 @@ #[macro_use] extern crate serenity; extern crate rand; -extern crate urbandict; -//extern crate select; extern crate sys_info; +extern crate urbandict; use rand::Rng; use serenity::client::Client; @@ -18,14 +17,13 @@ impl EventHandler for Handler { fn ready(&self, ctx: Context, ready: Ready) { if let Some(shard) = ready.shard { println!( - "{} is connected on shard {}/{}!", + "INFO: {} is connected on shard {}/{}!\n>>", ready.user.name, shard[0], shard[1] ); - println!("--------------------------------------------"); use serenity::model::gateway::Game; use serenity::model::user::OnlineStatus; - let game = Game::playing("with knives"); + let game = Game::playing("with lemons"); let status = OnlineStatus::Online; ctx.set_presence(Some(game), status); @@ -39,7 +37,7 @@ fn main() { .expect("Error creating client"); client.with_framework( StandardFramework::new() - .configure(|c| c.prefix("OwO ").case_insensitivity(true)) + .configure(|c| c.prefix("OwO ").case_insensitivity(false)) .cmd("init", init) .cmd("gayculator", gayculator) .command("ad", |c| { @@ -60,12 +58,13 @@ fn main() { .cmd("ship", ship) .cmd("uwu", uwu) .cmd("host", host) + .cmd("headpat", headpat) .cmd("what's this", what), ); // start listening for events by starting a single shard - if let Err(why) = client.start() { - println!("An error occurred while running the client: {:?}", why); + if let Err(e) = client.start() { + println!("An error occurred while running the client: {:?}", e); } } @@ -73,7 +72,7 @@ command!(init(_ctx, message) { let num = rand::thread_rng().gen_range(0, 2); match num { 0 => { - let _ = message.channel_id.say("The Discordinator9000 is ready to kick yer butts!"); + let _ = message.channel_id.say("The Discordinator9000 is going sicko mode!"); } 1 => { let _ = message.channel_id.say("The Discordinator9000 is ready to take over the world!"); @@ -158,6 +157,15 @@ use std::hash::{Hash, Hasher}; } }); +command!(headpat(_ctx, message, args) { + message.channel_id.send_message(|m| + m.embed(|e| + e.title(format!("Sending headpats to {}...", args.trim().to_string())) + .image("https://i.pinimg.com/originals/83/1a/90/831a903eab6d827dcfd298b9e3196e30.jpg") + .description("Source: https://www.pinterest.com/pin/377809856242075277/")) + ).expect("Failed to send message!"); +}); + command!(uwu(_ctx, message) { let num = rand::thread_rng().gen_range(0, 4); match num { @@ -249,7 +257,7 @@ command!(help(_ctx, message) { ("OwO what's this ``word``", "Find a definition of word", false), ("OwO ship ``name 1`` ``name 2``", "*shipping intensifies*", false), ("Admin commands:", "\u{200B}", true), - ("OwO halt", "shut me down", false), + ("OwO halt", "kill me", false), ("OwO list_srv", "list my servers", false), ("OwO host", "Display host info", false) ]) @@ -263,7 +271,7 @@ let num = CACHE.read().guilds.len(); let _ = message.channel_id.send_message(|m| m .embed(|e| e .title("Discordinator9000's info:") - .description(":h_:") + .description("h") .field("Author:", "EvilDeaaaadd#9000", false) .field("Server count:", num , false) .field("Invite:", "[Invite link](https://discordapp.com/api/oauth2/authorize?client_id=470350233419907129&permissions=2048&scope=bot)", false ) @@ -282,7 +290,7 @@ let text: String = args.trim().parse() } else if text.to_lowercase().contains("amit") { let _ = message.channel_id.say("Amiter is big dumb"); } else if text.to_lowercase().contains("discordinator") { - let _ = message.channel_id.say("Metaaaa, dude"); + let _ = message.channel_id.say("Option<(!, ())>"); } else { let _ = message.channel_id.say(format!("Me and {} are friends!", text)); }