2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-09-01 06:45:39 +00:00

Various improvements

This commit is contained in:
Dan
2022-01-07 10:18:51 +01:00
parent 80d0966691
commit 8c8288412f
135 changed files with 842 additions and 1422 deletions

View File

@@ -158,6 +158,7 @@ def pyrogram_api():
send_venue
send_contact
send_cached_media
send_reaction
edit_message_text
edit_message_caption
edit_message_media
@@ -180,7 +181,9 @@ def pyrogram_api():
retract_vote
send_dice
search_messages
search_messages_count
search_global
search_global_count
download_media
get_discussion_message
""",
@@ -284,6 +287,7 @@ def pyrogram_api():
send_game
set_game_score
get_game_high_scores
set_bot_commands
""",
authorization="""
Authorization
@@ -360,6 +364,7 @@ def pyrogram_api():
ChatEvent
ChatEventFilter
ChatMemberUpdated
ChatJoinRequest
Dialog
Restriction
""",
@@ -384,6 +389,7 @@ def pyrogram_api():
Poll
PollOption
Dice
Reaction
VoiceChatScheduled
VoiceChatStarted
VoiceChatEnded
@@ -420,6 +426,8 @@ def pyrogram_api():
InlineQueryResultArticle
InlineQueryResultPhoto
InlineQueryResultAnimation
InlineQueryResultAudio
InlineQueryResultVideo
ChosenInlineResult
""",
input_message_content="""

View File

@@ -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()

View File

@@ -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

View File

@@ -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, ...

View File

@@ -62,6 +62,7 @@ CHAT_NOT_MODIFIED The chat settings (title, permissions, photo, etc..) were not
CHAT_RESTRICTED The chat is restricted and cannot be used
CHAT_SEND_INLINE_FORBIDDEN You cannot use inline bots to send messages in this chat
CHAT_TITLE_EMPTY The chat title is empty
CHAT_TOO_BIG The chat is too big for this action
CODE_EMPTY The provided code is empty
CODE_HASH_INVALID The provided code hash invalid
CODE_INVALID The provided code is invalid (i.e. from email)
@@ -347,4 +348,4 @@ WEBDOCUMENT_URL_EMPTY The web document URL is empty
WEBDOCUMENT_URL_INVALID The web document URL is invalid
WEBPAGE_CURL_FAILED Telegram server could not fetch the provided URL
WEBPAGE_MEDIA_EMPTY The URL doesn't contain any valid media
YOU_BLOCKED_USER You blocked this user
YOU_BLOCKED_USER You blocked this user
1 id message
62 CHAT_RESTRICTED The chat is restricted and cannot be used
63 CHAT_SEND_INLINE_FORBIDDEN You cannot use inline bots to send messages in this chat
64 CHAT_TITLE_EMPTY The chat title is empty
65 CHAT_TOO_BIG The chat is too big for this action
66 CODE_EMPTY The provided code is empty
67 CODE_HASH_INVALID The provided code hash invalid
68 CODE_INVALID The provided code is invalid (i.e. from email)
348 WEBDOCUMENT_URL_INVALID The web document URL is invalid
349 WEBPAGE_CURL_FAILED Telegram server could not fetch the provided URL
350 WEBPAGE_MEDIA_EMPTY The URL doesn't contain any valid media
351 YOU_BLOCKED_USER You blocked this user

View File

@@ -2,7 +2,7 @@ id message
ACTIVE_USER_REQUIRED The method is only available to already activated users
AUTH_KEY_INVALID The key is invalid
AUTH_KEY_PERM_EMPTY The method is unavailable for temporary authorization key, not bound to permanent
AUTH_KEY_UNREGISTERED The key is not registered in the system
AUTH_KEY_UNREGISTERED The key is not registered in the system. Delete your session file and login again
SESSION_EXPIRED The authorization has expired
SESSION_PASSWORD_NEEDED The two-step verification is enabled and a password is required
SESSION_REVOKED The authorization has been invalidated, because of the user terminating all sessions
1 id message
2 ACTIVE_USER_REQUIRED The method is only available to already activated users
3 AUTH_KEY_INVALID The key is invalid
4 AUTH_KEY_PERM_EMPTY The method is unavailable for temporary authorization key, not bound to permanent
5 AUTH_KEY_UNREGISTERED The key is not registered in the system The key is not registered in the system. Delete your session file and login again
6 SESSION_EXPIRED The authorization has expired
7 SESSION_PASSWORD_NEEDED The two-step verification is enabled and a password is required
8 SESSION_REVOKED The authorization has been invalidated, because of the user terminating all sessions