Hey,
Im currently working on a registrar function, but i have a problem, im unable to fetch user data "on the fly", as of now all users who wants to register
and are "new" to the bot (never spoken to the bot) have to send the tell 2 times. Cause first time the wrong data is stored. (i use preferences to determine if user should become Member or guest)
What i do atm is call user lookup and update upon every tell as i want the
whois table to be up to date every time a user uses the register command.
function command_handler($name, $msg, $type) {
$a = $this -> bot -> core("whois") -> lookup($name, TRUE); //Lets fetch user data every time a user sends a tell. We want user data to be acurate.
if ($this -> bot -> core("whois") -> update($a)) { //Incase we need to add error handling.
//User data fetched.
} else {
//Error fetching user data.
}
return $this -> register_account($name, $msg, $type);
}
Then inside my
register_account function i call the lookup once more to fetch the data i should have just updated in the com handler. Please help
All feedback appreciated