PHPackages                             otajonov/televel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. otajonov/televel

ActiveLibrary[API Development](/categories/api)

otajonov/televel
================

A highly customizable Laravel library for managing Telegram bots

1.1(2y ago)0111MITPHPPHP ^8.2

Since Jun 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Otajonov/televel)[ Packagist](https://packagist.org/packages/otajonov/televel)[ Docs](https://github.com/Otajonov/televel)[ RSS](/packages/otajonov-televel/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Televel Package for Laravel

Televel Package for Laravel
===========================

[](#televel-package-for-laravel)

Introduction
------------

[](#introduction)

Televel is a Laravel package designed to simplify the setup and management of Telegram bots within your Laravel application. It provides commands to set up, manage, and interact with Telegram bots via webhooks.

Installation
------------

[](#installation)

To install Televel, follow these steps:

1. Install the package via Composer:

    composer require otajonov/televel
2. Publish the package configuration and Provider files:

    php artisan vendor:publish --provider="Televel\\TelevelServiceProvider" --tag="config"

This will publish the configuration file to `config/televel.php`, where you can configure your Telegram bots.

3. Make sure your APP\_URL in `.env` file is set correct, and is `https`.
4. Run `php artisan televel:setup` and provide your Bot Token
5. Congrats. Your Bot should be already running. /start it and happy coding!

Commands
--------

[](#commands)

### Setup Command

[](#setup-command)

The setup command (`televel:setup`) or (`televel:setup botname`) allows you to configure a new Telegram bot within your Laravel application. It prompts for the bot name and token and sets up the necessary webhook URL for Telegram updates.

Example usage:

```
php artisan televel:setup

```

### List Command

[](#list-command)

The list command (`televel:list`) lists all configured Telegram bots along with their tokens and webhook URLs.

Example usage:

```
php artisan televel:list

```

### Remove Command

[](#remove-command)

The remove command (`televel:remove`) removes a configured Telegram bot from your Laravel application. It deletes the webhook, removes configuration entries, and deletes associated files.

Example usage:

```
php artisan televel:remove

```

### Reset Command

[](#reset-command)

The reset command (`televel:reset`) resets the webhook URL for a configured Telegram bot. It deletes the existing webhook, sets a new one with a new token, and updates the configuration.

Example usage:

```
php artisan televel:reset

```

Usage
-----

[](#usage)

### Controller

[](#controller)

Once set up, incoming updates from Telegram are handled by the webhook method in your newly generated YourBotController.php file in `app/Http/Controllers` folder.

Extending Televel class
-----------------------

[](#extending-televel-class)

You can further customize your Telegram bot by extending the Televel class and adding additional methods for handling specific bot functionalities.

```
