
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
A powerful and flexible pagination library for Pyrogram bots that automatically handles help commands and module organization.
pip install pyrohelpo
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
)
json
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",
"short_help": True,
"support_as_callback": True,
"support_c_back_name": "say_hi"
}
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)
short_help=True # Optional: Enable short help mode
)
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
"""
from pyrogram import Client
from Helpo import Helpo
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")
Helpo automatically handles group chats by providing options to:
@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.")
To automatically handle the /help
command in your bot, you can use the monkeypatch_client
method:
from pyrogram import Client
from Helpo import Helpo
app = Client("my_bot")
helpo = Helpo(
client=app,
modules_path="plugins",
buttons_per_page=6,
texts=custom_texts
)
helpo.monkeypatch_client()
app.run()
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 dictionaryshort_help
: Boolean to enable short help modeload_modules()
: Loads all modules from the specified pathshow_help_menu(chat_id: int, page: int = 1, message_id: int = None)
: Displays the main help menushow_module_help(query_or_message, module_name: str)
: Shows help for a specific modulesend_message(chat_id: int, text: str, reply_markup: InlineKeyboardMarkup = None, message_id: int = None)
: Sends a message with optional media and keyboardmonkeypatch_client()
: Patches the Pyrogram client to handle the /help
commandHelpo includes comprehensive error handling for:
This project is licensed under the MIT License - see the LICENSE file for details.
Need help? Join our support chat or create an issue on our GitHub repository.
Made with ❤️ by the Helpo team
FAQs
A powerful pagination library for Pyrogram bots
We found that pyrohelpo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.