forked from sorceress/rustcord
full rewrite
This commit is contained in:
parent
4ac2f0f75e
commit
27a868085d
|
@ -1,3 +1,2 @@
|
|||
|
||||
/target
|
||||
**/*.rs.bk
|
||||
|
|
File diff suppressed because it is too large
Load Diff
14
Cargo.toml
14
Cargo.toml
|
@ -1,12 +1,14 @@
|
|||
[package]
|
||||
name = "rustcord"
|
||||
version = "0.2.1"
|
||||
name = "rustcordmkii"
|
||||
version = "0.1.0"
|
||||
authors = ["EvilDeaaaadd <EvilDeaaaadd@protonmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
serenity = "0.5.5"
|
||||
rand = "0.3.14"
|
||||
#select = "0.4.2"
|
||||
sys-info = "0.5.6"
|
||||
serenity = "0.7.0"
|
||||
rand = "0.7.2"
|
||||
sys-info = "0.5.8"
|
||||
urbandict = "0.2.0"
|
||||
owoify = "0.1.4"
|
||||
|
|
583
src/main.rs
583
src/main.rs
|
@ -1,17 +1,17 @@
|
|||
#[macro_use]
|
||||
extern crate serenity;
|
||||
extern crate rand;
|
||||
extern crate sys_info;
|
||||
extern crate urbandict;
|
||||
extern crate owoify;
|
||||
#![allow(clippy::unreadable_literal)]
|
||||
|
||||
use rand::Rng;
|
||||
use serenity::client::Client;
|
||||
use serenity::framework::standard::StandardFramework;
|
||||
use serenity::model::gateway::Ready;
|
||||
use serenity::prelude::*;
|
||||
use std::{env, process};
|
||||
use owoify::OwOifiable;
|
||||
use rand::Rng;
|
||||
use serenity::{
|
||||
client::Client,
|
||||
framework::standard::{
|
||||
macros::{check, command, group},
|
||||
Args, CheckResult, CommandOptions, CommandResult, DispatchError, Reason, StandardFramework,
|
||||
},
|
||||
model::{channel::Message, gateway::Ready, id::UserId, user::OnlineStatus},
|
||||
prelude::*,
|
||||
};
|
||||
use std::{env, process};
|
||||
|
||||
struct Handler;
|
||||
|
||||
|
@ -23,256 +23,343 @@ impl EventHandler for Handler {
|
|||
ready.user.name, shard[0], shard[1]
|
||||
);
|
||||
|
||||
use serenity::model::gateway::Game;
|
||||
use serenity::model::user::OnlineStatus;
|
||||
let game = Game::playing("with lemons");
|
||||
use serenity::model::gateway::Activity;
|
||||
let activity = Activity::listening("dj0nt");
|
||||
let status = OnlineStatus::Online;
|
||||
|
||||
ctx.set_presence(Some(game), status);
|
||||
ctx.set_presence(Some(activity), status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group!({
|
||||
name: "general",
|
||||
options: {},
|
||||
commands: [init, ping, halt, list_srv, host, ship, headpat, uwu, gayculator, waffle, sausage, ad, help, compare_bot, what, owo, info]
|
||||
});
|
||||
|
||||
fn main() {
|
||||
// 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("Invalid 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))
|
||||
})
|
||||
.configure(|c| {
|
||||
c.with_whitespace(true)
|
||||
.owners(vec![UserId(254310746450690048)].into_iter().collect())
|
||||
.prefixes(vec!["owo ", "OwO "])
|
||||
.no_dm_prefix(true)
|
||||
.case_insensitivity(true)
|
||||
.by_space(false)
|
||||
})
|
||||
.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")
|
||||
.on_dispatch_error(|ctx, msg, error| {
|
||||
if let DispatchError::CheckFailed("Owner", Reason::Unknown) = error {
|
||||
let _ = msg.channel_id.say(&ctx.http, "no");
|
||||
} else if let DispatchError::Ratelimited(seconds) = error {
|
||||
let _ = msg
|
||||
.channel_id
|
||||
.say(&ctx.http, &format!("Try again in {} seconds.", seconds));
|
||||
}
|
||||
})
|
||||
.cmd("ship", ship)
|
||||
.cmd("uwu", uwu)
|
||||
.cmd("owo", owo)
|
||||
.cmd("host", host)
|
||||
.cmd("headpat", headpat)
|
||||
.cmd("what's this", what),
|
||||
.group(&GENERAL_GROUP),
|
||||
);
|
||||
|
||||
// start listening for events by starting a single shard
|
||||
if let Err(e) = client.start() {
|
||||
println!("An error occurred while running the client: {:?}", e);
|
||||
}
|
||||
}
|
||||
|
||||
command!(init(_ctx, message) {
|
||||
let num = rand::thread_rng().gen_range(0, 2);
|
||||
match num {
|
||||
0 => {
|
||||
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!");
|
||||
}
|
||||
_ => {
|
||||
let _ = message.channel_id.say("Oopsie woopsie! UwU");
|
||||
}
|
||||
#[check]
|
||||
#[name = "Owner"]
|
||||
fn owner_check(_: &mut Context, msg: &Message, _: &mut Args, _: &CommandOptions) -> CheckResult {
|
||||
if msg.author.id == 254310746450690048 {
|
||||
CheckResult::Success
|
||||
} else {
|
||||
CheckResult::Failure(Reason::Unknown)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
command!(ping(_ctx, message) {
|
||||
let _ = message.reply("Pong!");
|
||||
});
|
||||
#[check]
|
||||
#[name = "Server"]
|
||||
fn server_check(_: &mut Context, msg: &Message, _: &mut Args, _: &CommandOptions) -> CheckResult {
|
||||
(msg.guild_id == Some(serenity::model::id::GuildId(255386835964919810))).into()
|
||||
}
|
||||
|
||||
command!(halt(ctx, message) {
|
||||
if message.author.id == 254310746450690048 {
|
||||
use serenity::model::user::OnlineStatus;
|
||||
let status = OnlineStatus::Offline;
|
||||
ctx.set_presence(None, status);
|
||||
ctx.quit();
|
||||
#[command]
|
||||
fn init(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let num = rand::thread_rng().gen_range(0, 2);
|
||||
match num {
|
||||
0 => {
|
||||
let _ = message
|
||||
.channel_id
|
||||
.say(&ctx.http, "The Discordinator9000 is going sicko mode!");
|
||||
}
|
||||
1 => {
|
||||
let _ = message.channel_id.say(
|
||||
&ctx.http,
|
||||
"The Discordinator9000 is ready to take over the world!",
|
||||
);
|
||||
}
|
||||
_ => {
|
||||
let _ = message.channel_id.say(&ctx.http, "Oopsie woopsie! UwU");
|
||||
}
|
||||
}
|
||||
|
||||
use std::{thread, time};
|
||||
let one_s = time::Duration::new(2, 0);
|
||||
thread::sleep(one_s);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
process::exit(0);
|
||||
} else {
|
||||
let _ = message.channel_id.say("no");
|
||||
}
|
||||
});
|
||||
#[command]
|
||||
fn ping(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let _ = message.reply(&ctx, "Pong!");
|
||||
|
||||
command!(list_srv(_ctx, message) {
|
||||
if message.author.id == 254310746450690048 {
|
||||
use serenity::CACHE;
|
||||
let cache = CACHE.read();
|
||||
let mut list = String::new();
|
||||
for (index, guild_lock) in cache.guilds.values().enumerate() {
|
||||
let guild = guild_lock.read();
|
||||
list.push_str(&format!("{}: {}\n", index, guild.name));
|
||||
}
|
||||
let _ = message.channel_id.say(list.replace("@everyone", "WARN: @ mention used as server name").to_string());
|
||||
}
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
command!(host(_ctx, message) {
|
||||
if message.author.id == 254310746450690048 {
|
||||
let _ = message.channel_id.say(format!("Debug\nOS: {:?}\nHost: {:?}", sys_info::os_type().unwrap(), sys_info::hostname().unwrap()));
|
||||
}
|
||||
});
|
||||
#[command]
|
||||
#[checks(Owner)]
|
||||
fn halt(ctx: &mut Context) -> CommandResult {
|
||||
ctx.set_presence(None, OnlineStatus::Offline);
|
||||
|
||||
command!(ship(_ctx, message, args) {
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::{thread, time};
|
||||
let one_s = time::Duration::new(2, 0);
|
||||
thread::sleep(one_s);
|
||||
|
||||
let first = calculate_hash(&args.single::<String>().unwrap());
|
||||
let second = calculate_hash(&args.single::<String>().unwrap());
|
||||
let mut slider = String::new();
|
||||
let res = (first % second) / 100000000000000000;
|
||||
process::exit(0);
|
||||
}
|
||||
|
||||
let mut num = 0;
|
||||
while num < res / 10 {
|
||||
slider.push('▬');
|
||||
num += 1;
|
||||
}
|
||||
slider.push_str(":heart:");
|
||||
num = 0;
|
||||
while num < (10 - res / 10) {
|
||||
slider.push('▬');
|
||||
num += 1;
|
||||
}
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
.embed(|e| e
|
||||
.title(format!("{}%", res))
|
||||
.description(slider)
|
||||
.color(0xff00ce)
|
||||
));
|
||||
#[command]
|
||||
#[checks(Owner)]
|
||||
fn list_srv(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let mut list = String::new();
|
||||
let cache = ctx.cache.read();
|
||||
for (index, guild_lock) in cache.guilds.values().enumerate() {
|
||||
let guild = guild_lock.read();
|
||||
list.push_str(&format!("{}: {}\n", index, guild.name));
|
||||
}
|
||||
let _ = message.channel_id.say(
|
||||
&ctx.http,
|
||||
list.replace("@everyone", "@\u{200B}everyone").to_string(),
|
||||
);
|
||||
|
||||
fn calculate_hash<T: Hash>(t: &T) -> u64 {
|
||||
let mut s = DefaultHasher::new();
|
||||
t.hash(&mut s);
|
||||
s.finish()
|
||||
}
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
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]
|
||||
#[checks(Owner)]
|
||||
fn host(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let _ = message.channel_id.say(
|
||||
&ctx.http,
|
||||
format!(
|
||||
"Debug\nOS: {:?}\nHost: {:?}",
|
||||
sys_info::os_type().unwrap(),
|
||||
sys_info::hostname().unwrap()
|
||||
),
|
||||
);
|
||||
|
||||
command!(owo(_ctx, message, args) {
|
||||
let _ = message.channel_id.say(args.trim().to_string().owoify());
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
command!(uwu(_ctx, message) {
|
||||
let num = rand::thread_rng().gen_range(0, 4);
|
||||
match num {
|
||||
0 => {
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
#[command]
|
||||
fn ship(ctx: &mut Context, message: &Message, mut args: Args) -> CommandResult {
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
let first = calculate_hash(
|
||||
&args
|
||||
.single::<String>()
|
||||
.unwrap_or_else(|_| "Null".to_string()),
|
||||
);
|
||||
let second = calculate_hash(
|
||||
&args
|
||||
.single::<String>()
|
||||
.unwrap_or_else(|_| "Null".to_string()),
|
||||
);
|
||||
let mut slider = String::new();
|
||||
let res = (first % second) / 100000000000000000;
|
||||
|
||||
let mut num = 0;
|
||||
while num < res / 10 {
|
||||
slider.push('▬');
|
||||
num += 1;
|
||||
}
|
||||
slider.push_str(":heart:");
|
||||
num = 0;
|
||||
while num < (10 - res / 10) {
|
||||
slider.push('▬');
|
||||
num += 1;
|
||||
}
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| {
|
||||
m.embed(|e| {
|
||||
e.title(format!("{}%", res))
|
||||
.description(slider)
|
||||
.color(0xff00ce)
|
||||
})
|
||||
});
|
||||
|
||||
fn calculate_hash<T: Hash>(t: &T) -> u64 {
|
||||
let mut s = DefaultHasher::new();
|
||||
t.hash(&mut s);
|
||||
s.finish()
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
fn headpat(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
||||
message
|
||||
.channel_id
|
||||
.send_message(&ctx.http, |m| {
|
||||
m.embed(|e| {
|
||||
e.title(format!("Sending headpats to **{}**...", args.rest().trim()))
|
||||
.image("https://i.pinimg.com/originals/83/1a/90/831a903eab6d827dcfd298b9e3196e30.jpg")
|
||||
.description("[Source](https://www.pinterest.com/pin/377809856242075277/)")
|
||||
})
|
||||
})
|
||||
.expect("Failed to send message!");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
fn uwu(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let num = rand::thread_rng().gen_range(0, 4);
|
||||
match num {
|
||||
0 => {
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| m
|
||||
.embed(|e| e
|
||||
.image("https://i.redditmedia.com/qDD9W7NJqTAk31y061TuRW9R8qOcCuEmmCWyOsUEavE.png?fit=crop&crop=faces%2Centropy&arh=2&w=640&s=ebdd3f1970b4fe70ccd24a1958e7fc32")
|
||||
)); }
|
||||
1 => {
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
));
|
||||
}
|
||||
1 => {
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| m
|
||||
.embed(|e| e
|
||||
.image("https://www.shitpostbot.com/img/sourceimages/smash-that-mfuckn-uwu-button-57b5aa1de9fe4.jpeg")
|
||||
)); }
|
||||
2 => {
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
.embed(|e| e
|
||||
));
|
||||
}
|
||||
2 => {
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| {
|
||||
m.embed(|e| {
|
||||
e
|
||||
.image("https://www.shitpostbot.com/img/sourceimages/fallout-nv-owo-57e586ae15322.jpeg")
|
||||
)); }
|
||||
3 => {
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
})
|
||||
});
|
||||
}
|
||||
3 => {
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| m
|
||||
.embed(|e| e
|
||||
.image("https://i.redditmedia.com/-JaK9YW7mPz2S2xBJmXvW4fZ58uGMa4l6GIgYt3dqZg.jpg?fit=crop&crop=faces%2Centropy&arh=2&w=640&s=ebab29a577346b4d18ec914538b69bb4")
|
||||
)); }
|
||||
_ => {
|
||||
let _ = message.channel_id.say("UwU");
|
||||
}
|
||||
}
|
||||
});
|
||||
));
|
||||
}
|
||||
_ => {
|
||||
let _ = message.channel_id.say(&ctx.http, "UwU");
|
||||
}
|
||||
}
|
||||
|
||||
command!(gayculator(_ctx, message, args) {
|
||||
if message.author.id != 191948420141809665 {
|
||||
let number_32: i32 = args.trim().parse().unwrap_or(1);
|
||||
let mut result = if number_32 % 2 == 0 { "You are straight as heck!".to_string() } else { "You are hella gay!".to_string() };
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
.embed(|e| e
|
||||
.title("Gayness level:")
|
||||
.description(result)
|
||||
.color(0xff00f9)
|
||||
));
|
||||
}
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/* 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]
|
||||
fn gayculator(ctx: &mut Context, message: &Message, mut args: Args) -> CommandResult {
|
||||
//the amiter check
|
||||
if message.author.id != 191948420141809665 {
|
||||
let number_32: i32 = args.single::<i32>().unwrap_or(1);
|
||||
let result = if number_32 % 2 == 0 {
|
||||
"much straight".to_string()
|
||||
} else {
|
||||
"large gay".to_string()
|
||||
};
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| {
|
||||
m.embed(|e| {
|
||||
e.title("Gayness level:")
|
||||
.description(result)
|
||||
.color(0xff00f9)
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
command!(waffle(_ctx, message) {
|
||||
let _ = message.channel_id.say("h");
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
command!(sausage(_ctx, message) {
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
.embed(|e| e
|
||||
#[command]
|
||||
fn waffle(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let _ = message.channel_id.say(&ctx.http, "h");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
fn sausage(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| {
|
||||
m.embed(|e| {
|
||||
e
|
||||
.title("Dongle!")
|
||||
.image("https://cdn.discordapp.com/attachments/379673147764506624/431546724637736971/image.png"))
|
||||
);
|
||||
});
|
||||
.image("https://cdn.discordapp.com/attachments/379673147764506624/431546724637736971/image.png")
|
||||
})
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
command!(ad(_ctx, message) {
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
#[command]
|
||||
#[checks(Server)]
|
||||
fn ad(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| m
|
||||
.embed(|e| e
|
||||
.title(":b:ottom text")
|
||||
.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)")
|
||||
***REMOVED***
|
||||
.thumbnail("https://i.imgur.com/8MU0gqD.png")
|
||||
.color(0x00f3ff))
|
||||
);
|
||||
});
|
||||
|
||||
command!(help(_ctx, message) {
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
.embed(|e| e
|
||||
.title("Availble commands:")
|
||||
.description("All commands are case-insensitive")
|
||||
.fields(vec![
|
||||
("owo init", "Introduce me", false),
|
||||
("owo ping", "Pong", false),
|
||||
("owo waffle", "stroopwafel owo", false),
|
||||
("owo sausage", "sosig", false),
|
||||
("owo help", "Help the fellow humanz!", false),
|
||||
("owo info", "Show information about me!", false),
|
||||
("owo compare_bot ``bot's name``", "Compare me to other robots!", false),
|
||||
("owo what's this ``word``", "Find a definition of word", false),
|
||||
("owo ship ``name 1`` ``name 2``", "*shipping intensifies*", false),
|
||||
("owo headpat ``name``", "Headpat someone", false),
|
||||
("owo owo ``text``", "owoify input text", false),
|
||||
("Admin commands:", "\u{200B}", true),
|
||||
("owo halt", "kill me", false),
|
||||
("owo list_srv", "list my servers", false),
|
||||
("owo host", "Display host info", false)
|
||||
])
|
||||
.color(0x000000)
|
||||
));
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
command!(info(_ctx, message) {
|
||||
use serenity::CACHE;
|
||||
let num = CACHE.read().guilds.len();
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
#[command]
|
||||
fn help(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| {
|
||||
m.embed(|e| {
|
||||
e.title("Availble commands:")
|
||||
.description("All commands are case-insensitive")
|
||||
.fields(vec![
|
||||
("owo init", "Introduce me", false),
|
||||
("owo ping", "Pong", false),
|
||||
("owo waffle", "stroopwafel owo", false),
|
||||
("owo sausage", "sosig", false),
|
||||
("owo help", "Help the fellow humanz!", false),
|
||||
("owo info", "Show information about me!", false),
|
||||
(
|
||||
"owo compare_bot ``bot's name``",
|
||||
"Compare me to other robots!",
|
||||
false,
|
||||
),
|
||||
(
|
||||
"owo what's this ``word``",
|
||||
"Find a definition of word",
|
||||
false,
|
||||
),
|
||||
(
|
||||
"owo ship ``name 1`` ``name 2``",
|
||||
"*shipping intensifies*",
|
||||
false,
|
||||
),
|
||||
("owo headpat ``name``", "Headpat someone", false),
|
||||
("owo owo ``text``", "owoify input text", false),
|
||||
("Admin commands:", "\u{200B}", true),
|
||||
("owo halt", "kill me", false),
|
||||
("owo list_srv", "list my servers", false),
|
||||
("owo host", "Display host info", false),
|
||||
])
|
||||
.color(0x000000)
|
||||
})
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
fn info(ctx: &mut Context, message: &Message) -> CommandResult {
|
||||
let num = ctx.cache.read().guilds.len();
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| m
|
||||
.embed(|e| e
|
||||
.title("Discordinator9000's info:")
|
||||
.description("h")
|
||||
|
@ -280,34 +367,58 @@ let num = CACHE.read().guilds.len();
|
|||
.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
|
||||
.text("Written in Rust using Serenity library"))
|
||||
.text("Written in Rust using Serenity, OwOify and a few other libraries"))
|
||||
.color(0xee657)
|
||||
));
|
||||
});
|
||||
|
||||
command!(compare_bot(_ctx, message, args) {
|
||||
if message.author.id != 191948420141809665 {
|
||||
let text: String = args.trim().parse()
|
||||
.expect("ERR!");
|
||||
if text.to_lowercase().contains("nib") {
|
||||
let _ = message.channel_id.say("I am superior to NibBot");
|
||||
} 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("Option<(!, ())>");
|
||||
} else {
|
||||
let _ = message.channel_id.say(format!("Me and {} are friends!", text));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
});
|
||||
|
||||
command!(what(_ctx, message, args){
|
||||
let text: String = args.trim().parse().expect("ERR");
|
||||
let defs = &urbandict::get_definitions(&text.to_string())?;
|
||||
let def = &defs[0];
|
||||
let _ = message.channel_id.send_message(|m| m
|
||||
.embed(|e| e
|
||||
.title(format!("Author: {}", def.author))
|
||||
.field("Definition: ", def.definition.replace(|c| c == '[' || c == ']', ""), false)
|
||||
));
|
||||
});
|
||||
#[command]
|
||||
#[aliases("compare")]
|
||||
fn compare_bot(ctx: &mut Context, message: &Message, mut args: Args) -> CommandResult {
|
||||
//the amiter check
|
||||
if message.author.id != 191948420141809665 {
|
||||
let text: String = args
|
||||
.single::<String>()
|
||||
.unwrap_or_else(|_| "Null".to_string());
|
||||
if text.to_lowercase().contains("nib") {
|
||||
let _ = message.channel_id.say(&ctx.http, "I am superior to NibBot");
|
||||
} else if text.to_lowercase().contains("amit") {
|
||||
let _ = message.channel_id.say(&ctx.http, "Amiter is big dumb");
|
||||
} else if text.to_lowercase().contains("discordinator") {
|
||||
let _ = message.channel_id.say(&ctx.http, "Option<(!, ())>");
|
||||
} else {
|
||||
let _ = message
|
||||
.channel_id
|
||||
.say(&ctx.http, format!("Me and {} are friends!", text));
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
#[aliases("what's this")]
|
||||
fn what(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
||||
let text: String = args.rest().to_string();
|
||||
let defs = &urbandict::get_definitions(&text.to_string())?;
|
||||
let def = &defs[0];
|
||||
let _ = message.channel_id.send_message(&ctx.http, |m| {
|
||||
m.embed(|e| {
|
||||
e.title(format!("Author: {}", def.author)).field(
|
||||
"Definition: ",
|
||||
def.definition.replace(|c| c == '[' || c == ']', ""),
|
||||
false,
|
||||
)
|
||||
})
|
||||
});
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
fn owo(ctx: &mut Context, message: &Message, args: Args) -> CommandResult {
|
||||
let input: String = args.rest().trim().to_string();
|
||||
let _ = message.channel_id.say(&ctx.http, input.owoify());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue