mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-31 06:16:06 +00:00
Various improvements
This commit is contained in:
7
compiler/docs/template/bound-methods.rst
vendored
7
compiler/docs/template/bound-methods.rst
vendored
@@ -1,12 +1,11 @@
|
||||
Bound Methods
|
||||
=============
|
||||
|
||||
Some Pyrogram types define what are called bound methods. Bound methods are functions attached to a class which are
|
||||
accessed via an instance of that class. They make it even easier to call specific methods by automatically inferring
|
||||
Some Pyrogram types define what are called bound methods. Bound methods are functions attached to a type which are
|
||||
accessed via an instance of that type. They make it even easier to call specific methods by automatically inferring
|
||||
some of the required arguments.
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 8
|
||||
|
||||
from pyrogram import Client
|
||||
|
||||
@@ -15,7 +14,7 @@ some of the required arguments.
|
||||
|
||||
@app.on_message()
|
||||
def hello(client, message)
|
||||
message.reply_text("hi")
|
||||
message.reply("hi")
|
||||
|
||||
|
||||
app.run()
|
||||
|
7
compiler/docs/template/methods.rst
vendored
7
compiler/docs/template/methods.rst
vendored
@@ -1,18 +1,17 @@
|
||||
Available Methods
|
||||
=================
|
||||
|
||||
This page is about Pyrogram methods. All the methods listed here are bound to a :class:`~pyrogram.Client` instance,
|
||||
except for :meth:`~pyrogram.idle()`, which is a special function that can be found in the main package directly.
|
||||
This page is about Pyrogram methods. All the methods listed here are bound to a :class:`~pyrogram.Client` instance.
|
||||
Some other utility functions can instead be found in the main package directly.
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 6
|
||||
|
||||
from pyrogram import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
with app:
|
||||
app.send_message("haskell", "hi")
|
||||
app.send_message("me", "hi")
|
||||
|
||||
.. contents:: Contents
|
||||
:backlinks: none
|
||||
|
1
compiler/docs/template/types.rst
vendored
1
compiler/docs/template/types.rst
vendored
@@ -6,7 +6,6 @@ Unless required as argument to a client method, most of the types don't need to
|
||||
are only returned by other methods. You also don't need to import them, unless you want to type-hint your variables.
|
||||
|
||||
.. code-block:: python
|
||||
:emphasize-lines: 1
|
||||
|
||||
from pyrogram.types import User, Message, ...
|
||||
|
||||
|
Reference in New Issue
Block a user