sanf/rush
Composer 安装命令:
composer require sanf/rush
包简介
A simple and lightweight client for connecting to Rubika and Shad messaging platforms, designed for easy integration and efficient setup of user-friendly applications. This library provides essential functionalities for sending and receiving messages, managing user sessions, and ensuring smooth comm
README 文档
README
Rush | Rubika - Shad API
What's New?
Update v2.1.1
Updates:
- Added Rubino Android Client
- Added Auto-Login for a Source (Beta | Login on Android)
- Synced with the Latest Rubika and Shad Updates
- Added Method to Play Video from Link or File Path in Live with ffmpeg Tool (if installed)
Debugged:
- Debugged Methods and Parts of the Library
- Fixed Issue of Not Running on Host
- Changed Method of Calling the Library
Table of Contents
- Description
- Installation
- Create a Bot
- config rubika and shad
- config rubino
- Rubika and Shad Methods
- Socket Methods
Rubika Client
A simple yet practical client for creating self bots for Rubika and Shad, supporting three platforms: Android, Web, and PWA. This client is designed for building self bots for various purposes, including group management, entertainment, assistance, gaming, and more.
Installation:
composer require sanf/rush
Creating a Bot:
// Loading the classes require_once "vendor/autoload.php"; use Sanf\Client; use Sanf\Tools\Message; // Entering login information and setting up the client $self = new Client('rush'); // Creating an anonymous function $action = function (Message $update) use ($self) { // Receiving text updates $text = $update->text(); // Creating a command for reacting to a message, for example: if ($text == "hello") { // Sending the response to the user using the reply command $update->reply("Hello, nice to meet you!\nMy name is Sanf.!!!!!"); } }; // Connecting to the WebSocket $self->on_message($action);
Congratulations, you have now set up a client!
Rubika and Shad Client Configuration
Using Auto-Login
// Use your custom session name instead of Sanf $self = new Client("Sanf");
Manually Entering Information
// Use your custom session name instead of Sanf $self = new Client("Sanf"); /* To manually enter the information, you need to provide 4 parameters: 1. auth | Account ID 2. key | Private Key 3. platform | Platform (Web, Android, PWA - PWA is not available for Shad, default is Web) 4. application | Application */ // For example, our data will be as follows $option = [ "auth" => "your Auth key", "key" => "your Private key", "platform" => "select Platform", "application" => "select Application" ]; // For Rubika $option = [ "auth" => "your Auth key", "key" => "your Private key", "platform" => Platform::PWA, // Can be changed to Web or Android "application" => Application::Rubika // Choosing an application ]; // For Shad $option = [ "auth" => "your Auth key", "key" => "your Private key", "platform" => Platform::Web, // Can be changed to Android - PWA is not available for Shad "application" => Application::Shad // Choosing an application ]; // Now we provide the information to the client // Note that you must set the first value to null $self = new Client(null, $option);
Rubino Configuration
Rubino configurations are similar to Rubika, but for manual entry, only auth is used.
Using Auto-Login
// Use your custom session name instead of Sanf $self = new Rubino("Sanf");
Manually Entering Information
/* In this section, you have 1 mandatory parameter and 1 optional parameter: 1. auth | Account ID (mandatory) 2. profile_id | Custom Profile ID (optional, if not entered, the bot will automatically retrieve all profile IDs and you will choose which account it will operate on) */ // For example, our data will be as follows $option = [ "auth" => "your auth key", // Mandatory "profile_id" => "custom profile id" // Optional ]; // Now we provide the information to the client $self = new Rubino(null, $option);
Rubika and Shad Methods
| Method | Description |
|---|---|
| addChannel | Add a new channel to your account. |
| addGroup | Add a new group. |
| addToMyGifSet | Add a GIF to your personal GIF list. |
| createGroupVoiceChat | Create a new voice chat group. |
| deleteMessages | Delete messages from a chat. |
| getAvatars | Fetch the profile picture using the provided GUID. |
| getChats | Retrieve the list of chats available to you. |
| getChatsUpdates | Receive updates on chat activity. |
| getContact | Get a list of your contacts. |
| getFolders | Receive account folders. |
| getGroupAdminMembers | Get the members who are admins of a group. |
| getGroupInfo | Get information about a group. |
| getGroupLink | Retrieve the link to the group. |
| getGroupOnlineCount | Get the number of online members in a group. |
| getInfoByUsername | Get information about a user using their username. |
| getMessages | Retrieve a list of messages from a specific chat. |
| getMessagesByID | Retrieve a message by its ID. |
| getMySessions | Get a list of your active sessions. |
Socket Methods
| Method | Activity |
|---|---|
| author_guid | Get the unique identifier (GUID) of the message sender. |
| chat_type | Determine the type of chat (individual or group) based on the context. |
| count_unseen | Retrieve the count of unread messages in a chat. |
| deleteMessage | Remove a specific message using its ID. |
| editMessage | Modify an existing message using its ID. |
| file_inline | Handle non-text messages and their corrections. |
| forward_message_id | Get the ID of a forwarded message. |
| forward_object_guid | Retrieve the GUID of the message being forwarded. |
| groupAccess | Get chat access information (who can access the chat). |
| has_link | Determine if the message contains a hyperlink. |
| is_forward - forward_from | Identify if the message was forwarded from another chat. |
| is_group | Check if the message was sent in a group chat. |
| is_private | Verify if the message was sent from a private chat. |
| last_message_id | Get the ID of the last message sent in the chat. |
| message_id | Retrieve the ID of the last sent message. |
| message_type | Identify the type of the sent message (text, image, etc.). |
| reply | Send a reply to the last message received. |
| reply_message_id | Get the ID of the message to which the current message is a reply. |
| seen | Mark the message as read. |
| setReaction | Add a reaction (emoji) to the message. |
| text | Retrieve the content of the received message. |
| title | Get the title of the current chat. |
| getData | Receive all the output data from the websocket. |
Need help? Send a message on Telegram or Rubika .!
We hope you have enjoyed it ❤️.
Perseverance is the key to success !
sanf/rush 适用场景与选型建议
sanf/rush 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 61 次下载、GitHub Stars 达 5, 最近一次更新时间为 2025 年 01 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php bot」 「rubika」 「sanf」 「sanfai」 「rubika bot」 「self rubika」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sanf/rush 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sanf/rush 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sanf/rush 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dialogflow php sdk
Laravel 5.6 Monolog custom telegram channel
Alfabank REST API integration
Rubika-PHP is a PHP Library for interaction with rubika (social network)
VK driver for botman
A library for working with rubika API from PHP source code
统计信息
- 总下载量: 61
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-01-11