The section I posted was just the gmsg section of the AFK module showing it listening for afk without a "!".
Here is the entire module:
<?php
/*
* AFK Module for BE Bot <http://bebot.fieses.net>
* Module coded by Craized <http://www.craized.net>
* v1.01
* Special thanks to Lal for bug fixes, styles, and development
/*
Add a '_' at the beginning of the file (_AFK.php) if you do not want it to be loaded.
*/
$afk = new AFK($bot);
$commands['tell']['afk'] = &$afk;
$commands['privgroup'][] = &$afk;
$commands['gmsg'][$guild_name][] = &$afk;
$commands["buddy"][] = &$afk;
Class AFK {
var $bot;
var $afk;
function AFK(&$bot) {
$this -> bot = &$bot;
$this -> afk = array();
$this -> bot -> db -> query('INSERT IGNORE INTO settings (setting, value) VALUES ("highlight_1", "CB11C9")');
$this -> highlight_1 = !method_exists($this -> bot, get_setting) ? '<font color=#CB11C9>' : '<font color=#'.$this -> bot -> get_setting('highlight_1').'>';
}
function buddy($name, $msg) {
if($msg != 1)
if($this -> afk[$name]) unset($this -> afk[$name]);
}
function tell($name, $msg) {
if(preg_match('/^'.$this -> bot -> commpre.'afk ?(.*)/i', $msg, $afkmsg)) $c = $this -> gone($name, $afkmsg[1]);
if(preg_match('/^'.$this -> bot -> commpre.'afk show$/i', $msg)) $c = $this -> list_afk();
$c != '' ? $this -> bot -> send_gc($c) : NULL;
}
function privgroup($name, $msg) {
if($name != ucfirst($this -> bot -> botname)) {
if(preg_match('/^'.$this -> bot -> commpre.'afk show$/i', $msg)) $c = $this -> list_afk();
elseif(preg_match('/^afk ?(.*)/i', $msg, $afkmsg)) $c = $this -> gone($name, $afkmsg[1]);
elseif(isset($this -> afk[$name])) $c = $this -> back($name);
$c != '' ? $this -> bot -> send_pgroup($c) : NULL;
}
}
function gmsg($name, $group, $msg) {
if($name != ucfirst($this -> bot -> botname)) {
if(preg_match('/^'.$this -> bot -> commpre.'afk show$/i', $msg)) $c = $this -> list_afk();
elseif(preg_match('/^afk ?(.*)/i', $msg, $afkmsg)) $c = $this -> gone($name, $afkmsg[1]);
elseif(isset($this -> afk[$name])) $c = $this -> back($name);
$c != '' ? $this -> bot -> send_gc($c) : NULL;
}
}
function gone($name, $msg) {
$this -> afk[$name] = empty($msg) ? 'Away from keyboard' : $msg;
$c = $this -> highlight_1.$name.'</font> is now AFK.';
return $c;
}
function back($name) {
if(isset($this -> afk[$name])) {
unset($this -> afk[$name]);
$c = $this -> highlight_1.$name.'</font> has returned from away.';
}
return $c;
}
function list_afk() {
$blob = '::::: '.$this -> bot -> guildname.(preg_match("#s$#i", $this -> bot -> guildname) ? '\'' : '\'s').' AFK List :::::';
$blob .= "\n\n\n";
foreach($this -> afk as $key=>$value) {
$blob .= $this -> highlight_1.$key.'</font> is AFK ('.$value.')';
$blob .= "\n\n";
}
$c = $this -> bot -> make_blob('User\'s AFK', $blob);
return $c;
}
}
?>