Sending a message
After a bot and at least one chat have been set up, this package can be used to post new messages:
use DefStudio\Telegraph\Models\TelegraphChat; $chat = TelegraphChat::query() ->where('name', 'Personal chat') ->firstOrFail(); $chat->html('<strong>Hello!</strong>')->send();
as an alternative, messages can be formatted with markdown:
$chat->markdown("*Hello!*\n\nI'm here!")->send();
or markdownV2:
$chat->markdownV2("*Hello!*\n\nI'm here!")->send();
The full flow with installation, webhook, /start handler, and a test is covered in Build your first Telegram bot with Telegraph.