![]() |
PhpBotFramework
1.0.0
A framework for Telegram Bots' APIs.
|
Handle bot users on the database. More...
Functions | |
| DanySpin97\PhpBotFramework\Bot::addUser ($chat_id) | |
| Add a user to the database. More... | |
| DanySpin97\PhpBotFramework\Bot::broadcastMessage ($text, string $reply_markup=null, string $parse_mode='HTML', bool $disable_web_preview=true, bool $disable_notification=false) | |
| Broadcast a message to all user registred on the database. More... | |
Handle bot users on the database.
| DanySpin97\PhpBotFramework\Bot::addUser | ( | $chat_id | ) |
Add a user to the database.
Add a user to the database in Bot::$user_table table and Bot::$id_column column using Bot::$pdo connection.
| $chat_id | chat_id of the user to add. |
| DanySpin97\PhpBotFramework\Bot::broadcastMessage | ( | $text, | |
| string | $reply_markup = null, |
||
| string | $parse_mode = 'HTML', |
||
| bool | $disable_web_preview = true, |
||
| bool | $disable_notification = false |
||
| ) |
Broadcast a message to all user registred on the database.
Send a message to all users subscribed, change Bot::$user_table and Bot::$id_column to match your database structure is. This method requires Bot::$pdo connection set. All parameters are the same as CoreBot::sendMessage. Because a limitation of Telegram Bot API the bot will have a delay after 20 messages sent in different chats.
1.8.12