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
Installation 🚀
pip install pyrohelpo
Usage ⚙️
Initialize the Helpo instance
from Helpo import Helpo
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",
}
pagination = Helpo(
client=bot,
modules_path="fwd/plugins",
buttons_per_page=9,
texts=custom_texts,
help_var="HELP",
module_var="MODULE",
)
Set up help and module for each Python file in the modules path
MODULE = "HELPO"
HELP = "GO GOA GONE" # You can use docstrings too
Using a custom class
from pyrogram import Client
from Helpo import Helpo
class Bot(Client):
def __init__(self):
super().__init__(
"Hoshi-new",
api_id=API_ID,
api_hash=API_HASH,
bot_token=TOKEN,
plugins=dict(root="shivu"),
)
self.helpo = Helpo(
client=self,
modules_path="shivu/modules",
buttons_per_page=6,
texts=custom_texts,
)
async def start(self):
await super().start()
print("Pyro Bot Started")
print(f"Helpo Initialized with Modules: {', '.join(self.helpo.modules.keys())}")
async def stop(self):
await super().stop()
print("Pyro Bot Stopped")
Deep linking support
@bot.on_message(filters.command("start"))
async def start_command(client, message):
if len(message.text.split()) > 1:
name = message.text.split(None, 1)[1]
if name.startswith("help"):
await bot.show_help_menu(message.chat.id, page=1)
Adding a help button anywhere without callback query
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from . import pagination # Import your Helpo instance
@bot.on_message(filters.command("start"))
async def start_command(client, message):
keyboard = InlineKeyboardMarkup([
[InlineKeyboardButton("Help", callback_data="global_help")]
])
await message.reply("Welcome! Click the button below for help.", reply_markup=keyboard)
Customization Options 🎨
Helpo offers various customization options to tailor the help menu to your bot's needs:
buttons_per_page: Set the number of buttons displayed per page (default: 6)texts: Customize all text messages and button labelshelp_varandmodule_var: Set custom variable names for help text and module namesphotoandvideo: Add rich media to your help messagesparse_mode: Set the parse mode for help messages (default: ParseMode.MARKDOWN)disable_web_page_preview: Enable or disable web page previews in help messages
Image Gallery
Help menu using video
Description: This menu displays video tutorials to help users.
Help menu using only text
Description: This menu uses text-based instructions for simplicity.
Help menu using photo
Description: This menu uses images to visually assist users.
Help menu of a module
Description: This menu shows a module-specific help interface.
Methods and Attributes 📚
Helpo Class
Attributes:
client: The Pyrogram Client instancemodules_path: Path to the modules directorybuttons_per_page: Number of buttons per page in the help menuhelp_var: Variable name for help text in modulesmodule_var: Variable name for module name in modulesphoto: Optional photo to be used in help messagesvideo: Optional video to be used in help messagesparse_mode: Parse mode for help messagesdisable_web_page_preview: Whether to disable web page previews in help messagestexts: Dictionary of customizable text strings
Error Handling
Helpo includes error handling for various scenarios:
- Invalid module files
- Missing required attributes in modules
- Failed module loading
- Message sending failures
Contributors 👥
License 📄
This project is licensed under the MIT License - see the LICENSE file for details.
Support 🤝
If you encounter any issues or have questions, please open an issue on the GitHub repository or join our support chat.
Acknowledgements 🙏
- Pyrogram - The awesome MTProto library for Python
- All contributors who have helped this project grow
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-2.3.3.tar.gz.
File metadata
- Download URL: pyrohelpo-2.3.3.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69914b3bb84376534ee83db8fe751c65909ddde38d371673ef513bbff7bcf859
|
|
| MD5 |
e604cac318c962497fd8f4ce7ed056d3
|
|
| BLAKE2b-256 |
7b828c8fa136434a525e2b07cd0fa23ac38ed24dc77dba64ab5651fe29a48d01
|
Provenance
The following attestation bundles were made for pyrohelpo-2.3.3.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-2.3.3.tar.gz -
Subject digest:
69914b3bb84376534ee83db8fe751c65909ddde38d371673ef513bbff7bcf859 - Sigstore transparency entry: 149252455
- Sigstore integration time:
-
Permalink:
Vishal-1756/pyrohelpo@8759c31e8a4292cd400b97f8f61d0c0cacf781e4 -
Branch / Tag:
refs/tags/v2.3.3 - Owner: https://github.com/Vishal-1756
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8759c31e8a4292cd400b97f8f61d0c0cacf781e4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyrohelpo-2.3.3-py3-none-any.whl.
File metadata
- Download URL: pyrohelpo-2.3.3-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64348286a7aa009e5ea494cb169f025ca454d7cbbe87e6a4512f1e4473d2b35f
|
|
| MD5 |
a07087ad9a94d7718edf40c21c39a65d
|
|
| BLAKE2b-256 |
7ba17d78b33dbd3d7e6e7bff066cb38a1eaf490ac4939300127b6eb6dd1dbc7d
|
Provenance
The following attestation bundles were made for pyrohelpo-2.3.3-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-2.3.3-py3-none-any.whl -
Subject digest:
64348286a7aa009e5ea494cb169f025ca454d7cbbe87e6a4512f1e4473d2b35f - Sigstore transparency entry: 149252456
- Sigstore integration time:
-
Permalink:
Vishal-1756/pyrohelpo@8759c31e8a4292cd400b97f8f61d0c0cacf781e4 -
Branch / Tag:
refs/tags/v2.3.3 - Owner: https://github.com/Vishal-1756
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8759c31e8a4292cd400b97f8f61d0c0cacf781e4 -
Trigger Event:
release
-
Statement type: