Property | Type | Description | |
---|---|---|---|
$admins_list | array | Admins list | |
$api_key | string | Telegram API key | |
$bot_name | string | Telegram Bot name | |
$botan_enabled | boolean | Botan.io integration | |
$commands_config | array | Commands config | |
$commands_paths | array | Custom commands paths | |
$download_path | string | Download path | |
$input | string | Raw request data (json) for webhook methods | |
$last_command_response | ServerResponse of the last Command execution | ||
$mysql_enabled | boolean | MySQL integration | |
$pdo | PDO | PDO object | |
$update | Current Update object | ||
$upload_path | string | Upload path | |
$version | string | Version |
Method | Description | |
---|---|---|
__construct ( string $api_key, string $bot_name ) | Telegram constructor. | |
addCommandsPath ( string $path, boolean $before = true ) : |
Add a single custom commands path | |
addCommandsPaths ( array $paths, boolean $before = true ) : |
Add multiple custom commands paths | |
enableAdmin ( integer $admin_id ) : |
Enable a single Admin account | |
enableAdmins ( array $admin_ids ) : |
Enable a list of Admin Accounts | |
enableBotan ( $token ) : |
Enable Botan.io integration | |
enableExternalMySql ( PD\PDO $external_pdo_connection, string $table_prefix = null ) : |
Initialize Database external connection | |
enableMySql ( array $credential, string $table_prefix = null, string $encoding = 'utf8mb4' ) : |
Initialize Database connection | |
executeCommand ( string $command ) : mixed | Execute /command | |
getAdminList ( ) : array | Get list of admins | |
getApiKey ( ) : string | Get API key | |
getBotName ( ) : string | Get Bot name | |
getCommandConfig ( string $command ) : array | Get command config | |
getCommandObject ( string $command ) : |
Get an object instance of the passed command | |
getCommandsList ( ) : array | Get commands list | |
getCustomInput ( ) : string | Get custom input string for debug purposes | |
getDownloadPath ( ) : string | Get custom download path | |
getLastCommandResponse ( ) : |
Get the ServerResponse of the last Command execution | |
getUploadPath ( ) : string | Get custom upload path | |
getVersion ( ) : string | Get Version | |
handle ( ) : boolean | Handle bot request from webhook | |
handleGetUpdates ( integer | null $limit = null, integer | null $timeout = null ) : |
Handle getUpdates method | |
isAdmin ( integer | null $user_id = null ) : boolean | Check if the passed user is an admin | |
isDbEnabled ( ) : boolean | Check if user required the db connection | |
processUpdate ( |
Process bot Update request | |
setCommandConfig ( string $command, array $config ) : |
Set command config | |
setCustomInput ( string $input ) : |
Set custom input string for debug purposes | |
setDownloadPath ( string $path ) : |
Set custom download path | |
setUploadPath ( string $path ) : |
Set custom upload path | |
setWebHook ( string $url, string | null $path_certificate = null ) : |
Set Webhook for bot | |
unsetWebHook ( ) : mixed | Unset Webhook for bot |
Method | Description | |
---|---|---|
sanitizeCommand ( string $command ) : string | Sanitize Command | |
ucfirstUnicode ( string $str, string $encoding = 'UTF-8' ) : string | Replace function ucfirst for UTF-8 characters in the class definition and commands | |
ucwordsUnicode ( string $str, string $encoding = 'UTF-8' ) : string | Replace function ucwords for UTF-8 characters in the class definition and commands |
Method | Description | |
---|---|---|
getCommandFromType ( string $type ) : string | Get the command name from the command type |
public __construct ( string $api_key, string $bot_name ) | ||
$api_key | string | |
$bot_name | string |
public addCommandsPath ( string $path, boolean $before = true ) : |
||
$path | string | Custom commands path to add |
$before | boolean | If the path should be prepended or appended to the list |
return |
public addCommandsPaths ( array $paths, boolean $before = true ) : |
||
$paths | array | Custom commands paths to add |
$before | boolean | If the paths should be prepended or appended to the list |
return |
public enableAdmin ( integer $admin_id ) : |
||
$admin_id | integer | Single admin id |
return |
public enableAdmins ( array $admin_ids ) : |
||
$admin_ids | array | List of admin ids |
return |
public enableBotan ( $token ) : |
||
$token | ||
return |
public enableExternalMySql ( PD\PDO $external_pdo_connection, string $table_prefix = null ) : |
||
$external_pdo_connection | PD\PDO | PDO database object |
$table_prefix | string | |
return |
public executeCommand ( string $command ) : mixed | ||
$command | string | |
return | mixed |
public getCommandConfig ( string $command ) : array | ||
$command | string | |
return | array |
public getCommandObject ( string $command ) : |
||
$command | string | |
return |
public getCommandsList ( ) : array | ||
return | array | $commands |
public getCustomInput ( ) : string | ||
return | string |
public getDownloadPath ( ) : string | ||
return | string |
public getLastCommandResponse ( ) : |
||
return |
public getUploadPath ( ) : string | ||
return | string |
public isDbEnabled ( ) : boolean | ||
return | boolean |
public processUpdate ( |
||
$update | ||
return |
protected sanitizeCommand ( string $command ) : string | ||
$command | string | |
return | string |
public setCommandConfig ( string $command, array $config ) : |
||
$command | string | |
$config | array | |
return |
public setCustomInput ( string $input ) : |
||
$input | string | (json format) |
return |
public setDownloadPath ( string $path ) : |
||
$path | string | Custom download path |
return |
public setUploadPath ( string $path ) : |
||
$path | string | Custom upload path |
return |
protected array $commands_paths | ||
return | array |
protected string $input | ||
return | string |
protected ServerResponse,Longman\TelegramBot\Entities $last_command_response | ||
return |
protected Update,Longman\TelegramBot\Entities $update | ||
return |