Add help command

This commit is contained in:
Sakuhl 2018-01-24 13:56:04 +01:00
parent 57bfb7d997
commit 3e0b740498
2 changed files with 15 additions and 2 deletions

View File

@ -81,6 +81,17 @@ Servers: {}", env!("CARGO_PKG_VERSION"), guilds))?;
Ok(())
}
pub fn wc_help(msg: &Message) -> Result<(), Error> {
msg.channel_id.say("Command overview: (prefix is wc!)
- Get information: guild <name/prefix>, player <name>, territory <(partial) name>, topguilds <limit>
- Toggle territory or war logs: livefeed, unlivefeed, warfeed, unwarfeed
- Crop screenshots: crop (crops last posted picture), crop <url>
- Misc.: info, status
Visit the Discord for more help: https://discord.gg/GbN7HeG")?;
Ok(())
}
pub fn wc_crop(command: &str, msg: &Message) -> Result<(), Error> {
let url = &command[5..];
let new_url = reqwest::get(&format!("https://wynncraft-autocrop.herokuapp.com/crop?url={}", url))?.text().unwrap();
@ -117,7 +128,7 @@ pub fn wc_shout(command: &str, msg: &Message) -> Result<(), Error> {
let mut bots = vec![];
let mut general = vec![];
let mut others = vec![];
for (channel_id, channel) in Guild::get(&guild_id).unwrap().channels().unwrap() {
for (_channel_id, channel) in Guild::get(&guild_id).unwrap().channels().unwrap() {
if channel.kind != ChannelType::Text {
continue;
}

View File

@ -101,8 +101,10 @@ impl Handler {
wc_livefeed(msg)?;
} else if command == "unlivefeed" {
wc_unlivefeed(msg)?;
} else if command == "info" || command == "help" || command == "" {
} else if command == "info" || command == "" {
wc_info(msg)?;
} else if command == "help" {
wc_help(msg)?;
} else if command.starts_with("crop ") {
wc_crop(command, msg)?;
} else if command == "crop" {