PhpBotFramework
2.0.2
A framework for Telegram Bots' APIs.
|
Properties and methods to handle your Telegrams bot. More...
Functions | |
PhpBotFramework\BasicBot::processWebhookUpdate () | |
Get update and process it. More... | |
PhpBotFramework\BasicBot::getUpdatesLocal (int $limit=100, int $timeout=60) | |
Get updates received by the bot, and hold the offset in $offset. More... | |
PhpBotFramework\Bot::__construct (string $token) | |
Construct an empty bot. More... | |
int | PhpBotFramework\Core\CoreBot::getChatID () |
Get chat ID of the current user. More... | |
PhpBotFramework\Core\CoreBot::setChatID ($chat_id) | |
Set current chat ID. More... | |
int | PhpBotFramework\Core\CoreBot::getBotID () |
Get bot ID using getMe method. More... | |
Variables | |
PhpBotFramework\Bot::$keyboard | |
Store the inline keyboard. | |
PhpBotFramework\Bot::$database | |
Database handler object. | |
PhpBotFramework\Bot::$redis | |
Redis connection. | |
PhpBotFramework\Bot::$local | |
Localization handler object. | |
PhpBotFramework\Bot::$status | |
Status handler object. | |
Properties and methods to handle your Telegrams bot.
Here're listed all the properties and methods that offers facilities for bot's basic features.
PhpBotFramework\Bot::__construct | ( | string | $token | ) |
Construct an empty bot.
Construct a complete Telegram bot which can use localization, database and more other.
string | $token | Bot token, you can request one through BotFather on Telegram. |
int PhpBotFramework\Core\CoreBot::getBotID | ( | ) |
Get bot ID using getMe
method.
int PhpBotFramework\Core\CoreBot::getChatID | ( | ) |
Get chat ID of the current user.
PhpBotFramework\BasicBot::getUpdatesLocal | ( | int | $limit = 100 , |
int | $timeout = 60 |
||
) |
Get updates received by the bot, and hold the offset in $offset.
Get the update_id
of the first update to parse, set it in $offset and then it start an infinite loop where it processes updates and keep $offset on the update_id of the last update received. Each processUpdate() method call is surrounded by a try/catch.
int | $limit | Optional. Limits the number of updates to be retrieved. Values between 1—100 are accepted. |
int | $timeout | Optional. Timeout in seconds for long polling. |
PhpBotFramework\BasicBot::processWebhookUpdate | ( | ) |
Get update and process it.
Call this method if user is using webhook. It'll get bot's update from php::, check it and then process it using processUpdate.
PhpBotFramework\Core\CoreBot::setChatID | ( | $chat_id | ) |
Set current chat ID.
Change the chat ID on which the bot acts.
$chat_id | The new chat ID to set. |