Git Product home page Git Product logo

file-to-link's Introduction

Telegram Bot: File to Link

Introduction

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.

Requirements

  • PHP >= 8.2
  • Laravel >= 11.9
  • MySQL
  • Composer
  • Telegram Bot Token

Installation

  1. Clone the repository:

    git clone https://github.com/1970Mr/file-to-link.git
    cd file-to-link
  2. Install dependencies:

    composer install
  3. Set up environment variables:

    Copy the .env.example to .env and fill in the necessary details, especially the TELEGRAM_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
  4. Generate application key:

    php artisan key:generate
  5. Run database migrations:

    php artisan migrate

Setting up the Webhook

You need to set up a webhook for your Telegram bot to receive updates. There are two methods to set the webhook.

Method 1: Using the Route

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.".

Method 2: Using an Artisan Command

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.

Contributing

Feel free to submit issues or pull requests if you find any bugs or have suggestions for improvements.

License

This project is open-source and available under the MIT License.

file-to-link's People

Contributors

1970mr avatar

Watchers

 avatar

Forkers

n-sudy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.