Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Rubika Smart Bot

🤖

A Powerful Persian Rubika Group Management, Automation & AI Bot

A comprehensive multifunctional Rubika bot built with Python, featuring advanced group management, moderation, automation, AI integration, learning systems, entertainment, user progression, custom commands, and database-backed group configuration.

👨‍💻 Sadra Hatami

Developer • Software Engineer • Creator

🌐 GitHub📧 Email


Python Rubka AsyncIO SQLite aiohttp Requests HTTPX BeautifulSoup AI Automation Persian License


📑 Table of Contents


📖 About

Rubika Smart Bot is a multifunctional Persian Rubika group bot developed with Python.

The project combines group administration, moderation, automation, AI interaction, learning, entertainment, user progression, custom commands, information services, and persistent database storage into a single platform.

The bot is designed primarily for Persian-speaking Rubika communities and provides administrators with a broad set of configurable tools for managing group activity.

The current implementation is centered around a large asynchronous Python application with SQLite-based persistence and multiple external HTTP/API integrations.


🚀 Why Rubika Smart Bot?

Managing a large group often requires multiple systems for moderation, permissions, automation, interaction, and entertainment.

Rubika Smart Bot brings these capabilities together into one configurable platform.

The project focuses on:

  • 🛡️ Group security and moderation
  • ⚙️ Administrative automation
  • 🤖 AI-powered interaction
  • 🧠 Learning and custom responses
  • 👤 User management and permissions
  • 🏆 XP, levels, badges, and leaderboards
  • 🎮 Interactive games
  • 📊 Group reports and statistics
  • 💾 Persistent SQLite storage
  • 🔧 Customizable group behavior
  • 🇮🇷 Persian-language interaction

✨ Key Features

🤖 Intelligence & Interaction

  • AI-powered question answering
  • Advanced learning system
  • Custom commands
  • Automatic responses
  • Speaker system
  • Personal speaker
  • Polite speaker mode
  • Default speaker mode
  • Text-to-speech related functionality

👑 Group Administration

  • Group owner management
  • Assistant administrators
  • Special users
  • Exempt users
  • Group rules
  • Group status
  • Group lock system
  • Ban locks
  • Warning locks
  • User warnings
  • Mute management
  • Customizable permissions

🛡️ Moderation & Protection

  • Anti-Link
  • Anti-Advertisement
  • Anti-Curse
  • Anti-Hang
  • Anti-Emoji
  • Anti-Edit
  • Anti-Mention
  • GIF control
  • Content-type locks
  • Bot protection
  • CAPTCHA configuration
  • Blacklist words
  • Whitelist links
  • Warning system
  • Automatic message deletion

🏆 User Engagement

  • XP system
  • User levels
  • Level-based badges
  • Group leaderboard
  • User profiles
  • User notes
  • Achievements
  • Daily rewards
  • Favorites
  • Birthdays

🎮 Entertainment

  • Mathematical game
  • Word game
  • Number guessing game
  • Dice game
  • Hafez fortune
  • Riddles
  • Jokes
  • Interesting facts
  • Movie suggestions
  • English tips
  • Motivational content
  • Hadith

📊 Group Tools

  • Reports
  • Group statistics
  • Polls
  • Events
  • Petitions
  • Giveaways
  • Timers
  • Reminders
  • Topics
  • Tags
  • Invite links
  • Log channels
  • Custom reactions
  • Auto responders

👑 Group Management

Rubika Smart Bot provides a multi-level administration system designed for group owners and administrators.

⚡ Bot Control

Administrators can control the bot's operating status:

ربات روشن
ربات خاموش

📜 Group Rules

Group rules can be viewed and configured:

قوانین
تنظیم قوانین

🔒 Group Locks

The bot supports configurable locks for different types of content.

Supported lock categories include:

  • ID
  • Links
  • Text
  • Stickers
  • Voice
  • Video
  • Music
  • Images
  • GIFs
  • Files
  • English words
  • Replies
  • Forwards
  • Edits
  • Emojis
  • Code
  • Curse words
  • Polls
  • Numbers
  • Phone numbers
  • Hashtags
  • Groups

Example:

لینک قفل
لینک باز

🔇 Warning & Mute Management

Administrators can manage user warnings and muted users.

The system supports:

  • Adding warnings
  • Removing warnings
  • Warning limits
  • Configurable warning actions
  • Temporary mute
  • Permanent mute
  • Mute lists
  • Clearing mute data

