PHPackages                             rasa/telekit - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. rasa/telekit

ActiveProject[Utility &amp; Helpers](/categories/utility)

rasa/telekit
============

Library for creating telegram bots

v2.7.0(2y ago)16MITPHPPHP ^8.0

Since Mar 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/rasa04/telekit)[ Packagist](https://packagist.org/packages/rasa/telekit)[ Docs](https://matesite.uz)[ GitHub Sponsors](https://github.com/[user1)[ GitHub Sponsors]()[ RSS](/packages/rasa-telekit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (20)Used By (0)

Telekit framework
=================

[](#telekit-framework)

[![Latest Stable Version](https://camo.githubusercontent.com/3c2d1c9f993f143d9046d86eb18590bb5d2577e9b537a22e9e2b0a3e9ca41686/687474703a2f2f706f7365722e707567782e6f72672f726173612f74656c656b69742f76)](https://packagist.org/packages/rasa/telekit)[![Total Downloads](https://camo.githubusercontent.com/0c0d2acd2c6f0c78eb9007c538e2dc33573596c555f4d67f61bfac614039bba9/687474703a2f2f706f7365722e707567782e6f72672f726173612f74656c656b69742f646f776e6c6f616473)](https://packagist.org/packages/rasa/telekit)[![Latest Unstable Version](https://camo.githubusercontent.com/5fa05aae4e9cb1b66f2dedde1677e6ab93fb92f1707dbf1f514a16e6932f7069/687474703a2f2f706f7365722e707567782e6f72672f726173612f74656c656b69742f762f756e737461626c65)](https://packagist.org/packages/rasa/telekit)[![License](https://camo.githubusercontent.com/7da1e5c4de0a70972576af54b1f2ba43c3521213e32194dd4317fdfb551a4f44/687474703a2f2f706f7365722e707567782e6f72672f726173612f74656c656b69742f6c6963656e7365)](https://packagist.org/packages/rasa/telekit)[![PHP Version Require](https://camo.githubusercontent.com/462945798281822a2f3642cb6b0c007c408b47f7bb17d957e29187485c44e4b9/687474703a2f2f706f7365722e707567782e6f72672f726173612f74656c656b69742f726571756972652f706870)](https://packagist.org/packages/rasa/telekit)

About Telekit
=============

[](#about-telekit)

Telekit is a powerful toolkit for building Telegram bots with ease, using Laravel Eloquent ORM. With Telekit, developers can quickly build and deploy bots, saving time and effort.

One of the standout features of Telekit is its support for Laravel Eloquent ORM, which allows developers to easily interact with the database and perform complex operations with just a few lines of code. This makes it simple to manage data within your Telegram bot and keep your code organized and maintainable.

Telekit also provides a range of tools and utilities for working with the Telegram API, making it easy to handle incoming messages, send messages to users, and perform other common bot tasks. Developers can take advantage of Telekit's intuitive API to quickly build and test new bot features, without having to worry about the underlying details of the Telegram protocol.

Requirements
============

[](#requirements)

- PHP version 8.0
- Postgres, Mysql, Sqlite database
- Running migrations (chats table)

To install Telekit library using Composer, you can follow these steps:
======================================================================

[](#to-install-telekit-library-using-composer-you-can-follow-these-steps)

Open a terminal or command prompt and navigate to your project directory.

Run the following command:

```
composer require rasa/telekit

```

This will download and install the Telekit library and all its dependencies into your project's vendor directory.

Once the installation is complete, you can start using Telekit by including its autoload file in your code

- **[my website](https://rasa.uz)**
- **Receive updates in the browser** [https://api.telegram.org/bot{TOKEN}/getUpdates](https://api.telegram.org/bot%7BTOKEN%7D/getUpdates)
- **Set up a webhook** [https://api.telegram.org/bot{TOKEN}/setwebhook?url=https://test.com/example\_bot/index.php](https://api.telegram.org/bot%7BTOKEN%7D/setwebhook?url=https://test.com/example_bot/index.php)
- **Delete a webhook** [https://api.telegram.org/bot{TOKEN}/deleteWebhook](https://api.telegram.org/bot%7BTOKEN%7D/deleteWebhook)

"artisan" commands
==================

[](#artisan-commands)

With the command *"php artisan"*, you can interact with the bot. Here are some examples:
----------------------------------------------------------------------------------------

[](#with-the-command-php-artisan-you-can-interact-with-the-bot-here-are-some-examples)

Polling
-------

[](#polling)

### Process requests on your local computer without using hooks using the polling method

[](#process-requests-on-your-local-computer-without-using-hooks-using-the-polling-method)

```
php artisan serve

```

To see all available commands
=============================

[](#to-see-all-available-commands)

```
php artisan

```

Sending messages
----------------

[](#sending-messages)

### Sends to all users

[](#sends-to-all-users)

```
php artisan send all

```

### Specify the chat id

[](#specify-the-chat-id)

```
php artisan send --to=CHAT_ID
php artisan send -t CHAT_ID

```

### Specify message

[](#specify-message)

```
php artisan send --to=CHAT_ID --message="hello world"
php artisan send -t CHAT_ID -m "hello world"

```

"make" command
--------------

[](#make-command)

### Creating template Interaction files

[](#creating-template-interaction-files)

```
php artisan make:interaction MyInteraction

```

### Creating template Trigger files

[](#creating-template-trigger-files)

```
php artisan make:trigger myTrigger

```

### Creating template Migration files

[](#creating-template-migration-files)

```
php artisan make:migration table

```

### Creating template Model files

[](#creating-template-model-files)

```
php artisan make:model User

```

"database" command
------------------

[](#database-command)

### Get database

[](#get-database)

```
php artisan database

```

### Parameters

[](#parameters)

```
php artisan database:params

```

### Check database version

[](#check-database-version)

```
php artisan database:version

```

### Show tables

[](#show-tables)

```
php artisan database:tables

```

### Output table contents

[](#output-table-contents)

```
php artisan database:table chats

```

### Describe table

[](#describe-table)

```
php artisan database:table chats --desc

```

### Output the contents of a specific table field

[](#output-the-contents-of-a-specific-table-field)

```
php artisan database:showTable chats --columns="chat_id"
php artisan database:showTable chats --columns="chat_id" --columns="username" --columns="attempts"

```

### run migrations

[](#run-migrations)

```
php artisan migrate

```

### undo all migration

[](#undo-all-migration)

```
php artisan migrate --fresh

```

See responses
-------------

[](#see-responses)

```
php artisan responses

```

Send responses
==============

[](#send-responses)

reply message
-------------

[](#reply-message)

```
class Hi extends Trigger {
    public function __construct($request)
    {
        $this->reply_message('Hi');
    }
}

```

Send message
------------

[](#send-message)

```
