Cleanup & fixes

This commit is contained in:
Agatha Rose 2019-07-27 14:20:30 +03:00
parent fd40d4d0f6
commit 61736050ba
3 changed files with 474 additions and 306 deletions

643
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -15,58 +15,58 @@ use std::{env, process};
struct Handler;
impl EventHandler for Handler {
fn ready(&self, ctx: Context, ready: Ready) {
if let Some(shard) = ready.shard {
println!(
"{} is connected on shard {}/{}!",
ready.user.name, shard[0], shard[1]
);
println!("--------------------------------------------");
fn ready(&self, ctx: Context, ready: Ready) {
if let Some(shard) = ready.shard {
println!(
"{} is connected on shard {}/{}!",
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 status = OnlineStatus::Online;
use serenity::model::gateway::Game;
use serenity::model::user::OnlineStatus;
let game = Game::playing("with knives");
let status = OnlineStatus::Online;
ctx.set_presence(Some(game), status);
}
}
ctx.set_presence(Some(game), status);
}
}
}
fn main() {
// Login with a bot token from the environment
let mut client = Client::new(&env::var("DISCORD_TOKEN").expect("token"), Handler)
.expect("Error creating client");
client.with_framework(
StandardFramework::new()
.configure(|c| c.prefix("OwO ").case_insensitivity(true))
.cmd("init", init)
.cmd("gayculator", gayculator)
.command("ad", |c| {
c.cmd(ad).check(|_, msg, _, _| {
msg.guild_id == Some(serenity::model::id::GuildId(255386835964919810))
})
}).cmd("waffle", waffle)
.cmd("sausage", sausage)
.cmd("halt", halt)
.cmd("help", help)
.cmd("info", info)
.cmd("ping", ping)
.cmd("list_srv", list_srv)
.command("compare_bot", |c| {
c.cmd(compare_bot).known_as("compare bot")
})
.cmd("ship", ship)
.cmd("uwu", uwu)
/* .cmd("lyrics", lyrics) */
.cmd("host", host)
.cmd("what's this", what),
);
// Login with a bot token from the environment
let mut client = Client::new(&env::var("DISCORD_TOKEN").expect("token"), Handler)
.expect("Error creating client");
client.with_framework(
StandardFramework::new()
.configure(|c| c.prefix("OwO ").case_insensitivity(true))
.cmd("init", init)
.cmd("gayculator", gayculator)
.command("ad", |c| {
c.cmd(ad).check(|_, msg, _, _| {
msg.guild_id == Some(serenity::model::id::GuildId(255386835964919810))
})
})
.cmd("waffle", waffle)
.cmd("sausage", sausage)
.cmd("halt", halt)
.cmd("help", help)
.cmd("info", info)
.cmd("ping", ping)
.cmd("list_srv", list_srv)
.command("compare_bot", |c| {
c.cmd(compare_bot).known_as("compare bot")
})
.cmd("ship", ship)
.cmd("uwu", uwu)
.cmd("host", host)
.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);
}
// start listening for events by starting a single shard
if let Err(why) = client.start() {
println!("An error occurred while running the client: {:?}", why);
}
}
command!(init(_ctx, message) {
@ -114,7 +114,7 @@ command!(list_srv(_ctx, message) {
let guild = guild_lock.read();
list.push_str(&format!("{}: {}\n", index, guild.name));
}
let _ = message.channel_id.say(format!("{}", list));
let _ = message.channel_id.say(format!("{}", list.replace("@everyone", "WARN: @ mention used as server name")));
}
});
@ -189,8 +189,7 @@ command!(uwu(_ctx, message) {
command!(gayculator(_ctx, message, args) {
if message.author.id != 191948420141809665 {
let number_32: i32 = args.trim().parse()
.expect("ERR!");
let number_32: i32 = args.trim().parse().unwrap_or(1);
let mut result;
if number_32 % 2 == 0 {
result = "You are straight as heck!".to_string();
@ -206,6 +205,12 @@ if message.author.id != 191948420141809665 {
}
});
/* command!(notice(ctx, message, args) {
let query: String = args.trim().parse().expect("ERR");
let query = query.replace(" ", "+");
let link = String::from(format!("https://www.google.com/search?q={}&source=lnms&tbm=isch", query));
}); */
command!(waffle(_ctx, message) {
let _ = message.channel_id.say("Dongle!");
});
@ -222,7 +227,7 @@ command!(ad(_ctx, message) {
let _ = message.channel_id.send_message(|m| m
.embed(|e| e
.title(":b:ottom text")
***REMOVED***
.description("hey @\u{200B}everyone , JOIN OUR SUPER KOOL SERVER ON 1.5.2 CRACKED SERVER MARRIAGE GAY DRUGS TOWN OF SALEM PLUGINS ECONOMY NO GRIEF PROTECTION BETTER THAN HYPIXAL SUPPORTS EMOJI FREE OP CSGO PVP SKYWARS SKYBLOCC BLOCKCHAIN AR VR TENSORFLOW IoT QUANTUM COMPUTER SERVERLESS DARK DATA JAVA ALSO ITS LIKE ROBLOX AAAAA JOIN AT superkool.[B].cc OwO (edited)(edited)(edited)(edited)(edited)(edited)(edited)")
.thumbnail("https://i.imgur.com/8MU0gqD.png")
.color(0x00f3ff))
);
@ -258,8 +263,8 @@ let num = CACHE.read().guilds.len();
let _ = message.channel_id.send_message(|m| m
.embed(|e| e
.title("Discordinator9000's info:")
.description(":gear: I can do stuff :cucumber:")
.field("Author:", "EvilDeaaaadd#1337", false)
.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 )
.footer(|f| f
@ -296,22 +301,22 @@ command!(what(_ctx, message, args){
});
/*command!(lyrics(_ctx, _message, _args) {
use select::document::Document;
use select::predicate::{Predicate, Attr, Class, Name};
use select::document::Document;
use select::predicate::{Predicate, Attr, Class, Name};
}); */
/*command!(embed_test(_ctx, message) {
let _ = message.channel_id.send_message(|m| m
.content("Hello, World!")
.embed(|e| e
.title("This is a title")
.description("This is a description")
.fields(vec![
("This is the first field", "This is a field body", true),
("This is the second field", "Both of these fields are inline", true),
])
.field("This is the third field", "This is not an inline field", false)
.footer(|f| f
.text("This is a footer"))));
let _ = message.channel_id.send_message(|m| m
.content("Hello, World!")
.embed(|e| e
.title("This is a title")
.description("This is a description")
.fields(vec![
("This is the first field", "This is a field body", true),
("This is the second field", "Both of these fields are inline", true),
])
.field("This is the third field", "This is not an inline field", false)
.footer(|f| f
.text("This is EvilDeaaaadd#1337a footer"))));
}); */

Binary file not shown.