🛡️ Security & Moderation

Security and moderation are core components of the project.

The bot provides configurable moderation systems such as:

System Function
🔗 Anti-Link Controls unwanted links
📢 Anti-Advertisement Controls advertisements
🤬 Anti-Curse Filters inappropriate language
🌀 Anti-Hang Controls problematic message patterns
😀 Anti-Emoji Controls emoji-based content
✏️ Anti-Edit Controls edited messages
🚫 Anti-Mention Controls unwanted mentions
🎞️ GIF Control Controls GIF messages
🤖 Bot Protection Helps manage bot accounts
🧩 CAPTCHA Supports group verification settings
📝 Blacklist Blocks configured words
🔗 Whitelist Allows configured links

Each group can maintain its own configuration.


🤖 AI System

The bot includes an AI interaction system connected through an external API.

Users can send a question using the + prefix.

Example:

+پایتون چیست؟

The bot sends the request to the configured AI service and returns the response to the group.

The AI endpoint is configurable through the bot's configuration variables.

⚠️ API credentials and private tokens should never be committed to the public repository.


🧠 Learning System

The project contains both custom-command functionality and an advanced learning system.

Basic Custom Learning

Groups can define custom commands and responses.

Example:

!سلام!سلام صدرا!

The bot stores the custom response for future use.

Advanced Learning

The advanced learning system supports storing multiple responses for keywords.

It also supports removing:

  • All responses for a keyword
  • A specific response for a keyword

Example formats include:

!keyword!response

and:

!!keyword

The stored learning data is persisted in SQLite.


👤 User System

Rubika Smart Bot maintains user-related data for each group.

The system supports:

  • User profiles
  • User notes
  • User warnings
  • User badges
  • User achievements
  • User levels
  • XP
  • Favorites
  • Birthdays
  • Daily rewards
  • Cooldowns
  • Reports

This allows the bot to provide personalized and persistent functionality for group members.


🏆 Levels, XP & Badges

The project includes a gamified user progression system.

Users can earn XP through supported interactions and games.

The system maintains:

  • Current XP
  • Current level
  • XP required for the next level
  • XP progress
  • Group leaderboard
  • User badges
  • Level-based achievements

Special badges are awarded at specific levels.

The current implementation includes badge milestones such as:

Level 10 → Silver
Level 20 → Gold
Level 50 → Diamond

Users can also view the leaderboard:

لیست برترین‌ها

and their earned badges.


⚙️ Automation

The bot contains several automation systems for reducing repetitive administrative tasks.

🧹 Automatic Message Deletion

Administrators can enable automatic deletion and configure its timing.

حذف خودکار روشن
حذف خودکار خاموش

⏱️ Timers

Command timers and group timers can be stored and managed.

🔔 Reminders

Groups can maintain reminders for users and scheduled events.

👋 Welcome & Goodbye

The database architecture includes configurable welcome and goodbye messages.

🤖 Auto Responders

Groups can define automated responses for specific triggers.

🏷️ Auto Roles

The project includes database support for automatic group roles based on user levels.


🎮 Games & Entertainment

The bot provides several interactive games.

🧮 Math Game

بازی ریاضی

🔤 Word Game

بازی کلمات

🔢 Number Guessing

بازی حدس عدد

🎲 Dice Game

Users can make an even/odd prediction:

تاس زوج

or:

تاس فرد

🍃 Hafez Fortune

فال حافظ

🧩 Riddles

معما
جواب معما

😂 Jokes

لطیفه

The project also includes additional interactive content such as interesting facts, movie suggestions, English tips, and other informational responses.


📊 Reports & Statistics

The bot maintains message and activity statistics.

Supported report categories include:

  • Text messages
  • Photos
  • Videos
  • Stickers
  • Files
  • Links
  • Forwarded messages

Administrators can request group reports using:

گزارشات

The bot also provides configuration status information for various group systems.


🗳️ Polls, Events & Community Tools

The database architecture includes support for several community-oriented features.

🗳️ Advanced Polls

Polls can include:

  • Questions
  • Multiple options
  • Anonymous voting
  • Multiple-choice configuration
  • End times
  • Vote tracking

📅 Events

Groups can create and manage events with:

  • Event name
  • Event description
  • Event time
  • Participants
  • Creator

