DEF STUDIO srl

Need help with Laravel and web development?

Hire one of our experts for your projects.

We build tailored products, websites and platforms — with care for UX, performance and maintainability.

Booking open for Q2 — limited slots

Adding a chat to a Telegraph Bot

Associating one or more chats to a bot, it is enabled to send messages to that chat and interacting with commands

Note

To get the chat_id, send /chatid in the chat after setting the webhook for the bot. If you are testing locally, make sure the tunnel URL is still active and matches the URL from php artisan telegraph:debug-webhook {bot_id}. If /chatid does not answer, see Troubleshooting Telegraph onboarding.

through an artisan command

php artisan telegraph:new-chat {bot_id}

the bot_id argument is mandatory if you have created more than one bot

If you are setting up your first bot from installation to the first message, use Build your first Telegram bot with Telegraph.

programmatically

If you are implementing a custom bot creation logic, you can create a new chat from a TelegraphBot model:

use DefStudio\Telegraph\Models\TelegraphBot;

$bot = TelegraphBot::query()->firstOrFail();

$chat = $bot->chats()->create([
    'chat_id' => '123456789',
    'name' => 'Personal chat',
]);
Suggest a change
Last updated 15 June 2026