- PHP >=8.0
- Telegram Bot Token - Talk to @BotFather and generate one.
- Laravel >=9 (Optional)
Obtaining Telegram Bot Token
- Open the Telegram app and message @BotFather.
- Follow the instructions to create a new bot.
- After creating the bot, the "BotFather" bot will give you a bot token. Keep this token safe, as you will need it to use the Telegram Bot API.
Your bot token is its unique identifier – store it in a secure place, and avoid sharing with anyone or publishing your bot token anywhere. Everyone who has your token will have full control over your bot.
Telegram Bot SDK utilizes Composer to manage its dependencies. So, before using the SDK, make sure you have Composer installed on your machine.
Install the Telegram Bot SDK using Composer:
composer require irazasyed/telegram-bot-sdk:^3.10
Telegram Bot SDK will self-register its service provider and facade in Laravel.
Publish Configuration File
Publish the configuration file by running this command in your terminal window:
php artisan vendor:publish --tag="telegram-config"