PhpBotFramework  1.0.0
A framework for Telegram Bots' APIs.
Functions
Users handling

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...
 

Detailed Description

Handle bot users on the database.

Function Documentation

§ addUser()

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.

Parameters
$chat_idchat_id of the user to add.
Returns
True on success.

§ broadcastMessage()

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.

See also
CoreBot::sendMessage