PHP Class Telegram\Bot\BotsManager

Afficher le fichier Open project: irazasyed/telegram-bot-sdk

Protected Properties

Свойство Type Description
$bots Api[] The active bot instances.
$config array The config instance.
$container Illuminate\Contracts\Container\Container The container instance.

Méthodes publiques

Méthode Description
__call ( string $method, array $parameters ) : mixed Magically pass methods to the default bot.
__construct ( array $config ) TelegramManager constructor.
bot ( string $name = null ) : Api Get a bot instance.
disconnect ( string $name = null ) : void Disconnect from the given bot.
getBotConfig ( string | null $name = null ) : array Get the configuration for a bot.
getBots ( ) : Api[] Return all of the created bots.
getConfig ( string $key, mixed $default = null ) : mixed Get the specified configuration value for Telegram.
getDefaultBot ( ) : string Get the default bot name.
reconnect ( string $name = null ) : Api Reconnect to the given bot.
setContainer ( Illuminate\Contracts\Container\Container $container ) Set the IoC Container.
setDefaultBot ( string $name ) Set the default bot name.

Méthodes protégées

Méthode Description
deduplicateArray ( array $array ) : array De-duplicate an array.
makeBot ( string $name ) : Api Make the bot instance.
parseBotCommands ( array $commands ) : array Builds the list of commands for the given commands array.
parseCommands ( array $commands ) : array Parse an array of commands and build a list.

Method Details

__call() public méthode

Magically pass methods to the default bot.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Résultat mixed

__construct() public méthode

TelegramManager constructor.
public __construct ( array $config )
$config array

bot() public méthode

Get a bot instance.
public bot ( string $name = null ) : Api
$name string
Résultat Api

deduplicateArray() protected méthode

De-duplicate an array.
protected deduplicateArray ( array $array ) : array
$array array
Résultat array

disconnect() public méthode

Disconnect from the given bot.
public disconnect ( string $name = null ) : void
$name string
Résultat void

getBotConfig() public méthode

Get the configuration for a bot.
public getBotConfig ( string | null $name = null ) : array
$name string | null
Résultat array

getBots() public méthode

Return all of the created bots.
public getBots ( ) : Api[]
Résultat Api[]

getConfig() public méthode

Get the specified configuration value for Telegram.
public getConfig ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
Résultat mixed

getDefaultBot() public méthode

Get the default bot name.
public getDefaultBot ( ) : string
Résultat string

makeBot() protected méthode

Make the bot instance.
protected makeBot ( string $name ) : Api
$name string
Résultat Api

parseBotCommands() protected méthode

Builds the list of commands for the given commands array.
protected parseBotCommands ( array $commands ) : array
$commands array
Résultat array An array of commands which includes global and bot specific commands.

parseCommands() protected méthode

Parse an array of commands and build a list.
protected parseCommands ( array $commands ) : array
$commands array
Résultat array

reconnect() public méthode

Reconnect to the given bot.
public reconnect ( string $name = null ) : Api
$name string
Résultat Api

setContainer() public méthode

Set the IoC Container.
public setContainer ( Illuminate\Contracts\Container\Container $container )
$container Illuminate\Contracts\Container\Container Container instance

setDefaultBot() public méthode

Set the default bot name.
public setDefaultBot ( string $name )
$name string

Property Details

$bots protected_oe property

The active bot instances.
protected Api[],Telegram\Bot $bots
Résultat Api[]

$config protected_oe property

The config instance.
protected array $config
Résultat array

$container protected_oe property

The container instance.
protected Container,Illuminate\Contracts\Container $container
Résultat Illuminate\Contracts\Container\Container