Add aliases

This commit is contained in:
Sakuhl 2018-02-22 13:20:27 +01:00
parent 26403e41a5
commit ea925fac3a

View File

@ -141,7 +141,17 @@ impl Handler {
if !msg.content.starts_with(&prefix) {
return Ok(());
}
let command = &msg.content[prefix.len()..];
let mut command = msg.content[prefix.len()..].to_owned();
if command.starts_with("territories ") {
command = command.replacen("territories", "guild", 1);
}
if command.starts_with("top ") {
command = command.replacen("top", "topguilds", 1);
}
if command.starts_with("leaderboard ") {
command = command.replacen("leaderboard", "topguilds", 1);
}
let command = &command;
if command.starts_with("guild") {
wc_guild(command, msg)?;
@ -180,7 +190,7 @@ impl Handler {
} else if command.starts_with("prefix") {
wc_prefix(command, msg)?;
} else {
let commands = ["topguilds", "prefix", "warfeed", "unwarfeed", "livefeed", "unlivefeed", "status", "crop", "guild", "player", "territory", "info", "help"];
let commands = ["topguilds", "leaderboard", "top", "prefix", "warfeed", "unwarfeed", "livefeed", "unlivefeed", "status", "crop", "guild", "territories", "player", "territory", "info", "help"];
let mut min = usize::max_value();
let mut min_command = "help";
for command_b in &commands {