PHP Class Phergie_Plugin_UserInfo, phergie

Inheritance: extends Phergie_Plugin_Abstract
Show file Open project: phergie/phergie

Protected Properties

Property Type Description
$store array An array containing all the user information for a given channel

Public Methods

Method Description
getChannels ( string $nick = null ) : array | boolean Returns a list of channels in which a given user is present.
getRandomUser ( string $chan, array $ignore = ['chanserv'] ) : string | boolean Returns the nick of a random user present in a given channel or false if the bot is not present in the channel.
getUsers ( string $chan ) : array | boolean Returns the entire user list for a channel or false if the bot is not in the channel.
is ( integer $mode, string $nick, string $chan ) : boolean Checks whether or not a given user has a mode
isAdmin ( string $nick, string $chan ) : boolean Checks whether or not a given user has admin (&) status
isHalfop ( string $nick, string $chan ) : boolean Checks whether or not a given user has halfop (%) status
isIn ( string $nick, string $chan ) : boolean Checks whether or not a given user is in a channel
isOp ( string $nick, string $chan ) : boolean Checks whether or not a given user has operator (@) status
isOwner ( string $nick, string $chan ) : boolean Checks whether or not a given user has owner (~) status
isVoice ( string $nick, string $chan ) : boolean Checks whether or not a given user has voice (+) status
onJoin ( ) : void Tracks users joining a channel
onMode ( ) : void Tracks mode changes
onNick ( ) : void Tracks users changing nicks
onPart ( ) : void Tracks users leaving a channel
onPrivmsg ( ) : void Debugging function
onQuit ( ) : void Tracks users quitting a server
onResponse ( ) : void Populates the internal user listing for a channel when the bot joins it.

Method Details

getChannels() public method

Returns a list of channels in which a given user is present.
public getChannels ( string $nick = null ) : array | boolean
$nick string Nick of the user (optional, defaults to the bot's nick)
return array | boolean

getRandomUser() public method

To exclude the bot's current nick, for example: $chan = $this->getEvent()->getSource(); $current_nick = $this->getConnection()->getNick(); $random_user = $this->plugins->getPlugin('UserInfo') ->getRandomUser( $chan, array( $current_nick ) );
public getRandomUser ( string $chan, array $ignore = ['chanserv'] ) : string | boolean
$chan string The channel name
$ignore array A list of nicks to ignore in the channel. Useful for excluding the bot itself.
return string | boolean

getUsers() public method

Returns the entire user list for a channel or false if the bot is not in the channel.
public getUsers ( string $chan ) : array | boolean
$chan string The channel name
return array | boolean

is() public method

Checks whether or not a given user has a mode
public is ( integer $mode, string $nick, string $chan ) : boolean
$mode integer A numeric mode (identified by the class constants)
$nick string The nick to check
$chan string The channel to check in
return boolean

isAdmin() public method

Checks whether or not a given user has admin (&) status
public isAdmin ( string $nick, string $chan ) : boolean
$nick string The nick to check
$chan string The channel to check in
return boolean

isHalfop() public method

Checks whether or not a given user has halfop (%) status
public isHalfop ( string $nick, string $chan ) : boolean
$nick string The nick to check
$chan string The channel to check in
return boolean

isIn() public method

Checks whether or not a given user is in a channel
public isIn ( string $nick, string $chan ) : boolean
$nick string The nick to check
$chan string The channel to check in
return boolean

isOp() public method

Checks whether or not a given user has operator (@) status
public isOp ( string $nick, string $chan ) : boolean
$nick string The nick to check
$chan string The channel to check in
return boolean

isOwner() public method

Checks whether or not a given user has owner (~) status
public isOwner ( string $nick, string $chan ) : boolean
$nick string The nick to check
$chan string The channel to check in
return boolean

isVoice() public method

Checks whether or not a given user has voice (+) status
public isVoice ( string $nick, string $chan ) : boolean
$nick string The nick to check
$chan string The channel to check in
return boolean

onJoin() public method

Tracks users joining a channel
public onJoin ( ) : void
return void

onMode() public method

Tracks mode changes
public onMode ( ) : void
return void

onNick() public method

Tracks users changing nicks
public onNick ( ) : void
return void

onPart() public method

Tracks users leaving a channel
public onPart ( ) : void
return void

onPrivmsg() public method

Debugging function
public onPrivmsg ( ) : void
return void

onQuit() public method

Tracks users quitting a server
public onQuit ( ) : void
return void

onResponse() public method

Populates the internal user listing for a channel when the bot joins it.
public onResponse ( ) : void
return void

Property Details

$store protected property

An array containing all the user information for a given channel
protected array $store
return array