Giter VIP home page Giter VIP logo

pyropatch's Introduction

Pyropatch

An advanced monkeypatcher add-on for Pyrogram

Installation

Install pyropatch with pip

  pip install pyropatch

Usage/Examples

All patches

  • Command Handler
  • Flood Handler
  • Listen
from pyropatch import pyropatch                    #apply all patches
from pyrogram import Client

app = Client(...)

Command Handler

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

app = Client(...)

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

# to set bot commands from the command available on bot
app.auto_set_commands()

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

Flood Handler

from pyropatch import flood_handler                   #apply flood handler
from pyrogram import Client

app = Client(...)

# all floodwaits will automatically handled
app.send_message("me", "Flood handled with **Pyropatch**!")

Listen

from pyropatch import listen                   #apply listen
from pyrogram import Client

app = Client(...)
# listen for a message in a particular chat
m = app.listen_message(chat_id=chat_id, filters=filters, timeout=timeout)

# listen for a callback data in a particular message
u = app.listen_callback(chat_id=chat_id, message_id=message_id, filters=filters, timeout=timeout)
u = app.listen_callback(inline_message_id=inline_message_id, filters=filters, timout=timeout)

# listen for an inline query 
u = app.listen_inline_query(user_id=user_id, filters=filters, timeout=timeout)

# listen for an inline result 
u = app.listen_inline_result(user_id=user_id, filters=filters, timeout=timeout)

More Comming Soon

Special thanks to Pyromod

pyropatch's People

Contributors

rahulps1000 avatar shahsad-kp avatar lord-jacksparrow avatar alberteinsteintg avatar lalettan-fan avatar

Forkers

jisshubot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.