✍️ Petitions

The bot supports petition-related data including:

  • Title
  • Description
  • Target votes
  • Current votes
  • Signatures
  • End time

🎁 Giveaways

Giveaways can store:

  • Prize
  • Winner count
  • Participants
  • End time
  • Creator

💾 Database

The project uses SQLite as its persistent database.

The database is automatically initialized by the application and contains multiple tables for storing group and user information.

Major database areas include:

  • User levels
  • User badges
  • Custom commands
  • Warnings
  • Invites
  • Topics
  • Birthdays
  • Reminders
  • Blacklists
  • Whitelists
  • Logs
  • Auto roles
  • User notes
  • Giveaways
  • Quizzes
  • Events
  • Achievements
  • Filters
  • Auto responders
  • Cooldowns
  • Welcome messages
  • Goodbye messages
  • CAPTCHA settings
  • Timers
  • Music queues
  • Favorites
  • Custom reactions
  • Petitions
  • Daily rewards
  • Voice chat settings
  • Bot protection
  • Tags
  • Polls
  • Group links
  • Group settings
  • Locks

The database file is:

chats.db

🌐 External Services

The project communicates with several external HTTP services for different features.

These integrations are used for capabilities such as:

  • 🤖 AI responses
  • 📰 News
  • 💰 Cryptocurrency information
  • 💱 Currency information
  • 📅 Date and time information
  • 🌤️ Weather
  • 🖼️ Image retrieval
  • 📱 Application search
  • 🎂 Birthday information
  • 🔊 Speaker/TTS functionality
  • 📚 Other information services

External endpoints can change independently of the project.


🛠️ Technologies

Technology Purpose
🐍 Python Main programming language
⚡ asyncio Asynchronous programming
🤖 Rubka Rubika bot framework
💾 SQLite Persistent data storage
🌐 aiohttp Asynchronous HTTP requests
🌐 Requests HTTP requests
🌐 HTTPX HTTP client
🍲 BeautifulSoup Web scraping and HTML parsing
📅 jdatetime Persian date and time
🔐 hashlib Hashing functionality
🧩 Regular Expressions Text processing and command parsing
🔌 External APIs AI and information services

🚀 Installation

1. Clone the Repository

git clone https://github.com/sadra-hatami/Rubika-Smart-Bot.git
cd Rubika-Smart-Bot

2. Install Dependencies

Install the required Python packages used by the project.

pip install rubka aiohttp requests httpx beautifulsoup4 jdatetime

3. Configure the Bot

Configure your private credentials and API settings before running the application.

4. Run the Bot

python index.py

⚙️ Configuration

The bot uses configuration variables for its database, administrator information, channel information, and external API settings.

Example:

DB_PATH = "chats.db"

ADMIN_CHAT_ID = "your_admin_chat_id"
ADMIN_ID = [ADMIN_CHAT_ID]

CHANNEL_LINK = "@your_channel"
CHANNEL_CREATOR = "@your_creator"

AI_API_URL = "your_ai_api_url"

The bot token should be configured separately and must not be committed to GitHub.

🔐 Security Recommendation

For production use, sensitive values should be stored in environment variables or a .env file.

Example:

BOT_TOKEN=your_bot_token
ADMIN_CHAT_ID=your_admin_chat_id
CHANNEL_LINK=@your_channel
CHANNEL_CREATOR=@your_creator
AI_API_URL=your_ai_api_url

Add the following to .gitignore:

.env
chats.db
__pycache__/
*.pyc

▶️ Usage

Add the Bot to a Group

  1. Add the bot to your Rubika group.
  2. Give it the required administrator permissions.
  3. Register the group using the activation command.
فعال

View Help

راهنما

or:

دستورات

Check Group Status

وضعیت

📚 Command Examples

🤖 Bot Control

ربات روشن
ربات خاموش

📜 Rules

قوانین
تنظیم قوانین

🛡️ Moderation

ضد لینک روشن
ضد لینک خاموش

ضد تبلیغ روشن
ضد تبلیغ خاموش

ضد فحش روشن
ضد فحش خاموش

ضد ایموجی روشن
ضد ایموجی خاموش

ضد ویرایش روشن
ضد ویرایش خاموش

ضد منشن روشن
ضد منشن خاموش

🧹 Auto Delete

حذف خودکار روشن
حذف خودکار خاموش
حذف خودکار زمان 30

