BeBot - An Anarchy Online and Age Of Conan chat automaton

General => Feedback and Suggestions => Topic started by: Parfet on August 03, 2007, 04:21:58 pm

Title: irc online spam changes
Post by: Parfet on August 03, 2007, 04:21:58 pm
Not sure where to post this, but I had the thought, if one is relaying both org and/or private channel to IRC, why not have both channels' user lists on the !online list? Only displays channels being relayed (I hope)

function irc_online()
Code: [Select]
/*
* Gets called when someone does !online
*/
function irc_online(&$irc, &$data)
{
if ((strtolower($this->bot->settings->get("Irc", "Chat")) == "both") ||
(strtolower($this->bot->settings->get("Irc", "Chat")) == "gc")) {
$online = $this->bot->db->select("SELECT nickname FROM #___online WHERE botname = '".$this->bot->botname
."' AND status_gc = 1 ORDER BY nickname ASC");
if (empty($online)) {
$msg = "Nobody online in guild channel!";
} else {
$msg = count($online)." players in guild channel: ";
foreach ($online as $name) {
$msg .= $name[0].", ";
}
}
$this->irc->message(SMARTIRC_TYPE_CHANNEL, $this->bot->settings->get("Irc", "Channel"), $msg);
}
if ((strtolower($this->bot->settings->get("Irc", "Chat")) == "both") ||
(strtolower($this->bot->settings->get("Irc", "Chat")) == "pgroup")) {
$online = $this->bot->db->select("SELECT nickname FROM #___online WHERE botname = '".$this->bot->botname
."' AND status_pg = 1 ORDER BY nickname ASC");
if (empty($online)) {
$msg = "Nobody online in guest channel!";
} else {
$msg = count($online)." players in guest channel: ";
foreach ($online as $name) {
$msg .= $name[0].", ";
}
}
$this->irc->message(SMARTIRC_TYPE_CHANNEL, $this->bot->settings->get("Irc", "Channel"), $msg);
}
}
SimplePortal 2.3.7 © 2008-2024, SimplePortal