\ManiaControl\CommandsCommandManager

Class for handling Chat Commands

Summary

Methods
Properties
Constants
getUsageInformation()
__construct()
getHelpManager()
registerCommandListener()
unregisterCommandListener()
handleChatCallback()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
addListening()
removeCommandListener()
isCommandMessage()
$maniaControl
$helpManager
$commandListenings
$adminCommandListenings
N/A

Properties

$commandListenings

$commandListenings : array<mixed,\ManiaControl\Callbacks\Listening[]>

Type

array<mixed,\ManiaControl\Callbacks\Listening[]>

$adminCommandListenings

$adminCommandListenings : array<mixed,\ManiaControl\Callbacks\Listening[]>

Type

array<mixed,\ManiaControl\Callbacks\Listening[]>

Methods

getUsageInformation()

getUsageInformation() 

Gets Information about the Class, and a List of the Public Method

__construct()

__construct(\ManiaControl\ManiaControl  $maniaControl) 

Construct a new Commands Manager

Parameters

\ManiaControl\ManiaControl $maniaControl

registerCommandListener()

registerCommandListener(string  $commandName, \ManiaControl\Commands\CommandListener  $listener, string  $method, boolean  $adminCommand = false, string  $description = null) : boolean

Register a Command Listener

Parameters

string $commandName
\ManiaControl\Commands\CommandListener $listener
string $method
boolean $adminCommand
string $description

Returns

boolean

unregisterCommandListener()

unregisterCommandListener(\ManiaControl\Commands\CommandListener  $listener) : boolean

Unregister a Command Listener

Parameters

\ManiaControl\Commands\CommandListener $listener

Returns

boolean

handleChatCallback()

handleChatCallback(array  $callback) 

Handle Chat Callback

Parameters

array $callback

addListening()

addListening(array  $listeningsArray, \ManiaControl\Callbacks\Listening  $listening, string  $command) 

Add a Listening to the given Listenings Array

Parameters

array $listeningsArray
\ManiaControl\Callbacks\Listening $listening
string $command

removeCommandListener()

removeCommandListener(array  $listeningsArray, \ManiaControl\Commands\CommandListener  $listener) : boolean

Remove the Command Listener from the given Listenings Array

Parameters

array $listeningsArray
\ManiaControl\Commands\CommandListener $listener

Returns

boolean

isCommandMessage()

isCommandMessage(array  $chatCallback) : boolean

Check if the given Chat Callback is a Command Message

Parameters

array $chatCallback

Returns

boolean