🗣️ Speaker

سخنگو روشن
سخنگو خاموش

سخنگو شخصی روشن
سخنگو شخصی خاموش

سخنگو باادب روشن
سخنگو بی ادب روشن

🤖 AI

+پایتون چیست؟

🧠 Learning

!سلام!سلام!

🏆 User Progress

لیست برترین‌ها

🎮 Games

بازی ریاضی
بازی کلمات
بازی حدس عدد

🎲 Entertainment

فال حافظ
معما
جواب معما
لطیفه
حقیقت جالب
پیشنهاد فیلم
نکته انگلیسی

📊 Reports

گزارشات

🎯 Target Audience

👑 Rubika Group Owners

For administrators who need a centralized group management and moderation system.

👮 Group Administrators

For managing rules, permissions, warnings, locks, users, and automated systems.

🤖 Bot Developers

For developers interested in Python-based Rubika bot development.

🐍 Python Developers

For developers interested in asynchronous applications, APIs, databases, automation, and message-driven systems.

👥 Persian-Speaking Communities

For Rubika groups looking for management, interaction, entertainment, and automation features in Persian.


🌟 Project Highlights

✅ Multifunctional Persian Rubika bot

✅ Large-scale Python implementation

✅ Asynchronous architecture using asyncio

✅ SQLite-based persistent storage

✅ Advanced group moderation

✅ Multi-level permission system

✅ AI API integration

✅ Advanced learning system

✅ Custom command engine

✅ XP, levels, badges, and leaderboard

✅ Multiple interactive games

✅ Automated group controls

✅ Warnings and mute management

✅ CAPTCHA and bot protection support

✅ Polls, events, petitions, and giveaways

✅ Timers and reminders

✅ User profiles and achievements

✅ Extensive external API integrations


🗺️ Roadmap

Future development may include:

  • 🤖 More advanced AI capabilities
  • 🧠 Improved learning architecture
  • 🛡️ More advanced moderation systems
  • 📊 Advanced analytics dashboard
  • 🌐 Web-based administration panel
  • 📱 Dedicated management interface
  • ⚡ Performance optimization
  • 🧩 Modular command architecture
  • 🔐 Improved secrets management
  • 🧪 Automated testing
  • 📝 Expanded documentation
  • 🐳 Docker deployment
  • 🔄 Improved database architecture

❓ FAQ

What language is Rubika Smart Bot written in?

The project is primarily written in Python.

Does the project use asynchronous programming?

Yes. The bot uses Python's asyncio architecture together with asynchronous Rubka functionality and HTTP clients.

Does the bot use a database?

Yes. The project uses SQLite for persistent storage.

Does the bot support AI?

Yes. An external AI API is integrated into the bot.

Does the bot support custom commands?

Yes. Groups can create and manage custom commands and responses.

Does the bot have a learning system?

Yes. The project contains both custom command functionality and an advanced learning system.

Does the bot support user levels?

Yes. Users can earn XP, progress through levels, receive badges, and appear on the group leaderboard.

Is the bot designed for Persian users?

Yes. The command system and primary interaction language are Persian.


🤝 Contributing

Contributions and suggestions are welcome.

You can contribute by:

  • 🐛 Reporting bugs
  • 💡 Suggesting new features
  • 🔧 Improving the source code
  • ⚡ Optimizing performance
  • 🔐 Improving security
  • 📝 Improving documentation
  • 🧪 Adding tests
  • 🔀 Submitting Pull Requests

Please keep contributions focused, readable, and consistent with the project's architecture.


📬 Contact

👨‍💻 Sadra Hatami

📧 Email: sadra.hatami.1732@gmail.com

🌐 GitHub: sadra-hatami

For questions, suggestions, bug reports, or collaboration, feel free to get in touch.


📄 License

This project is licensed under the MIT License.

See the LICENSE file for more information.


©️ Copyright

© 2026 Sadra Hatami

All rights reserved.

This project is developed and maintained by Sadra Hatami.


⭐ Support

If you find Rubika Smart Bot useful, consider giving the repository a ⭐ on GitHub.

Your support helps the project grow and encourages future development.


Designed & Developed with ❤️ for the developer community of Iran and the world by Sadra Hatami

About

A powerful Persian Rubika bot for group management, AI, security, entertainment, learning, and automation.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages