프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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 |
메소드 | 설명 | |
---|---|---|
__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 |
메소드 | 설명 | |
---|---|---|
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 |
메소드 | 설명 | |
---|---|---|
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 |
리턴 |
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 |
리턴 |
public enableAdmin ( integer $admin_id ) : |
||
$admin_id | integer | Single admin id |
리턴 |
public enableAdmins ( array $admin_ids ) : |
||
$admin_ids | array | List of admin ids |
리턴 |
public enableBotan ( $token ) : |
||
$token | ||
리턴 |
public enableExternalMySql ( PD\PDO $external_pdo_connection, string $table_prefix = null ) : |
||
$external_pdo_connection | PD\PDO | PDO database object |
$table_prefix | string | |
리턴 |
public executeCommand ( string $command ) : mixed | ||
$command | string | |
리턴 | mixed |
public getCommandConfig ( string $command ) : array | ||
$command | string | |
리턴 | array |
public getCommandObject ( string $command ) : |
||
$command | string | |
리턴 |
public getCustomInput ( ) : string | ||
리턴 | string |
public getLastCommandResponse ( ) : |
||
리턴 |
public isDbEnabled ( ) : boolean | ||
리턴 | boolean |
public processUpdate ( |
||
$update | ||
리턴 |
protected sanitizeCommand ( string $command ) : string | ||
$command | string | |
리턴 | string |
public setCommandConfig ( string $command, array $config ) : |
||
$command | string | |
$config | array | |
리턴 |
public setCustomInput ( string $input ) : |
||
$input | string | (json format) |
리턴 |
public setDownloadPath ( string $path ) : |
||
$path | string | Custom download path |
리턴 |
public setUploadPath ( string $path ) : |
||
$path | string | Custom upload path |
리턴 |
protected ServerResponse,Longman\TelegramBot\Entities $last_command_response | ||
리턴 |
protected Update,Longman\TelegramBot\Entities $update | ||
리턴 |