A powerful pagination library for Pyrogram bots
Project description
Helpo 📚
A powerful and flexible pagination library for Pyrogram bots that automatically handles help commands and module organization.
Features ✨
- 🔄 Automatic module discovery and help text organization
- 📱 Beautiful paginated help menus with inline buttons
- 🎯 Support for both command-based and button-based help
- 🎨 Customizable button layouts and texts
- 🔌 Easy integration with existing Pyrogram bots
- 📝 Support for rich media in help messages (photos, videos)
- 🔗 Deep linking support for direct access to help menus
- 🌐 Group chat support with private message options
- 🎭 Flexible parse mode selection
- 🖼️ Media support with photo and video options
Installation 🚀
pip install pyrohelpo
Usage ⚙️
Basic Setup
from pyrogram import Client
from Helpo import Helpo
from pyrogram.enums import ParseMode
# Initialize your Pyrogram client
app = Client("my_bot")
# Initialize Helpo
helpo = Helpo(
client=app,
modules_path="plugins",
buttons_per_page=6
)
Advanced Configuration
custom_texts = {
"help_menu_title": "**🛠 Custom Help Menu**",
"help_menu_intro": "Available modules ({count}):\n{modules}\n\nTap on a module to explore.",
"module_help_title": "**🔍 Details for {module_name} Module**",
"module_help_intro": "Description:\n{help_text}",
"no_modules_loaded": "⚠️ No modules available at the moment.",
"back_button": "◀️ Go Back",
"prev_button": "⬅️ Previous Page",
"next_button": "➡️ Next Page",
"support_button": "💬 Contact Support",
"support_url": "https://t.me/YourSupportBot",
"group_help_message": "Click The Button To Access Help",
"group_pvt_button": "See In Private",
"group_open_here": "Open Here"
}
helpo = Helpo(
client=app,
modules_path="plugins",
buttons_per_page=6,
texts=custom_texts,
help_var="HELP",
module_var="MODULE",
photo="path/to/photo.jpg", # Optional: Add photo to help messages
video="path/to/video.mp4", # Optional: Add video to help messages
parse_mode=ParseMode.HTML, # Optional: Change parse mode (default: MARKDOWN)
disable_web_page_preview=False # Optional: Enable web preview (default: True)
)
Module Setup
Create Python files in your modules directory with the following structure:
MODULE = "Admin" # Module name displayed in help menu
HELP = """
**Admin Commands**
/ban - Ban a user
/unban - Unban a user
/mute - Mute a user
/unmute - Unmute a user
"""
Custom Class Implementation
class Bot(Client):
def __init__(self):
super().__init__(
"my_bot",
api_id=API_ID,
api_hash=API_HASH,
bot_token=BOT_TOKEN
)
self.helpo = Helpo(
client=self,
modules_path="plugins",
buttons_per_page=6,
texts=custom_texts
)
async def start(self):
await super().start()
print("Bot Started")
print(f"Loaded Modules: {', '.join(self.helpo.modules.keys())}")
async def stop(self):
await super().stop()
print("Bot Stopped")
Group Chat Support
The new Helpo version automatically handles group chats by providing options to:
- View help menu in private chat
- View help menu directly in the group
- Customize group chat behavior through texts dictionary
Deep Linking Support
@app.on_message(filters.command("start"))
async def start_command(client, message):
if len(message.text.split()) > 1:
param = message.text.split(None, 1)[1]
if param == "help":
await client.show_help_menu(message.chat.id)
else:
await message.reply("Welcome! Use /help to see available commands.")
Customization Options 🎨
Available Text Customizations
All text elements can be customized through the texts dictionary:
help_menu_title: Title of the main help menuhelp_menu_intro: Introduction text with module countmodule_help_title: Title for individual module helpmodule_help_intro: Introduction text for module helpno_modules_loaded: Message when no modules are foundback_button: Text for back buttonprev_button: Text for previous page buttonnext_button: Text for next page buttonsupport_button: Text for support buttonsupport_url: URL for support buttongroup_help_message: Message shown in groupsgroup_pvt_button: Text for private chat buttongroup_open_here: Text for in-group help button
Media Support
You can enhance your help menu with either photos or videos:
helpo = Helpo(
client=app,
modules_path="plugins",
photo="https://example.com/help-banner.jpg" # OR
video="https://example.com/help-tutorial.mp4"
)
Note: You can only use either photo or video, not both simultaneously.
Methods and Attributes 📚
Helpo Class
Attributes:
client: Pyrogram Client instancemodules_path: Path to modules directorybuttons_per_page: Number of buttons per pagehelp_var: Variable name for help text (default: "HELP")module_var: Variable name for module name (default: "MODULE")photo: Optional photo URL/pathvideo: Optional video URL/pathparse_mode: Message parse modedisable_web_page_preview: Web preview settingtexts: Customizable text dictionary
Methods:
load_modules(): Loads all modules from the specified pathshow_help_menu(): Displays the main help menushow_module_help(): Shows help for a specific module
Error Handling
Helpo includes comprehensive error handling for:
- Invalid module files
- Missing required attributes
- Media loading failures
- Message sending errors
- Callback query processing
Contributors 👥
License 📄
This project is licensed under the MIT License - see the LICENSE file for details.
Support 🤝
Need help? Join our support chat or create an issue on our GitHub repository.
Image Gallery 🖼️
Made with ❤️ by the Helpo team
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrohelpo-4.1.2.tar.gz.
File metadata
- Download URL: pyrohelpo-4.1.2.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6db2f5c9751408ef268b8ce2c52ecd5df501d272bd174fe90797573cb7029fad
|
|
| MD5 |
4937a80e9210a4900aec5ebc21b92548
|
|
| BLAKE2b-256 |
776540de8b418608ae2fd4347a1003be0860ab62bfe19f0ecb559617a5d21f4f
|
Provenance
The following attestation bundles were made for pyrohelpo-4.1.2.tar.gz:
Publisher:
publish.yml on Vishal-1756/pyrohelpo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrohelpo-4.1.2.tar.gz -
Subject digest:
6db2f5c9751408ef268b8ce2c52ecd5df501d272bd174fe90797573cb7029fad - Sigstore transparency entry: 155322075
- Sigstore integration time:
-
Permalink:
Vishal-1756/pyrohelpo@7e7c9e8baf6681dd879d8a384dd2c35ab3725a1f -
Branch / Tag:
refs/tags/4.1.2 - Owner: https://github.com/Vishal-1756
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7e7c9e8baf6681dd879d8a384dd2c35ab3725a1f -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyrohelpo-4.1.2-py3-none-any.whl.
File metadata
- Download URL: pyrohelpo-4.1.2-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0ac8281b5c4b8e0ef0ba15e367bc422835161bb27f4337a6da13df376544371
|
|
| MD5 |
1dd6a395b1256952a384df6d4fc55b4e
|
|
| BLAKE2b-256 |
bc150934524293deeeac6cb242c43d81a0d008481963560635e9fbaf1143de9f
|
Provenance
The following attestation bundles were made for pyrohelpo-4.1.2-py3-none-any.whl:
Publisher:
publish.yml on Vishal-1756/pyrohelpo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrohelpo-4.1.2-py3-none-any.whl -
Subject digest:
b0ac8281b5c4b8e0ef0ba15e367bc422835161bb27f4337a6da13df376544371 - Sigstore transparency entry: 155322080
- Sigstore integration time:
-
Permalink:
Vishal-1756/pyrohelpo@7e7c9e8baf6681dd879d8a384dd2c35ab3725a1f -
Branch / Tag:
refs/tags/4.1.2 - Owner: https://github.com/Vishal-1756
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7e7c9e8baf6681dd879d8a384dd2c35ab3725a1f -
Trigger Event:
release
-
Statement type: