PHP Класс Telegram\Bot\BotsManager

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$bots Api[] The active bot instances.
$config array The config instance.
$container Illuminate\Contracts\Container\Container The container instance.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__call() публичный Метод

Magically pass methods to the default bot.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Результат mixed

__construct() публичный Метод

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

bot() публичный Метод

Get a bot instance.
public bot ( string $name = null ) : Api
$name string
Результат Api

deduplicateArray() защищенный Метод

De-duplicate an array.
protected deduplicateArray ( array $array ) : array
$array array
Результат array

disconnect() публичный Метод

Disconnect from the given bot.
public disconnect ( string $name = null ) : void
$name string
Результат void

getBotConfig() публичный Метод

Get the configuration for a bot.
public getBotConfig ( string | null $name = null ) : array
$name string | null
Результат array

getBots() публичный Метод

Return all of the created bots.
public getBots ( ) : Api[]
Результат Api[]

getConfig() публичный Метод

Get the specified configuration value for Telegram.
public getConfig ( string $key, mixed $default = null ) : mixed
$key string
$default mixed
Результат mixed

getDefaultBot() публичный Метод

Get the default bot name.
public getDefaultBot ( ) : string
Результат string

makeBot() защищенный Метод

Make the bot instance.
protected makeBot ( string $name ) : Api
$name string
Результат Api

parseBotCommands() защищенный Метод

Builds the list of commands for the given commands array.
protected parseBotCommands ( array $commands ) : array
$commands array
Результат array An array of commands which includes global and bot specific commands.

parseCommands() защищенный Метод

Parse an array of commands and build a list.
protected parseCommands ( array $commands ) : array
$commands array
Результат array

reconnect() публичный Метод

Reconnect to the given bot.
public reconnect ( string $name = null ) : Api
$name string
Результат Api

setContainer() публичный Метод

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

setDefaultBot() публичный Метод

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

Описание свойств

$bots защищенное свойство

The active bot instances.
protected Api[],Telegram\Bot $bots
Результат Api[]

$config защищенное свойство

The config instance.
protected array $config
Результат array

$container защищенное свойство

The container instance.
protected Container,Illuminate\Contracts\Container $container
Результат Illuminate\Contracts\Container\Container