Pyropatch
  • INTRODUCTION
    • Installation
    • Quick Start
  • Patches
    • Command Handler
    • Flood Handler
    • Listen
      • Message Listener
      • Callback Listener
      • Inline Query Listener
      • Inline Result Listener
  • Misc
    • Support
Powered by GitBook
On this page
  1. Patches

Command Handler

Advanced Functionality for Bot Commands

Patch Command Handler

from pyrogram import Client
from pyropatch import command_handler

app = Client(...)

Features

Pass Command Info When Creating Command

from pyrogram import Client
from pyropatch import command_handler                   #apply command handler

app = Client(...)

#pass info along with commands in command filter
@app.on_message(filters.command(commands='start',info='Check Bot is Alive'))

Get all the added command and its info using Pyrogram Client

from pyrogram import Client
from pyropatch import command_handler                   #apply command handler

app = Client(...)

# to get all the commands available in bot
commands = app.commands

Set Bot Commands with all commands available in bot

from pyrogram import Client
from pyropatch import command_handler                   #apply command handler

app = Client(...)

# to set bot commands from the command available on bot
await app.auto_set_commands()
PreviousQuick StartNextFlood Handler

Last updated 2 years ago