Skip to main content

A powerful pagination library for Pyrogram bots

Project description

Helpo 📚

Image

A powerful and flexible pagination library for Pyrogram bots that automatically handles help commands and module organization.

Python Pyrogram License PyPI Downloads

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 menu
  • help_menu_intro: Introduction text with module count
  • module_help_title: Title for individual module help
  • module_help_intro: Introduction text for module help
  • no_modules_loaded: Message when no modules are found
  • back_button: Text for back button
  • prev_button: Text for previous page button
  • next_button: Text for next page button
  • support_button: Text for support button
  • support_url: URL for support button
  • group_help_message: Message shown in groups
  • group_pvt_button: Text for private chat button
  • group_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 instance
  • modules_path: Path to modules directory
  • buttons_per_page: Number of buttons per page
  • help_var: Variable name for help text (default: "HELP")
  • module_var: Variable name for module name (default: "MODULE")
  • photo: Optional photo URL/path
  • video: Optional video URL/path
  • parse_mode: Message parse mode
  • disable_web_page_preview: Web preview setting
  • texts: Customizable text dictionary

Methods:

  • load_modules(): Loads all modules from the specified path
  • show_help_menu(): Displays the main help menu
  • show_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrohelpo-3.1.3.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyrohelpo-3.1.3-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file pyrohelpo-3.1.3.tar.gz.

File metadata

  • Download URL: pyrohelpo-3.1.3.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyrohelpo-3.1.3.tar.gz
Algorithm Hash digest
SHA256 11a64b291b03f5cf01fc6281e4f97d7bc120a0473f43cac1370f32b3bd1dfbec
MD5 19efcf1165f9ed2c9693ae44406a9386
BLAKE2b-256 799238001cf5f2338ac9d7ff8f6641e961834c3bbb2237ae33b97e62b7eec654

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrohelpo-3.1.3.tar.gz:

Publisher: publish.yml on Vishal-1756/pyrohelpo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrohelpo-3.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyrohelpo-3.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyrohelpo-3.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bac7771b717557f3808d4501b15a2b61d1b756e40b780032bf8594de3375b1fd
MD5 2e434d52034c2e437ea41a8c9383148e
BLAKE2b-256 8fb568e0022e4df816ab5b66a3ea0f884fd3a1efa3e247fb875e9f4a07aecf01

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrohelpo-3.1.3-py3-none-any.whl:

Publisher: publish.yml on Vishal-1756/pyrohelpo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page