This repository contains a simple Telegram bot implemented in PHP using the Laravel framework. The bot is designed to handle file uploads and provide downloadable links. Below, you'll find instructions for setting up and running the bot.
- PHP >= 8.2
- Laravel >= 11.9
- MySQL
- Composer
- Telegram Bot Token
-
Clone the repository:
git clone https://github.com/1970Mr/file-to-link.git cd file-to-link
-
Install dependencies:
composer install
-
Set up environment variables:
Copy the
.env.example
to.env
and fill in the necessary details, especially theTELEGRAM_BOT_TOKEN
:cp .env.example .env
Edit the
.env
file to include your Telegram bot token and other configurations:TELEGRAM_BOT_TOKEN=your-telegram-bot-token APP_URL=https://your-app-url.com
-
Generate application key:
php artisan key:generate
-
Run database migrations:
php artisan migrate
You need to set up a webhook for your Telegram bot to receive updates. There are two methods to set the webhook.
Set the webhook using the route:
php artisan serve
Open your browser and navigate to:
http://localhost:8000/set-webhook/{your-telegram-bot-token}
If everything is set up correctly, you should see a message: "Webhook is set successfully.".
Set the webhook using an artisan command:
php artisan telegram:set-webhook
Your bot should now be up and running, ready to handle file uploads and provide downloadable links.
Feel free to submit issues or pull requests if you find any bugs or have suggestions for improvements.
This project is open-source and available under the MIT License.