Fix and add aliases

This commit is contained in:
Sakuhl 2018-02-22 15:45:00 +01:00
parent ea925fac3a
commit c7d2160f23

View File

@ -145,12 +145,15 @@ impl Handler {
if command.starts_with("territories ") {
command = command.replacen("territories", "guild", 1);
}
if command.starts_with("top ") {
if command.starts_with("top ") || command == "top" {
command = command.replacen("top", "topguilds", 1);
}
if command.starts_with("leaderboard ") {
command = command.replacen("leaderboard", "topguilds", 1);
}
if command.starts_with("stats ") {
command = command.replacen("stats", "guild", 1);
}
let command = &command;
if command.starts_with("guild") {
@ -190,7 +193,7 @@ impl Handler {
} else if command.starts_with("prefix") {
wc_prefix(command, msg)?;
} else {
let commands = ["topguilds", "leaderboard", "top", "prefix", "warfeed", "unwarfeed", "livefeed", "unlivefeed", "status", "crop", "guild", "territories", "player", "territory", "info", "help"];
let commands = ["topguilds", "leaderboard", "top", "prefix", "warfeed", "unwarfeed", "livefeed", "unlivefeed", "status", "crop", "guild", "stats", "territories", "player", "territory", "info", "help"];
let mut min = usize::max_value();
let mut min_command = "help";
for command_b in &commands {