GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sanf-dev/Rubot: Rubot - PHP library for creating bots on Rubika platform

BranchesTags
Open more actions menu

Latest commit

 

History

27 Commits
27 Commits

Folders and files

NameName
Last commit message
Last commit date
client
client
 
 
src
src
 
 
tests
tests
 
 
.gitattributes
.gitattributes
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 
index.html
index.html
 
 
wiki-en.md
wiki-en.md
 
 

Repository files navigation

logo - Rubot

Rubot

PHP framework for building Rubika bots efficiently and intelligently.

PHP Framework PHP Version Packagist

Rubot

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?

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

  1. Get your token from the @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
  1. 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
  1. Set a Webhook for Your Bot
$bot->setWebHook("WEBHOOK_URL");
  1. Congratulations 🎉 You have successfully set up your bot!

(Bot) Methods

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

Get familiar with the different methods

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 & 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

  • 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 & 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 & 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

  • text : get Message
  • chat_id : get Chat Id
  • message_id : get Message Id

License

MIT © Sanf-Dev

About

Rubot - PHP library for creating bots on Rubika platform

Topics

botbot-apibot-phpchatbotchatbot-apichatbot-rubikaphpphp-botrubikarubika-botrubika-bot-apirubika-bot-phprubot

Resources

Readme
MIT license
Activity

Stars

7 stars

Watchers

0 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.