Ever wanted to code a command based on someone rank in org?
This will return someones lowest numeric rank value (0 for president, 1 general/advisor, etc etc...) for any alt of $name
You will have to modify the query ($qry) to fit your whoiscache info!
function highest_rank($name) {
$main = $this->main($name);
$alts = $this->get_alts($main);
$alts[] = $main;
$ret = 99;
foreach ($alts as $alt) {
$qry = "select org_rank_id, org_name from whois where name='$alt'";
$whois = $this -> bot -> db -> select($qry);
if ($whois[0][1] == $this->bot->guildname && $whois[0][0] < $ret)
$ret = $whois[0][0];
}
return $ret;
}