forked from sorceress/rustcord
Cleanup & fixes
This commit is contained in:
parent
fd40d4d0f6
commit
61736050ba
File diff suppressed because it is too large
Load Diff
137
src/main.rs
137
src/main.rs
|
@ -15,58 +15,58 @@ use std::{env, process};
|
||||||
struct Handler;
|
struct Handler;
|
||||||
|
|
||||||
impl EventHandler for Handler {
|
impl EventHandler for Handler {
|
||||||
fn ready(&self, ctx: Context, ready: Ready) {
|
fn ready(&self, ctx: Context, ready: Ready) {
|
||||||
if let Some(shard) = ready.shard {
|
if let Some(shard) = ready.shard {
|
||||||
println!(
|
println!(
|
||||||
"{} is connected on shard {}/{}!",
|
"{} is connected on shard {}/{}!",
|
||||||
ready.user.name, shard[0], shard[1]
|
ready.user.name, shard[0], shard[1]
|
||||||
);
|
);
|
||||||
println!("--------------------------------------------");
|
println!("--------------------------------------------");
|
||||||
|
|
||||||
use serenity::model::gateway::Game;
|
use serenity::model::gateway::Game;
|
||||||
use serenity::model::user::OnlineStatus;
|
use serenity::model::user::OnlineStatus;
|
||||||
let game = Game::playing("with knives");
|
let game = Game::playing("with knives");
|
||||||
let status = OnlineStatus::Online;
|
let status = OnlineStatus::Online;
|
||||||
|
|
||||||
ctx.set_presence(Some(game), status);
|
ctx.set_presence(Some(game), status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Login with a bot token from the environment
|
// Login with a bot token from the environment
|
||||||
let mut client = Client::new(&env::var("DISCORD_TOKEN").expect("token"), Handler)
|
let mut client = Client::new(&env::var("DISCORD_TOKEN").expect("token"), Handler)
|
||||||
.expect("Error creating client");
|
.expect("Error creating client");
|
||||||
client.with_framework(
|
client.with_framework(
|
||||||
StandardFramework::new()
|
StandardFramework::new()
|
||||||
.configure(|c| c.prefix("OwO ").case_insensitivity(true))
|
.configure(|c| c.prefix("OwO ").case_insensitivity(true))
|
||||||
.cmd("init", init)
|
.cmd("init", init)
|
||||||
.cmd("gayculator", gayculator)
|
.cmd("gayculator", gayculator)
|
||||||
.command("ad", |c| {
|
.command("ad", |c| {
|
||||||
c.cmd(ad).check(|_, msg, _, _| {
|
c.cmd(ad).check(|_, msg, _, _| {
|
||||||
msg.guild_id == Some(serenity::model::id::GuildId(255386835964919810))
|
msg.guild_id == Some(serenity::model::id::GuildId(255386835964919810))
|
||||||
})
|
})
|
||||||
}).cmd("waffle", waffle)
|
})
|
||||||
.cmd("sausage", sausage)
|
.cmd("waffle", waffle)
|
||||||
.cmd("halt", halt)
|
.cmd("sausage", sausage)
|
||||||
.cmd("help", help)
|
.cmd("halt", halt)
|
||||||
.cmd("info", info)
|
.cmd("help", help)
|
||||||
.cmd("ping", ping)
|
.cmd("info", info)
|
||||||
.cmd("list_srv", list_srv)
|
.cmd("ping", ping)
|
||||||
.command("compare_bot", |c| {
|
.cmd("list_srv", list_srv)
|
||||||
c.cmd(compare_bot).known_as("compare bot")
|
.command("compare_bot", |c| {
|
||||||
})
|
c.cmd(compare_bot).known_as("compare bot")
|
||||||
.cmd("ship", ship)
|
})
|
||||||
.cmd("uwu", uwu)
|
.cmd("ship", ship)
|
||||||
/* .cmd("lyrics", lyrics) */
|
.cmd("uwu", uwu)
|
||||||
.cmd("host", host)
|
.cmd("host", host)
|
||||||
.cmd("what's this", what),
|
.cmd("what's this", what),
|
||||||
);
|
);
|
||||||
|
|
||||||
// start listening for events by starting a single shard
|
// start listening for events by starting a single shard
|
||||||
if let Err(why) = client.start() {
|
if let Err(why) = client.start() {
|
||||||
println!("An error occurred while running the client: {:?}", why);
|
println!("An error occurred while running the client: {:?}", why);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
command!(init(_ctx, message) {
|
command!(init(_ctx, message) {
|
||||||
|
@ -114,7 +114,7 @@ command!(list_srv(_ctx, message) {
|
||||||
let guild = guild_lock.read();
|
let guild = guild_lock.read();
|
||||||
list.push_str(&format!("{}: {}\n", index, guild.name));
|
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) {
|
command!(gayculator(_ctx, message, args) {
|
||||||
if message.author.id != 191948420141809665 {
|
if message.author.id != 191948420141809665 {
|
||||||
let number_32: i32 = args.trim().parse()
|
let number_32: i32 = args.trim().parse().unwrap_or(1);
|
||||||
.expect("ERR!");
|
|
||||||
let mut result;
|
let mut result;
|
||||||
if number_32 % 2 == 0 {
|
if number_32 % 2 == 0 {
|
||||||
result = "You are straight as heck!".to_string();
|
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) {
|
command!(waffle(_ctx, message) {
|
||||||
let _ = message.channel_id.say("Dongle!");
|
let _ = message.channel_id.say("Dongle!");
|
||||||
});
|
});
|
||||||
|
@ -222,7 +227,7 @@ command!(ad(_ctx, message) {
|
||||||
let _ = message.channel_id.send_message(|m| m
|
let _ = message.channel_id.send_message(|m| m
|
||||||
.embed(|e| e
|
.embed(|e| e
|
||||||
.title(":b:ottom text")
|
.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")
|
.thumbnail("https://i.imgur.com/8MU0gqD.png")
|
||||||
.color(0x00f3ff))
|
.color(0x00f3ff))
|
||||||
);
|
);
|
||||||
|
@ -258,8 +263,8 @@ let num = CACHE.read().guilds.len();
|
||||||
let _ = message.channel_id.send_message(|m| m
|
let _ = message.channel_id.send_message(|m| m
|
||||||
.embed(|e| e
|
.embed(|e| e
|
||||||
.title("Discordinator9000's info:")
|
.title("Discordinator9000's info:")
|
||||||
.description(":gear: I can do stuff :cucumber:")
|
.description(":h_:")
|
||||||
.field("Author:", "EvilDeaaaadd#1337", false)
|
.field("Author:", "EvilDeaaaadd#9000", false)
|
||||||
.field("Server count:", num , false)
|
.field("Server count:", num , false)
|
||||||
.field("Invite:", "[Invite link](https://discordapp.com/api/oauth2/authorize?client_id=470350233419907129&permissions=2048&scope=bot)", false )
|
.field("Invite:", "[Invite link](https://discordapp.com/api/oauth2/authorize?client_id=470350233419907129&permissions=2048&scope=bot)", false )
|
||||||
.footer(|f| f
|
.footer(|f| f
|
||||||
|
@ -296,22 +301,22 @@ command!(what(_ctx, message, args){
|
||||||
});
|
});
|
||||||
|
|
||||||
/*command!(lyrics(_ctx, _message, _args) {
|
/*command!(lyrics(_ctx, _message, _args) {
|
||||||
use select::document::Document;
|
use select::document::Document;
|
||||||
use select::predicate::{Predicate, Attr, Class, Name};
|
use select::predicate::{Predicate, Attr, Class, Name};
|
||||||
|
|
||||||
}); */
|
}); */
|
||||||
|
|
||||||
/*command!(embed_test(_ctx, message) {
|
/*command!(embed_test(_ctx, message) {
|
||||||
let _ = message.channel_id.send_message(|m| m
|
let _ = message.channel_id.send_message(|m| m
|
||||||
.content("Hello, World!")
|
.content("Hello, World!")
|
||||||
.embed(|e| e
|
.embed(|e| e
|
||||||
.title("This is a title")
|
.title("This is a title")
|
||||||
.description("This is a description")
|
.description("This is a description")
|
||||||
.fields(vec![
|
.fields(vec![
|
||||||
("This is the first field", "This is a field body", true),
|
("This is the first field", "This is a field body", true),
|
||||||
("This is the second field", "Both of these fields are inline", 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)
|
.field("This is the third field", "This is not an inline field", false)
|
||||||
.footer(|f| f
|
.footer(|f| f
|
||||||
.text("This is a footer"))));
|
.text("This is EvilDeaaaadd#1337a footer"))));
|
||||||
}); */
|
}); */
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue