PHPackages                             sanf/rubot - 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. [Framework](/categories/framework)
4. /
5. sanf/rubot

ActiveLibrary[Framework](/categories/framework)

sanf/rubot
==========

Rubot is a PHP framework for building Rubika bots efficiently and reliably, with full support for messaging, media, and user interactions.Rubot - Rubika Bot API SDK in PHP

v2.1.0(8mo ago)750↓100%1MITPHPPHP &gt;=8.1CI passing

Since Aug 8Pushed 5mo agoCompare

[ Source](https://github.com/sanf-dev/Rubot)[ Packagist](https://packagist.org/packages/sanf/rubot)[ Docs](https://doc.artusha.ir)[ RSS](/packages/sanf-rubot/feed)WikiDiscussions main Synced 1mo ago

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

 [ ![logo - Rubot](https://camo.githubusercontent.com/14d20094efde623c173d04aa1f11572d5443bb92844fae996eabb2603c08e36c/68747470733a2f2f75706c6f61646b6f6e2e69722f75706c6f6164732f3830623233305f32357275626f742d6c6f676f2e706e67) ](https://github.com/sanf-dev/Rubot)Rubot
=====

[](#rubot)

### PHP framework for building Rubika bots efficiently and intelligently.

[](#php-framework-for-building-rubika-bots-efficiently-and-intelligently)

[![PHP Framework](https://camo.githubusercontent.com/f56bfcd492f32af66a390f23ac1c3b3eab607fd22816dad6759cdd0e5b801363/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502532306672616d65776f726b2d384132424532)](https://github.com/sanf-dev)[![PHP Version](https://camo.githubusercontent.com/73b05aa439bd2a56cb084f88722438ae1254490cbdcff03eec922ebfd105fcab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d382e312d383839324246)](https://www.php.net/)[![Packagist](https://camo.githubusercontent.com/3d954b13b799c3d9d9b5c58174cd3789a32b4be6025d4202b568e7bb4ed2a276/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5061636b61676973742d73616e662f7275626f742d323132313231)](https://packagist.org/packages/sanf/rubot)

Rubot
=====

[](#rubot-1)

**Rubot** is a **PHP framework** for building **Rubika bots**. It uses the official **Rubika APIs** to create bots efficiently and reliably. Rubot is optimized for performance and ease of use, offering all supported methods for messaging, media, and user interactions.

Whether you need a simple chatbot or a more advanced assistant, Rubot makes development faster, smarter, and more maintainable.

> V 2.1.0 PHP 8.1+

### What's New?

[](#whats-new)

> Update v2.1.0

> **Overall changes**

- Optimization of core classes
- Using Guzzle for sending requests, downloading, and uploading
- Updated filters in the Message class
- Optimized upload and download
- Added support for receiving updates via long polling
- Added button links for joining channels and opening URLs
- Simplified retrieval and usage of file IDs
- Added new filters
- Added progress tracking for downloads and uploads
- Added the Rubino class

> **Minor changes**

- Added ENV file support
- Added retry count for failed requests
- Added timeout setting
- Added debugger
- Added automatic token retrieval from ENV

Initial Setup
=============

[](#initial-setup)

1. Get your token from the [@BotFather](https://rubika.ir/botfather) bot.
2. Install the Library Download the library using one of the following methods:

Using Composer

```
composer require sanf/rubot
# Or Install the Beta Version
composer require sanf/rubot:dev-main
```

Clone from GitHub

```
git clone https://github.com/sanf-dev/rubot
composer dump-autoload
```

3. Create a File and Run a Simple Bot

```
require "vendor/autoload.php";

use Rubot\Bot;
use Rubot\Tools\Message;

$bot = new Bot("YOUR_BOT_TOKEN");

$run = function (Message $update) use ($bot) {
    $update->reply("Hello, user");
};

$bot->onMessage($run); // run webhook
```

4. Set a Webhook for Your Bot

```
$bot->setWebHook("WEBHOOK_URL");
```

5. Congratulations 🎉 You have successfully set up your bot!

(Bot) Methods
=============

[](#bot-methods)

Sending Message
---------------

[](#sending-message)

Simple example of sending a message with the Bot class

```
$bot->sendMessage(
    "CHAT_ID",
    "TEXT",
    "REPLY_MESSAGE_ID",
    "DISABLE_NOTIFICATION",
    ["OTHER_METHOD"]
);
```

- `CHAT_ID` – `string` → The target chat ID.
- `TEXT` – `string` → The text message you want to send.
- `REPLY_MESSAGE_ID` – `string` → The message ID to reply to (optional).
- `DISABLE_NOTIFICATION` – `bool` → Additional options:
- `OTHER_METHOD` – `array` → Additional options:
    - `inline_keypad`: `array`
    - `chat_keypad`: `array`
    - `chat_keypad_type`: `string`

Other methods
-------------

[](#other-methods)

Get familiar with the different methods

### Sending Messages

[](#sending-messages)

- `sendFile` : `Send a file to a chat`
- `sendPoll` : `Send a poll to the chat`
- `sendLocation` : `Send a temporary location `
- `sendContact` : `Send a contact (phone number & name)`
- `forwardMessage` : `Forward a message from one chat to another `

### Editing &amp; Deleting

[](#editing--deleting)

- `editMessage` : `Edit the content of a previously sent message`
- `deleteMessage` : `Delete a message from a chat`
- `editChatKeypad` : `Edit an existing chat keyboard`

### File Handling

[](#file-handling)

- `getFile` : `Get file information using its file ID`
- `sendFile` : `Upload a media file to Rubika servers`
- `download` : `Download a file from its file ID to a specified path`

### Chat &amp; Bot Info

[](#chat--bot-info)

- `getMe` : `Get bot account details`
- `getChat` : `Get chat information (user, group, or channel)`
- `getUpdates` : `Receive incoming updates (polling method)`
- `setCommands` : `Set bot commands  `

### Webhook &amp; Security

[](#webhook--security)

- `setSecretKey` : `Set a security key to protect webhook access `
- `checkSecretKey` : `Check if the incoming webhook request contains the correct key`
- `setWebHook` : `Automatically set webhook to a given URL`
- `onMessage` : `Handle incoming messages from the webhook with a callback function`
- `onUpdate` : `Receive updates using long polling`

(Message) Methods
-----------------

[](#message-methods)

- `text` : `get Message`
- `chat_id` : `get Chat Id`
- `message_id` : `get Message Id`

License
-------

[](#license)

MIT © [Sanf-Dev](https://github.com/sanf-dev/)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance65

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Total

2

Last Release

252d ago

Major Versions

v1.0.0 → v2.1.02025-08-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d9f455ad11c177c1b91822c1ea57abf73ccbb116629db259bbc44b556350d8c?d=identicon)[Sanf](/maintainers/Sanf)

---

Top Contributors

[![sanf-dev](https://avatars.githubusercontent.com/u/185589300?v=4)](https://github.com/sanf-dev "sanf-dev (27 commits)")

---

Tags

botbot-apibot-phpchatbotchatbot-apichatbot-rubikaphpphp-botrubikarubika-botrubika-bot-apirubika-bot-phprubotphpbotphp-botrubikarubika botRubotbot-php

### Embed Badge

![Health badge](/badges/sanf-rubot/health.svg)

```
[![Health](https://phpackages.com/badges/sanf-rubot/health.svg)](https://phpackages.com/packages/sanf-rubot)
```

###  Alternatives

[digitalstars/simplevk

Powerful PHP library/framework for VK API bots, supporting LongPoll &amp; Callback &amp; OAuth

883.9k3](/packages/digitalstars-simplevk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
