Reputation: 21
I am in a hurry of completing a telegram bot project. I am using Telegram bot sdk (https://telegram-bot-sdk.readme.io/) with Laravel. The problem is that I've stored all my users chat_id in database and while I am trying to send a message to all my users(I do consider Telegram limitations mentioned in its official docs) the app will be blocked and none of the users get any message. Here is the simple code $Telegram::sendMessage(['chat_id' => 'CHAT_ID', 'text' => 'Hello World']);
Upvotes: 1
Views: 2799
Reputation: 231
i remember i faced to your problem when i develop the telegram bot , i just use the method in my cladd to send messages and my problem is solved , this is the method based on the library :
use Telegram\Bot\Api;
public function sendMsg($botToken,$chat_id,$text)
{
$telegram = new Api($botToken);
$response = $telegram->sendMessage([
'chat_id' => $chat_id,
'text' => $text,
]);
return $response;
}
Upvotes: 0