Add aliases
This commit is contained in:
parent
26403e41a5
commit
ea925fac3a
14
src/main.rs
14
src/main.rs
@ -141,7 +141,17 @@ impl Handler {
|
|||||||
if !msg.content.starts_with(&prefix) {
|
if !msg.content.starts_with(&prefix) {
|
||||||
return Ok(());
|
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") {
|
if command.starts_with("guild") {
|
||||||
wc_guild(command, msg)?;
|
wc_guild(command, msg)?;
|
||||||
@ -180,7 +190,7 @@ impl Handler {
|
|||||||
} else if command.starts_with("prefix") {
|
} else if command.starts_with("prefix") {
|
||||||
wc_prefix(command, msg)?;
|
wc_prefix(command, msg)?;
|
||||||
} else {
|
} 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 = usize::max_value();
|
||||||
let mut min_command = "help";
|
let mut min_command = "help";
|
||||||
for command_b in &commands {
|
for command_b in &commands {
|
||||||
|
Loading…
Reference in New Issue
Block a user