mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-30 04:24:50 +00:00
Compare commits
7 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a16933aad | ||
|
|
ff305c92de | ||
|
|
ec114185c3 | ||
|
|
9ffab8b6d6 | ||
|
|
d1b41b0a3c | ||
|
|
afaf158183 | ||
|
|
8353e5a2a2 |
787 changed files with 6135 additions and 26093 deletions
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
|
|
@ -1,2 +1,3 @@
|
|||
github: Mayuri-Chan
|
||||
custom: ["https://t.me/Mayuri17_bot?start=donate"]
|
||||
ko_fi: wulan17
|
||||
custom: ["https://saweria.co/wulan17", "https://paypal.me/wulan17", "https://trakteer.id/wulan17"]
|
||||
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
|
|
@ -10,7 +10,7 @@ body:
|
|||
required: true
|
||||
- label: I have searched in the issue tracker for similar bug reports, including closed ones
|
||||
required: true
|
||||
- label: I ran `pip3 install -U git+https://github.com/Mayuri-Chan/pyrofork` and reproduced the issue using the latest development version
|
||||
- label: I ran `pip3 install -U https://github.com/Mayuri-Chan/pyrofork/archive/master.zip` and reproduced the issue using the latest development version
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
|
|
@ -37,7 +37,7 @@ body:
|
|||
label: Code example
|
||||
description: Provide a [minimal, complete, consistently reproducible](https://stackoverflow.com/help/minimal-reproducible-example) and properly formatted example involving normal usages (if applicable)
|
||||
placeholder: |
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
...
|
||||
render: python
|
||||
|
||||
|
|
|
|||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
|
|
@ -3,6 +3,6 @@ contact_links:
|
|||
- name: Ask Pyrofork related questions
|
||||
url: https://stackoverflow.com/questions/tagged/pyrofork
|
||||
about: This place is only for reporting issues about Pyrofork. You can ask questions at StackOverflow.
|
||||
- name: Join the Telegram Chat
|
||||
- name: Join the Telegram chat
|
||||
url: https://t.me/MayuriChan_Chat
|
||||
about: Join the official Chat and stay tuned for news, updates and announcements.
|
||||
about: Join the official chat and stay tuned for news, updates and announcements.
|
||||
21
.github/workflows/build-docs.yml
vendored
21
.github/workflows/build-docs.yml
vendored
|
|
@ -14,25 +14,8 @@ jobs:
|
|||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure
|
||||
run: bash build-docs.sh configure
|
||||
|
||||
- name: Cleanup
|
||||
run: bash build-docs.sh cleanup
|
||||
|
||||
- name: Create virtual environment
|
||||
run: bash build-docs.sh virtualenv
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- name: Build
|
||||
run: bash build-docs.sh build
|
||||
|
||||
- name: Clone gh-pages repository
|
||||
run: bash build-docs.sh clone
|
||||
run: bash build-docs.sh
|
||||
env:
|
||||
DOCS_KEY: ${{ secrets.DOCS_KEY }}
|
||||
|
||||
- name: Push changes
|
||||
run: bash build-docs.sh push
|
||||
|
|
|
|||
13
.github/workflows/python-publish.yml
vendored
13
.github/workflows/python-publish.yml
vendored
|
|
@ -20,14 +20,11 @@ jobs:
|
|||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
environment: release
|
||||
permissions:
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Install dependencies
|
||||
|
|
@ -37,4 +34,8 @@ jobs:
|
|||
- name: Build package
|
||||
run: hatch build
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
env:
|
||||
HATCH_INDEX_USER: __token__
|
||||
HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
|
||||
run: |
|
||||
hatch publish
|
||||
|
|
|
|||
8
.github/workflows/python.yml
vendored
8
.github/workflows/python.yml
vendored
|
|
@ -9,13 +9,13 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
|
|
@ -31,4 +31,4 @@ jobs:
|
|||
|
||||
- name: Run tests
|
||||
run: |
|
||||
tox
|
||||
tox
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
|
|
@ -6,12 +6,12 @@ main.py
|
|||
unknown_errors.txt
|
||||
.DS_Store
|
||||
|
||||
# Pyrogram generated code
|
||||
pyrogram/errors/exceptions/
|
||||
pyrogram/raw/functions/
|
||||
pyrogram/raw/types/
|
||||
pyrogram/raw/base/
|
||||
pyrogram/raw/all.py
|
||||
# Pyrofork generated code
|
||||
pyrofork/errors/exceptions/
|
||||
pyrofork/raw/functions/
|
||||
pyrofork/raw/types/
|
||||
pyrofork/raw/base/
|
||||
pyrofork/raw/all.py
|
||||
docs/source/telegram
|
||||
docs/source/api/methods/
|
||||
docs/source/api/bound-methods/
|
||||
|
|
|
|||
651
.pylintrc
651
.pylintrc
|
|
@ -1,651 +0,0 @@
|
|||
[MAIN]
|
||||
|
||||
# Analyse import fallback blocks. This can be used to support both Python 2 and
|
||||
# 3 compatible code, which means that the block might have code that exists
|
||||
# only in one or another interpreter, leading to false positives when analysed.
|
||||
analyse-fallback-blocks=no
|
||||
|
||||
# Clear in-memory caches upon conclusion of linting. Useful if running pylint
|
||||
# in a server-like mode.
|
||||
clear-cache-post-run=no
|
||||
|
||||
# Load and enable all available extensions. Use --list-extensions to see a list
|
||||
# all available extensions.
|
||||
#enable-all-extensions=
|
||||
|
||||
# In error mode, messages with a category besides ERROR or FATAL are
|
||||
# suppressed, and no reports are done by default. Error mode is compatible with
|
||||
# disabling specific errors.
|
||||
#errors-only=
|
||||
|
||||
# Always return a 0 (non-error) status code, even if lint errors are found.
|
||||
# This is primarily useful in continuous integration scripts.
|
||||
#exit-zero=
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code.
|
||||
extension-pkg-allow-list=
|
||||
|
||||
# A comma-separated list of package or module names from where C extensions may
|
||||
# be loaded. Extensions are loading into the active Python interpreter and may
|
||||
# run arbitrary code. (This is an alternative name to extension-pkg-allow-list
|
||||
# for backward compatibility.)
|
||||
extension-pkg-whitelist=
|
||||
|
||||
# Return non-zero exit code if any of these messages/categories are detected,
|
||||
# even if score is above --fail-under value. Syntax same as enable. Messages
|
||||
# specified are enabled, while categories only check already-enabled messages.
|
||||
fail-on=
|
||||
|
||||
# Specify a score threshold under which the program will exit with error.
|
||||
fail-under=10
|
||||
|
||||
# Interpret the stdin as a python script, whose filename needs to be passed as
|
||||
# the module_or_package argument.
|
||||
#from-stdin=
|
||||
|
||||
# Files or directories to be skipped. They should be base names, not paths.
|
||||
ignore=CVS
|
||||
|
||||
# Add files or directories matching the regular expressions patterns to the
|
||||
# ignore-list. The regex matches against paths and can be in Posix or Windows
|
||||
# format. Because '\\' represents the directory delimiter on Windows systems,
|
||||
# it can't be used as an escape character.
|
||||
ignore-paths=
|
||||
|
||||
# Files or directories matching the regular expression patterns are skipped.
|
||||
# The regex matches against base names, not paths. The default value ignores
|
||||
# Emacs file locks
|
||||
ignore-patterns=^\.#
|
||||
|
||||
# List of module names for which member attributes should not be checked and
|
||||
# will not be imported (useful for modules/projects where namespaces are
|
||||
# manipulated during runtime and thus existing member attributes cannot be
|
||||
# deduced by static analysis). It supports qualified module names, as well as
|
||||
# Unix pattern matching.
|
||||
ignored-modules=
|
||||
|
||||
# Python code to execute, usually for sys.path manipulation such as
|
||||
# pygtk.require().
|
||||
#init-hook=
|
||||
|
||||
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
|
||||
# number of processors available to use, and will cap the count on Windows to
|
||||
# avoid hangs.
|
||||
jobs=1
|
||||
|
||||
# Control the amount of potential inferred values when inferring a single
|
||||
# object. This can help the performance when dealing with large functions or
|
||||
# complex, nested conditions.
|
||||
limit-inference-results=100
|
||||
|
||||
# List of plugins (as comma separated values of python module names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=yes
|
||||
|
||||
# Resolve imports to .pyi stubs if available. May reduce no-member messages and
|
||||
# increase not-an-iterable messages.
|
||||
prefer-stubs=no
|
||||
|
||||
# Minimum Python version to use for version dependent checks. Will default to
|
||||
# the version used to run pylint.
|
||||
py-version=3.13
|
||||
|
||||
# Discover python modules and packages in the file system subtree.
|
||||
recursive=no
|
||||
|
||||
# Add paths to the list of the source roots. Supports globbing patterns. The
|
||||
# source root is an absolute path or a path relative to the current working
|
||||
# directory used to determine a package namespace for modules located under the
|
||||
# source root.
|
||||
source-roots=
|
||||
|
||||
# When enabled, pylint would attempt to guess common misconfiguration and emit
|
||||
# user-friendly hints instead of false-positive error messages.
|
||||
suggestion-mode=yes
|
||||
|
||||
# Allow loading of arbitrary C extensions. Extensions are imported into the
|
||||
# active Python interpreter and may run arbitrary code.
|
||||
unsafe-load-any-extension=no
|
||||
|
||||
# In verbose mode, extra non-checker-related info will be displayed.
|
||||
#verbose=
|
||||
|
||||
|
||||
[BASIC]
|
||||
|
||||
# Naming style matching correct argument names.
|
||||
argument-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct argument names. Overrides argument-
|
||||
# naming-style. If left empty, argument names will be checked with the set
|
||||
# naming style.
|
||||
#argument-rgx=
|
||||
|
||||
# Naming style matching correct attribute names.
|
||||
attr-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct attribute names. Overrides attr-naming-
|
||||
# style. If left empty, attribute names will be checked with the set naming
|
||||
# style.
|
||||
#attr-rgx=
|
||||
|
||||
# Bad variable names which should always be refused, separated by a comma.
|
||||
bad-names=foo,
|
||||
bar,
|
||||
baz,
|
||||
toto,
|
||||
tutu,
|
||||
tata
|
||||
|
||||
# Bad variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be refused
|
||||
bad-names-rgxs=
|
||||
|
||||
# Naming style matching correct class attribute names.
|
||||
class-attribute-naming-style=any
|
||||
|
||||
# Regular expression matching correct class attribute names. Overrides class-
|
||||
# attribute-naming-style. If left empty, class attribute names will be checked
|
||||
# with the set naming style.
|
||||
#class-attribute-rgx=
|
||||
|
||||
# Naming style matching correct class constant names.
|
||||
class-const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct class constant names. Overrides class-
|
||||
# const-naming-style. If left empty, class constant names will be checked with
|
||||
# the set naming style.
|
||||
#class-const-rgx=
|
||||
|
||||
# Naming style matching correct class names.
|
||||
class-naming-style=PascalCase
|
||||
|
||||
# Regular expression matching correct class names. Overrides class-naming-
|
||||
# style. If left empty, class names will be checked with the set naming style.
|
||||
#class-rgx=
|
||||
|
||||
# Naming style matching correct constant names.
|
||||
const-naming-style=UPPER_CASE
|
||||
|
||||
# Regular expression matching correct constant names. Overrides const-naming-
|
||||
# style. If left empty, constant names will be checked with the set naming
|
||||
# style.
|
||||
#const-rgx=
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=-1
|
||||
|
||||
# Naming style matching correct function names.
|
||||
function-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct function names. Overrides function-
|
||||
# naming-style. If left empty, function names will be checked with the set
|
||||
# naming style.
|
||||
#function-rgx=
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma.
|
||||
good-names=i,
|
||||
j,
|
||||
k,
|
||||
ex,
|
||||
Run,
|
||||
_
|
||||
|
||||
# Good variable names regexes, separated by a comma. If names match any regex,
|
||||
# they will always be accepted
|
||||
good-names-rgxs=
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name.
|
||||
include-naming-hint=no
|
||||
|
||||
# Naming style matching correct inline iteration names.
|
||||
inlinevar-naming-style=any
|
||||
|
||||
# Regular expression matching correct inline iteration names. Overrides
|
||||
# inlinevar-naming-style. If left empty, inline iteration names will be checked
|
||||
# with the set naming style.
|
||||
#inlinevar-rgx=
|
||||
|
||||
# Naming style matching correct method names.
|
||||
method-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct method names. Overrides method-naming-
|
||||
# style. If left empty, method names will be checked with the set naming style.
|
||||
#method-rgx=
|
||||
|
||||
# Naming style matching correct module names.
|
||||
module-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct module names. Overrides module-naming-
|
||||
# style. If left empty, module names will be checked with the set naming style.
|
||||
#module-rgx=
|
||||
|
||||
# Colon-delimited sets of names that determine each other's naming style when
|
||||
# the name regexes allow several styles.
|
||||
name-group=
|
||||
|
||||
# Regular expression which should only match function or class names that do
|
||||
# not require a docstring.
|
||||
no-docstring-rgx=^_
|
||||
|
||||
# List of decorators that produce properties, such as abc.abstractproperty. Add
|
||||
# to this list to register other decorators that produce valid properties.
|
||||
# These decorators are taken in consideration only for invalid-name.
|
||||
property-classes=abc.abstractproperty
|
||||
|
||||
# Regular expression matching correct type alias names. If left empty, type
|
||||
# alias names will be checked with the set naming style.
|
||||
#typealias-rgx=
|
||||
|
||||
# Regular expression matching correct type variable names. If left empty, type
|
||||
# variable names will be checked with the set naming style.
|
||||
#typevar-rgx=
|
||||
|
||||
# Naming style matching correct variable names.
|
||||
variable-naming-style=snake_case
|
||||
|
||||
# Regular expression matching correct variable names. Overrides variable-
|
||||
# naming-style. If left empty, variable names will be checked with the set
|
||||
# naming style.
|
||||
#variable-rgx=
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# Warn about protected attribute access inside special methods
|
||||
check-protected-access-in-special-methods=no
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,
|
||||
__new__,
|
||||
setUp,
|
||||
asyncSetUp,
|
||||
__post_init__
|
||||
|
||||
# List of member names, which should be excluded from the protected access
|
||||
# warning.
|
||||
exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=mcs
|
||||
|
||||
|
||||
[DESIGN]
|
||||
|
||||
# List of regular expressions of class ancestor names to ignore when counting
|
||||
# public methods (see R0903)
|
||||
exclude-too-few-public-methods=
|
||||
|
||||
# List of qualified class names to ignore when counting class parents (see
|
||||
# R0901)
|
||||
ignored-parents=
|
||||
|
||||
# Maximum number of arguments for function / method.
|
||||
max-args=5
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
max-attributes=7
|
||||
|
||||
# Maximum number of boolean expressions in an if statement (see R0916).
|
||||
max-bool-expr=5
|
||||
|
||||
# Maximum number of branch for function / method body.
|
||||
max-branches=12
|
||||
|
||||
# Maximum number of locals for function / method body.
|
||||
max-locals=15
|
||||
|
||||
# Maximum number of parents for a class (see R0901).
|
||||
max-parents=7
|
||||
|
||||
# Maximum number of positional arguments for function / method.
|
||||
max-positional-arguments=5
|
||||
|
||||
# Maximum number of public methods for a class (see R0904).
|
||||
max-public-methods=20
|
||||
|
||||
# Maximum number of return / yield for function / method body.
|
||||
max-returns=6
|
||||
|
||||
# Maximum number of statements in function / method body.
|
||||
max-statements=50
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=2
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when caught.
|
||||
overgeneral-exceptions=builtins.BaseException,builtins.Exception
|
||||
|
||||
|
||||
[FORMAT]
|
||||
|
||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||
expected-line-ending-format=
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
|
||||
|
||||
# Number of spaces of indent required inside a hanging or continued line.
|
||||
indent-after-paren=4
|
||||
|
||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
|
||||
# tab).
|
||||
indent-string=' '
|
||||
|
||||
# Maximum number of characters on a single line.
|
||||
max-line-length=100
|
||||
|
||||
# Maximum number of lines in a module.
|
||||
max-module-lines=1000
|
||||
|
||||
# Allow the body of a class to be on the same line as the declaration if body
|
||||
# contains single statement.
|
||||
single-line-class-stmt=no
|
||||
|
||||
# Allow the body of an if to be on the same line as the test if there is no
|
||||
# else.
|
||||
single-line-if-stmt=no
|
||||
|
||||
|
||||
[IMPORTS]
|
||||
|
||||
# List of modules that can be imported at any level, not just the top level
|
||||
# one.
|
||||
allow-any-import-level=
|
||||
|
||||
# Allow explicit reexports by alias from a package __init__.
|
||||
allow-reexport-from-package=no
|
||||
|
||||
# Allow wildcard imports from modules that define __all__.
|
||||
allow-wildcard-with-all=no
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma.
|
||||
deprecated-modules=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of external dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
ext-import-graph=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of all (i.e. internal and
|
||||
# external) dependencies to the given file (report RP0402 must not be
|
||||
# disabled).
|
||||
import-graph=
|
||||
|
||||
# Output a graph (.gv or any supported image format) of internal dependencies
|
||||
# to the given file (report RP0402 must not be disabled).
|
||||
int-import-graph=
|
||||
|
||||
# Force import order to recognize a module as part of the standard
|
||||
# compatibility libraries.
|
||||
known-standard-library=
|
||||
|
||||
# Force import order to recognize a module as part of a third party library.
|
||||
known-third-party=enchant
|
||||
|
||||
# Couples of modules and preferred modules, separated by a comma.
|
||||
preferred-modules=
|
||||
|
||||
|
||||
[LOGGING]
|
||||
|
||||
# The type of string formatting that logging methods do. `old` means using %
|
||||
# formatting, `new` is for `{}` formatting.
|
||||
logging-format-style=old
|
||||
|
||||
# Logging modules to check that the string format arguments are in logging
|
||||
# function parameter format.
|
||||
logging-modules=logging
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
|
||||
# UNDEFINED.
|
||||
confidence=HIGH,
|
||||
CONTROL_FLOW,
|
||||
INFERENCE,
|
||||
INFERENCE_FAILURE,
|
||||
UNDEFINED
|
||||
|
||||
# Disable the message, report, category or checker with the given id(s). You
|
||||
# can either give multiple identifiers separated by comma (,) or put this
|
||||
# option multiple times (only on the command line, not in the configuration
|
||||
# file where it should appear only once). You can also use "--disable=all" to
|
||||
# disable everything first and then re-enable specific checks. For example, if
|
||||
# you want to run only the similarities checker, you can use "--disable=all
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use "--disable=all --enable=classes
|
||||
# --disable=W".
|
||||
disable=raw-checker-failed,
|
||||
bad-inline-option,
|
||||
locally-disabled,
|
||||
file-ignored,
|
||||
suppressed-message,
|
||||
useless-suppression,
|
||||
deprecated-pragma,
|
||||
use-implicit-booleaness-not-comparison-to-string,
|
||||
use-implicit-booleaness-not-comparison-to-zero,
|
||||
use-symbolic-message-instead,
|
||||
missing-module-docstring,
|
||||
missing-class-docstring,
|
||||
missing-function-docstring,
|
||||
redefined-builtin
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time (only on the command line, not in the configuration file where
|
||||
# it should appear only once). See also the "--disable" option for examples.
|
||||
enable=
|
||||
|
||||
|
||||
[METHOD_ARGS]
|
||||
|
||||
# List of qualified names (i.e., library.method) which require a timeout
|
||||
# parameter e.g. 'requests.api.get,requests.api.post'
|
||||
timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,
|
||||
XXX,
|
||||
TODO
|
||||
|
||||
# Regular expression of note tags to take in consideration.
|
||||
notes-rgx=
|
||||
|
||||
|
||||
[REFACTORING]
|
||||
|
||||
# Maximum number of nested blocks for function / method body
|
||||
max-nested-blocks=5
|
||||
|
||||
# Complete name of functions that never returns. When checking for
|
||||
# inconsistent-return-statements if a never returning function is called then
|
||||
# it will be considered as an explicit return statement and no message will be
|
||||
# printed.
|
||||
never-returning-functions=sys.exit,argparse.parse_error
|
||||
|
||||
# Let 'consider-using-join' be raised when the separator to join on would be
|
||||
# non-empty (resulting in expected fixes of the type: ``"- " + " -
|
||||
# ".join(items)``)
|
||||
suggest-join-with-non-empty-separator=yes
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Python expression which should return a score less than or equal to 10. You
|
||||
# have access to the variables 'fatal', 'error', 'warning', 'refactor',
|
||||
# 'convention', and 'info' which contain the number of messages in each
|
||||
# category, as well as 'statement' which is the total number of statements
|
||||
# analyzed. This score is used by the global evaluation report (RP0004).
|
||||
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
|
||||
|
||||
# Template used to display messages. This is a python new-style format string
|
||||
# used to format the message information. See doc for all details.
|
||||
msg-template=
|
||||
|
||||
# Set the output format. Available formats are: 'text', 'parseable',
|
||||
# 'colorized', 'json2' (improved json format), 'json' (old json format), msvs
|
||||
# (visual studio) and 'github' (GitHub actions). You can also give a reporter
|
||||
# class, e.g. mypackage.mymodule.MyReporterClass.
|
||||
#output-format=
|
||||
|
||||
# Tells whether to display a full report or only the messages.
|
||||
reports=no
|
||||
|
||||
# Activate the evaluation score.
|
||||
score=yes
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Comments are removed from the similarity computation
|
||||
ignore-comments=yes
|
||||
|
||||
# Docstrings are removed from the similarity computation
|
||||
ignore-docstrings=yes
|
||||
|
||||
# Imports are removed from the similarity computation
|
||||
ignore-imports=yes
|
||||
|
||||
# Signatures are removed from the similarity computation
|
||||
ignore-signatures=yes
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
|
||||
[SPELLING]
|
||||
|
||||
# Limits count of emitted suggestions for spelling mistakes.
|
||||
max-spelling-suggestions=4
|
||||
|
||||
# Spelling dictionary name. No available dictionaries : You need to install
|
||||
# both the python package and the system dependency for enchant to work.
|
||||
spelling-dict=
|
||||
|
||||
# List of comma separated words that should be considered directives if they
|
||||
# appear at the beginning of a comment and should not be checked.
|
||||
spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
|
||||
|
||||
# List of comma separated words that should not be checked.
|
||||
spelling-ignore-words=
|
||||
|
||||
# A path to a file that contains the private dictionary; one word per line.
|
||||
spelling-private-dict-file=
|
||||
|
||||
# Tells whether to store unknown words to the private dictionary (see the
|
||||
# --spelling-private-dict-file option) instead of raising a message.
|
||||
spelling-store-unknown-words=no
|
||||
|
||||
|
||||
[STRING]
|
||||
|
||||
# This flag controls whether inconsistent-quotes generates a warning when the
|
||||
# character used as a quote delimiter is used inconsistently within a module.
|
||||
check-quote-consistency=no
|
||||
|
||||
# This flag controls whether the implicit-str-concat should generate a warning
|
||||
# on implicit string concatenation in sequences defined over several lines.
|
||||
check-str-concat-over-line-jumps=no
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# List of decorators that produce context managers, such as
|
||||
# contextlib.contextmanager. Add to this list to register other decorators that
|
||||
# produce valid context managers.
|
||||
contextmanager-decorators=contextlib.contextmanager
|
||||
|
||||
# List of members which are set dynamically and missed by pylint inference
|
||||
# system, and so shouldn't trigger E1101 when accessed. Python regular
|
||||
# expressions are accepted.
|
||||
generated-members=
|
||||
|
||||
# Tells whether to warn about missing members when the owner of the attribute
|
||||
# is inferred to be None.
|
||||
ignore-none=yes
|
||||
|
||||
# This flag controls whether pylint should warn about no-member and similar
|
||||
# checks whenever an opaque object is returned when inferring. The inference
|
||||
# can return multiple potential results while evaluating a Python object, but
|
||||
# some branches might not be evaluated, which results in partial inference. In
|
||||
# that case, it might be useful to still emit no-member and other checks for
|
||||
# the rest of the inferred objects.
|
||||
ignore-on-opaque-inference=yes
|
||||
|
||||
# List of symbolic message names to ignore for Mixin members.
|
||||
ignored-checks-for-mixins=no-member,
|
||||
not-async-context-manager,
|
||||
not-context-manager,
|
||||
attribute-defined-outside-init
|
||||
|
||||
# List of class names for which member attributes should not be checked (useful
|
||||
# for classes with dynamically set attributes). This supports the use of
|
||||
# qualified names.
|
||||
ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
|
||||
|
||||
# Show a hint with possible names when a member name was not found. The aspect
|
||||
# of finding the hint is based on edit distance.
|
||||
missing-member-hint=yes
|
||||
|
||||
# The minimum edit distance a name should have in order to be considered a
|
||||
# similar match for a missing member name.
|
||||
missing-member-hint-distance=1
|
||||
|
||||
# The total number of similar names that should be taken in consideration when
|
||||
# showing a hint for a missing member.
|
||||
missing-member-max-choices=1
|
||||
|
||||
# Regex pattern to define which classes are considered mixins.
|
||||
mixin-class-rgx=.*[Mm]ixin
|
||||
|
||||
# List of decorators that change the signature of a decorated function.
|
||||
signature-mutators=
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid defining new builtins when possible.
|
||||
additional-builtins=
|
||||
|
||||
# Tells whether unused global variables should be treated as a violation.
|
||||
allow-global-unused-variables=yes
|
||||
|
||||
# List of names allowed to shadow builtins
|
||||
allowed-redefined-builtins=
|
||||
|
||||
# List of strings which can identify a callback function by name. A callback
|
||||
# name must start or end with one of those strings.
|
||||
callbacks=cb_,
|
||||
_cb
|
||||
|
||||
# A regular expression matching the name of dummy variables (i.e. expected to
|
||||
# not be used).
|
||||
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
|
||||
|
||||
# Argument names that match this expression will be ignored.
|
||||
ignored-argument-names=_.*|^ignored_|^unused_
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# List of qualified module names which can have objects that can redefine
|
||||
# builtins.
|
||||
redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
|
||||
10
MANIFEST.in
10
MANIFEST.in
|
|
@ -4,8 +4,8 @@ recursive-include compiler *.py *.tl *.tsv *.txt
|
|||
recursive-include tests *.py
|
||||
|
||||
## Exclude
|
||||
prune pyrogram/errors/exceptions
|
||||
prune pyrogram/raw/functions
|
||||
prune pyrogram/raw/types
|
||||
prune pyrogram/raw/base
|
||||
exclude pyrogram/raw/all.py
|
||||
prune pyrofork/errors/exceptions
|
||||
prune pyrofork/raw/functions
|
||||
prune pyrofork/raw/types
|
||||
prune pyrofork/raw/base
|
||||
exclude pyrofork/raw/all.py
|
||||
|
|
|
|||
4
Makefile
4
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
VENV := venv
|
||||
PYTHON := $(VENV)/bin/python
|
||||
HOST = $(shell ifconfig | grep "inet " | tail -1 | cut -d\ -f2)
|
||||
TAG = v$(shell grep -E '__version__ = ".*"' pyrogram/__init__.py | cut -d\" -f2)
|
||||
TAG = v$(shell grep -E '__version__ = ".*"' pyrofork/__init__.py | cut -d\" -f2)
|
||||
|
||||
RM := rm -rf
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ clean-build:
|
|||
$(RM) *.egg-info build dist
|
||||
|
||||
clean-api:
|
||||
$(RM) pyrogram/errors/exceptions pyrogram/raw/all.py pyrogram/raw/base pyrogram/raw/functions pyrogram/raw/types
|
||||
$(RM) pyrofork/errors/exceptions pyrofork/raw/all.py pyrofork/raw/base pyrofork/raw/functions pyrofork/raw/types
|
||||
|
||||
clean:
|
||||
make clean-build
|
||||
|
|
|
|||
15
README.md
15
README.md
|
|
@ -1,7 +1,4 @@
|
|||
<p align="center">
|
||||
<a href="https://github.com/Mayuri-Chan/pyrofok">
|
||||
<img src="https://docs.pyrogram.org/_static/pyrogram.png" alt="Pyrofork" width="128">
|
||||
</a>
|
||||
<br>
|
||||
<b>Telegram MTProto API Framework for Python</b>
|
||||
<br>
|
||||
|
|
@ -9,7 +6,7 @@
|
|||
Homepage
|
||||
</a>
|
||||
•
|
||||
<a href="https://pyrofork.wulan17.dev">
|
||||
<a href="https://pyrofork.mayuri.my.id">
|
||||
Documentation
|
||||
</a>
|
||||
•
|
||||
|
|
@ -21,7 +18,7 @@
|
|||
Support Chat
|
||||
</a>
|
||||
•
|
||||
<a href="https://t.me/Pyrofork_CH">
|
||||
<a href="https://t.me/wulan17">
|
||||
News/Releases
|
||||
</a>
|
||||
</p>
|
||||
|
|
@ -31,7 +28,7 @@
|
|||
> Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
|
||||
|
||||
``` python
|
||||
from pyrogram import Client, filters
|
||||
from pyrofork import Client, filters
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -44,7 +41,7 @@ async def hello(client, message):
|
|||
app.run()
|
||||
```
|
||||
|
||||
**Pyrofork** is a modern, elegant and asynchronous [MTProto API](https://pyrofork.wulan17.dev/main/topics/mtproto-vs-botapi)
|
||||
**Pyrofork** is a modern, elegant and asynchronous [MTProto API](https://pyrofork.mayuri.my.id/topics/mtproto-vs-botapi)
|
||||
framework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot
|
||||
identity (bot API alternative) using Python.
|
||||
|
||||
|
|
@ -59,7 +56,7 @@ If you'd like to support Pyrofork, you can consider:
|
|||
- **Ready**: Install Pyrofork with pip and start building your applications right away.
|
||||
- **Easy**: Makes the Telegram API simple and intuitive, while still allowing advanced usages.
|
||||
- **Elegant**: Low-level details are abstracted and re-presented in a more convenient way.
|
||||
- **Fast**: Boosted up by [TgCrypto](https://github.com/pyrogram/tgcrypto), a high-performance cryptography library written in C.
|
||||
- **Fast**: Boosted up by [TgCrypto](https://github.com/pyrogram/tgcrypto), a high-performance cryptography library written in C.
|
||||
- **Type-hinted**: Types and methods are all type-hinted, enabling excellent editor support.
|
||||
- **Async**: Fully asynchronous (also usable synchronously if wanted, for convenience).
|
||||
- **Powerful**: Full access to Telegram's API to execute any official client action and more.
|
||||
|
|
@ -72,6 +69,6 @@ pip3 install pyrofork
|
|||
|
||||
### Resources
|
||||
|
||||
- Check out the docs at https://pyrofork.wulan17.dev to learn more about Pyrofork, get started right
|
||||
- Check out the docs at https://pyrofork.mayuri.my.id to learn more about Pyrofork, get started right
|
||||
away and discover more in-depth material for building your client applications.
|
||||
- Join the official group at https://t.me/MayuriChan_Chat and stay tuned for news, updates and announcements.
|
||||
|
|
|
|||
115
build-docs.sh
115
build-docs.sh
|
|
@ -1,87 +1,42 @@
|
|||
#!/bin/bash
|
||||
export DOCS_KEY
|
||||
VENV="$(pwd)"/venv
|
||||
export VENV
|
||||
|
||||
# Check if config.sh exists
|
||||
if [ -f config.sh ]; then
|
||||
source config.sh
|
||||
fi
|
||||
|
||||
function parse_parameters() {
|
||||
while (($#)); do
|
||||
case $1 in
|
||||
all | configure | cleanup | virtualenv | build | clone | push ) action=$1 ;;
|
||||
*) exit 33 ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
function do_configure() {
|
||||
echo "#!/bin/bash" > config.sh
|
||||
echo "export VENV=\"$(pwd)/venv\"" >> config.sh
|
||||
|
||||
if [[ "$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")" == "refs/tags" ]]; then
|
||||
echo "export BRANCH=\"main\"" >> config.sh
|
||||
elif [[ "$GITHUB_REF" == "refs/heads/staging" ]]; then
|
||||
echo "export BRANCH=\"staging\"" >> config.sh
|
||||
else
|
||||
b="$(echo "$GITHUB_REF" | cut -d '/' -f '3 4')"
|
||||
if [[ $(echo "$b" | cut -d '/' -f 1 ) == "dev" ]]; then
|
||||
b="$(echo "$b" | cut -d '/' -f 2)"
|
||||
if [[ "$b" =~ ^[0-9]\.[0-9]\.x ]]; then
|
||||
echo "export BRANCH=\"$b\"" >> config.sh
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
if [[ "$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")" == "refs/tags" ]]; then
|
||||
branch="main"
|
||||
elif [[ "$GITHUB_REF" == "refs/heads/staging" ]]; then
|
||||
branch="staging"
|
||||
else
|
||||
b="$(echo "$GITHUB_REF" | cut -d '/' -f '3 4')"
|
||||
if [[ $(echo "$b" | cut -d '/' -f 1 ) == "dev" ]]; then
|
||||
b="$(echo "$b" | cut -d '/' -f 2)"
|
||||
if [[ "$b" =~ ^[0-9]\.[0-9]\.x ]]; then
|
||||
branch="$b"
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
chmod +x config.sh
|
||||
}
|
||||
fi
|
||||
|
||||
function do_cleanup() {
|
||||
make clean
|
||||
make clean-docs
|
||||
}
|
||||
|
||||
function do_virtualenv() {
|
||||
make venv
|
||||
make api
|
||||
"$VENV"/bin/pip install -e '.[docs]'
|
||||
}
|
||||
|
||||
function do_build() {
|
||||
cd compiler/docs || exit 1 && "$VENV"/bin/python compiler.py
|
||||
cd ../.. || exit 1
|
||||
"$VENV"/bin/sphinx-build -b html "docs/source" "docs/build/html" -j auto
|
||||
}
|
||||
|
||||
function do_clone() {
|
||||
git clone https://wulan17:"$DOCS_KEY"@github.com/Mayuri-Chan/pyrofork-docs.git
|
||||
}
|
||||
|
||||
function do_push() {
|
||||
cd pyrofork-docs || exit 1
|
||||
mkdir -p "$BRANCH"
|
||||
cd "$BRANCH" || exit 1
|
||||
rm -rf _includes api genindex.html intro py-modindex.html sitemap.xml support.html topics _static faq index.html objects.inv searchindex.js start telegram
|
||||
cp -r ../../docs/build/html/* .
|
||||
git config --local user.name "Mayuri-Chan"
|
||||
git config --local user.email "mayuri@mayuri.my.id"
|
||||
git add --all
|
||||
git commit -a -m "docs: $BRANCH: Update docs $(date '+%Y-%m-%d | %H:%m:%S %p %Z')" --signoff
|
||||
git push -u origin --all
|
||||
}
|
||||
|
||||
function do_all() {
|
||||
do_configure
|
||||
source config.sh
|
||||
do_cleanup
|
||||
do_virtualenv
|
||||
do_build
|
||||
do_clone
|
||||
do_push
|
||||
}
|
||||
|
||||
parse_parameters "$@"
|
||||
do_"${action:=all}"
|
||||
make clean
|
||||
make clean-docs
|
||||
make venv
|
||||
make api
|
||||
"$VENV"/bin/pip install -e '.[docs]'
|
||||
cd compiler/docs || exit 1 && "$VENV"/bin/python compiler.py
|
||||
cd ../.. || exit 1
|
||||
"$VENV"/bin/sphinx-build -b html "docs/source" "docs/build/html" -j auto
|
||||
git clone https://wulan17:"$DOCS_KEY"@github.com/Mayuri-Chan/pyrofork-docs.git
|
||||
cd pyrofork-docs || exit 1
|
||||
mkdir -p "$branch"
|
||||
cd "$branch" || exit 1
|
||||
rm -rf _includes api genindex.html intro py-modindex.html sitemap.xml support.html topics _static faq index.html objects.inv searchindex.js start telegram
|
||||
cp -r ../../docs/build/html/* .
|
||||
git config --local user.name "Mayuri-Chan"
|
||||
git config --local user.email "mayuri@mayuri.my.id"
|
||||
git add --all
|
||||
git commit -a -m "docs: $branch: Update docs $(date '+%Y-%m-%d | %H:%m:%S %p %Z')" --signoff
|
||||
git push -u origin --all
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ from typing import NamedTuple, List, Tuple
|
|||
# from black import format_str, FileMode
|
||||
|
||||
HOME_PATH = Path("compiler/api")
|
||||
DESTINATION_PATH = Path("pyrogram/raw")
|
||||
DESTINATION_PATH = Path("pyrofork/raw")
|
||||
NOTICE_PATH = "NOTICE"
|
||||
|
||||
SECTION_RE = re.compile(r"---(\w+)---")
|
||||
|
|
@ -130,7 +130,7 @@ def get_type_hint(type: str) -> str:
|
|||
return f"Optional[{type}] = None" if is_flag else type
|
||||
else:
|
||||
ns, name = type.split(".") if "." in type else ("", type)
|
||||
type = '"raw.base.' + ".".join([ns, name]).strip(".") + '"'
|
||||
type = f'"raw.base.' + ".".join([ns, name]).strip(".") + '"'
|
||||
|
||||
return f'{type}{" = None" if is_flag else ""}'
|
||||
|
||||
|
|
@ -177,13 +177,13 @@ def get_docstring_arg_type(t: str):
|
|||
else:
|
||||
return f"``{t.lower()}``"
|
||||
elif t == "TLObject" or t == "X":
|
||||
return "Any object from :obj:`~pyrogram.raw.types`"
|
||||
return "Any object from :obj:`~pyrofork.raw.types`"
|
||||
elif t == "!X":
|
||||
return "Any function from :obj:`~pyrogram.raw.functions`"
|
||||
return "Any function from :obj:`~pyrofork.raw.functions`"
|
||||
elif t.lower().startswith("vector"):
|
||||
return "List of " + get_docstring_arg_type(t.split("<", 1)[1][:-1])
|
||||
else:
|
||||
return f":obj:`{t} <pyrogram.raw.base.{t}>`"
|
||||
return f":obj:`{t} <pyrofork.raw.base.{t}>`"
|
||||
|
||||
|
||||
def get_references(t: str, kind: str):
|
||||
|
|
@ -340,7 +340,7 @@ def start(format: bool = False):
|
|||
|
||||
docstring += f"\n\n Constructors:\n" \
|
||||
f" This base type has {constr_count} constructor{'s' if constr_count > 1 else ''} available.\n\n" \
|
||||
f" .. currentmodule:: pyrogram.raw.types\n\n" \
|
||||
f" .. currentmodule:: pyrofork.raw.types\n\n" \
|
||||
f" .. autosummary::\n" \
|
||||
f" :nosignatures:\n\n" \
|
||||
f" {items}"
|
||||
|
|
@ -350,7 +350,7 @@ def start(format: bool = False):
|
|||
if references:
|
||||
docstring += f"\n\n Functions:\n This object can be returned by " \
|
||||
f"{ref_count} function{'s' if ref_count > 1 else ''}.\n\n" \
|
||||
f" .. currentmodule:: pyrogram.raw.functions\n\n" \
|
||||
f" .. currentmodule:: pyrofork.raw.functions\n\n" \
|
||||
f" .. autosummary::\n" \
|
||||
f" :nosignatures:\n\n" \
|
||||
f" " + references
|
||||
|
|
@ -423,18 +423,18 @@ def start(format: bool = False):
|
|||
constructor_docs = "Telegram API type."
|
||||
|
||||
docstring += constructor_docs + "\n"
|
||||
docstring += f"\n Constructor of :obj:`~pyrogram.raw.base.{c.qualtype}`."
|
||||
docstring += f"\n Constructor of :obj:`~pyrofork.raw.base.{c.qualtype}`."
|
||||
else:
|
||||
function_docs = docs["method"].get(c.qualname, None)
|
||||
|
||||
if function_docs:
|
||||
docstring += function_docs["desc"] + "\n"
|
||||
else:
|
||||
docstring += "Telegram API function."
|
||||
docstring += f"Telegram API function."
|
||||
|
||||
docstring += f"\n\n Details:\n - Layer: ``{layer}``\n - ID: ``{c.id[2:].upper()}``\n\n"
|
||||
docstring += " Parameters:\n " + \
|
||||
("\n ".join(docstring_args) if docstring_args else "No parameters required.\n")
|
||||
docstring += f" Parameters:\n " + \
|
||||
(f"\n ".join(docstring_args) if docstring_args else "No parameters required.\n")
|
||||
|
||||
if c.section == "functions":
|
||||
docstring += "\n Returns:\n " + get_docstring_arg_type(c.qualtype)
|
||||
|
|
@ -442,12 +442,12 @@ def start(format: bool = False):
|
|||
references, count = get_references(c.qualname, "constructors")
|
||||
|
||||
if references:
|
||||
docstring += "\n Functions:\n This object can be returned by " \
|
||||
docstring += f"\n Functions:\n This object can be returned by " \
|
||||
f"{count} function{'s' if count > 1 else ''}.\n\n" \
|
||||
" .. currentmodule:: pyrogram.raw.functions\n\n" \
|
||||
" .. autosummary::\n" \
|
||||
" :nosignatures:\n\n" \
|
||||
" " + references
|
||||
f" .. currentmodule:: pyrofork.raw.functions\n\n" \
|
||||
f" .. autosummary::\n" \
|
||||
f" :nosignatures:\n\n" \
|
||||
f" " + references
|
||||
|
||||
write_types = read_types = "" if c.has_flags else "# No flags\n "
|
||||
|
||||
|
|
@ -634,23 +634,23 @@ def start(format: bool = False):
|
|||
f.write("objects = {")
|
||||
|
||||
for c in combinators:
|
||||
f.write(f'\n {c.id}: "pyrogram.raw.{c.section}.{c.qualname}",')
|
||||
f.write(f'\n {c.id}: "pyrofork.raw.{c.section}.{c.qualname}",')
|
||||
|
||||
f.write('\n 0xbc799737: "pyrogram.raw.core.BoolFalse",')
|
||||
f.write('\n 0x997275b5: "pyrogram.raw.core.BoolTrue",')
|
||||
f.write('\n 0x1cb5c415: "pyrogram.raw.core.Vector",')
|
||||
f.write('\n 0x73f1f8dc: "pyrogram.raw.core.MsgContainer",')
|
||||
f.write('\n 0xae500895: "pyrogram.raw.core.FutureSalts",')
|
||||
f.write('\n 0x0949d9dc: "pyrogram.raw.core.FutureSalt",')
|
||||
f.write('\n 0x3072cfa1: "pyrogram.raw.core.GzipPacked",')
|
||||
f.write('\n 0x5bb8e511: "pyrogram.raw.core.Message",')
|
||||
f.write('\n 0xbc799737: "pyrofork.raw.core.BoolFalse",')
|
||||
f.write('\n 0x997275b5: "pyrofork.raw.core.BoolTrue",')
|
||||
f.write('\n 0x1cb5c415: "pyrofork.raw.core.Vector",')
|
||||
f.write('\n 0x73f1f8dc: "pyrofork.raw.core.MsgContainer",')
|
||||
f.write('\n 0xae500895: "pyrofork.raw.core.FutureSalts",')
|
||||
f.write('\n 0x0949d9dc: "pyrofork.raw.core.FutureSalt",')
|
||||
f.write('\n 0x3072cfa1: "pyrofork.raw.core.GzipPacked",')
|
||||
f.write('\n 0x5bb8e511: "pyrofork.raw.core.Message",')
|
||||
|
||||
f.write("\n}\n")
|
||||
|
||||
|
||||
if "__main__" == __name__:
|
||||
HOME_PATH = Path(".")
|
||||
DESTINATION_PATH = Path("../../pyrogram/raw")
|
||||
DESTINATION_PATH = Path("../../pyrofork/raw")
|
||||
NOTICE_PATH = Path("../../NOTICE")
|
||||
|
||||
start(format=False)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
from io import BytesIO
|
||||
|
||||
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
|
||||
from pyrogram.raw.core import TLObject
|
||||
from pyrogram import raw
|
||||
from pyrofork.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
|
||||
from pyrofork.raw.core import TLObject
|
||||
from pyrofork import raw
|
||||
from typing import List, Optional, Any
|
||||
|
||||
{warning}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
{warning}
|
||||
|
||||
from typing import Union
|
||||
from pyrogram import raw
|
||||
from pyrogram.raw.core import TLObject
|
||||
from pyrofork import raw
|
||||
from pyrofork.raw.core import TLObject
|
||||
|
||||
{name} = Union[{types}]
|
||||
|
||||
|
|
@ -14,10 +14,10 @@ class {name}: # type: ignore
|
|||
"""{docstring}
|
||||
"""
|
||||
|
||||
QUALNAME = "pyrogram.raw.base.{qualname}"
|
||||
QUALNAME = "pyrofork.raw.base.{qualname}"
|
||||
|
||||
def __init__(self):
|
||||
raise TypeError("Base types can only be used for type checking purposes: "
|
||||
"you tried to use a base type instance as argument, "
|
||||
"but you need to instantiate one of its constructors instead. "
|
||||
"More info: https://pyrofork.wulan17.dev/telegram/base/{doc_name}")
|
||||
"More info: https://pyrofork.mayuri.my.id/telegram/base/{doc_name}")
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ HOME = "compiler/docs"
|
|||
DESTINATION = "docs/source/telegram"
|
||||
PYROGRAM_API_DEST = "docs/source/api"
|
||||
|
||||
FUNCTIONS_PATH = "pyrogram/raw/functions"
|
||||
TYPES_PATH = "pyrogram/raw/types"
|
||||
BASE_PATH = "pyrogram/raw/base"
|
||||
FUNCTIONS_PATH = "pyrofork/raw/functions"
|
||||
TYPES_PATH = "pyrofork/raw/types"
|
||||
BASE_PATH = "pyrofork/raw/base"
|
||||
|
||||
FUNCTIONS_BASE = "functions"
|
||||
TYPES_BASE = "types"
|
||||
|
|
@ -79,7 +79,7 @@ def generate(source_path, base):
|
|||
page_template.format(
|
||||
title=full_name,
|
||||
title_markup="=" * len(full_name),
|
||||
full_class_path="pyrogram.raw.{}".format(
|
||||
full_class_path="pyrofork.raw.{}".format(
|
||||
".".join(full_path.split("/")[:-1]) + "." + name
|
||||
)
|
||||
)
|
||||
|
|
@ -101,14 +101,14 @@ def generate(source_path, base):
|
|||
|
||||
if k != base:
|
||||
inner_path = base + "/" + k + "/index" + ".rst"
|
||||
module = "pyrogram.raw.{}.{}".format(base, k)
|
||||
module = "pyrofork.raw.{}.{}".format(base, k)
|
||||
else:
|
||||
for i in sorted(list(all_entities), reverse=True):
|
||||
if i != base:
|
||||
entities.insert(0, "{0}/index".format(i))
|
||||
|
||||
inner_path = base + "/index" + ".rst"
|
||||
module = "pyrogram.raw.{}".format(base)
|
||||
module = "pyrofork.raw.{}".format(base)
|
||||
|
||||
with open(DESTINATION + "/" + inner_path, "w", encoding="utf-8") as f:
|
||||
if k == base:
|
||||
|
|
@ -127,7 +127,7 @@ def generate(source_path, base):
|
|||
f.write("\n")
|
||||
|
||||
|
||||
def pyrogram_api():
|
||||
def pyrofork_api():
|
||||
def get_title_list(s: str) -> list:
|
||||
return [i.strip() for i in [j.strip() for j in s.split("\n") if j] if i]
|
||||
|
||||
|
|
@ -146,7 +146,6 @@ def pyrogram_api():
|
|||
stop_transmission
|
||||
export_session_string
|
||||
set_parse_mode
|
||||
ping
|
||||
""",
|
||||
conversation="""
|
||||
Conversation
|
||||
|
|
@ -165,9 +164,7 @@ def pyrogram_api():
|
|||
""",
|
||||
messages="""
|
||||
Messages
|
||||
add_task_to_todo
|
||||
send_message
|
||||
forward_media_group
|
||||
forward_messages
|
||||
copy_message
|
||||
copy_media_group
|
||||
|
|
@ -175,7 +172,6 @@ def pyrogram_api():
|
|||
send_audio
|
||||
send_document
|
||||
send_sticker
|
||||
send_todo
|
||||
send_video
|
||||
send_animation
|
||||
send_voice
|
||||
|
|
@ -187,7 +183,6 @@ def pyrogram_api():
|
|||
send_contact
|
||||
send_cached_media
|
||||
send_reaction
|
||||
set_todo_tasks_completion
|
||||
edit_message_text
|
||||
edit_message_caption
|
||||
edit_message_media
|
||||
|
|
@ -198,11 +193,7 @@ def pyrogram_api():
|
|||
edit_inline_reply_markup
|
||||
send_chat_action
|
||||
delete_messages
|
||||
delete_scheduled_messages
|
||||
get_available_effects
|
||||
get_messages
|
||||
get_message_read_participants
|
||||
get_scheduled_messages
|
||||
get_media_group
|
||||
get_chat_history
|
||||
get_chat_history_count
|
||||
|
|
@ -216,18 +207,12 @@ def pyrogram_api():
|
|||
search_messages_count
|
||||
search_global
|
||||
search_global_count
|
||||
search_global_hashtag_messages
|
||||
search_global_hashtag_messages_count
|
||||
download_media
|
||||
stream_media
|
||||
get_discussion_message
|
||||
get_discussion_replies
|
||||
get_discussion_replies_count
|
||||
get_custom_emoji_stickers
|
||||
transcribe_audio
|
||||
translate_message_text
|
||||
start_bot
|
||||
delete_chat_history
|
||||
""",
|
||||
chats="""
|
||||
Chats
|
||||
|
|
@ -240,9 +225,6 @@ def pyrogram_api():
|
|||
set_administrator_title
|
||||
set_chat_photo
|
||||
delete_chat_photo
|
||||
delete_folder
|
||||
export_folder_link
|
||||
update_folder
|
||||
set_chat_title
|
||||
set_chat_description
|
||||
set_chat_permissions
|
||||
|
|
@ -255,11 +237,10 @@ def pyrogram_api():
|
|||
get_chat_members_count
|
||||
get_dialogs
|
||||
get_dialogs_count
|
||||
get_folders
|
||||
get_forum_topics
|
||||
get_forum_topics_by_id
|
||||
get_forum_topics_count
|
||||
set_chat_username
|
||||
get_nearby_chats
|
||||
archive_chats
|
||||
unarchive_chats
|
||||
add_chat_members
|
||||
|
|
@ -285,10 +266,7 @@ def pyrogram_api():
|
|||
hide_general_topic
|
||||
reopen_forum_topic
|
||||
reopen_general_topic
|
||||
transfer_chat_ownership
|
||||
unhide_general_topic
|
||||
update_color
|
||||
update_folder
|
||||
""",
|
||||
users="""
|
||||
Users
|
||||
|
|
@ -299,8 +277,6 @@ def pyrogram_api():
|
|||
set_profile_photo
|
||||
delete_profile_photos
|
||||
set_username
|
||||
update_birthday
|
||||
update_personal_chat
|
||||
update_profile
|
||||
block_user
|
||||
unblock_user
|
||||
|
|
@ -354,39 +330,6 @@ def pyrogram_api():
|
|||
get_contacts
|
||||
get_contacts_count
|
||||
""",
|
||||
payments="""
|
||||
Payments
|
||||
apply_gift_code
|
||||
check_gift_code
|
||||
convert_gift
|
||||
create_invoice_link
|
||||
get_payment_form
|
||||
get_stars_transactions
|
||||
get_stars_transactions_by_id
|
||||
get_available_gifts
|
||||
get_upgraded_gift
|
||||
get_chat_gifts_count
|
||||
get_chat_gifts
|
||||
hide_gift
|
||||
refund_star_payment
|
||||
search_gifts_for_resale
|
||||
send_invoice
|
||||
send_paid_media
|
||||
send_paid_reaction
|
||||
send_payment_form
|
||||
send_gift
|
||||
send_resold_gift
|
||||
set_gift_resale_price
|
||||
set_pinned_gifts
|
||||
show_gift
|
||||
transfer_gift
|
||||
upgrade_gift
|
||||
get_stars_balance
|
||||
""",
|
||||
phone="""
|
||||
Phone
|
||||
get_call_members
|
||||
""",
|
||||
password="""
|
||||
Password
|
||||
enable_cloud_password
|
||||
|
|
@ -413,19 +356,6 @@ def pyrogram_api():
|
|||
answer_web_app_query
|
||||
get_bot_info
|
||||
set_bot_info
|
||||
get_collectible_item_info
|
||||
get_owned_bots
|
||||
get_similar_bots
|
||||
""",
|
||||
business="""
|
||||
Telegram Business
|
||||
answer_pre_checkout_query
|
||||
answer_shipping_query
|
||||
delete_business_messages
|
||||
get_business_connection
|
||||
get_business_account_gifts
|
||||
get_business_account_star_balance
|
||||
transfer_business_account_stars
|
||||
""",
|
||||
authorization="""
|
||||
Authorization
|
||||
|
|
@ -437,13 +367,13 @@ def pyrogram_api():
|
|||
resend_code
|
||||
sign_in
|
||||
sign_in_bot
|
||||
sign_in_qrcode
|
||||
sign_up
|
||||
get_password_hint
|
||||
check_password
|
||||
send_recovery_code
|
||||
recover_password
|
||||
accept_terms_of_service
|
||||
log_out
|
||||
get_active_sessions
|
||||
""",
|
||||
advanced="""
|
||||
Advanced
|
||||
|
|
@ -465,7 +395,7 @@ def pyrogram_api():
|
|||
fmt_keys = {}
|
||||
|
||||
for k, v in categories.items():
|
||||
_, *methods = get_title_list(v)
|
||||
name, *methods = get_title_list(v)
|
||||
fmt_keys.update({k: "\n ".join("{0} <{0}>".format(m) for m in methods)})
|
||||
|
||||
for method in methods:
|
||||
|
|
@ -473,7 +403,7 @@ def pyrogram_api():
|
|||
title = "{}()".format(method)
|
||||
|
||||
f2.write(title + "\n" + "=" * len(title) + "\n\n")
|
||||
f2.write(".. automethod:: pyrogram.Client.{}()".format(method))
|
||||
f2.write(".. automethod:: pyrofork.Client.{}()".format(method))
|
||||
|
||||
functions = ["idle", "compose"]
|
||||
|
||||
|
|
@ -482,7 +412,7 @@ def pyrogram_api():
|
|||
title = "{}()".format(func)
|
||||
|
||||
f2.write(title + "\n" + "=" * len(title) + "\n\n")
|
||||
f2.write(".. autofunction:: pyrogram.{}()".format(func))
|
||||
f2.write(".. autofunction:: pyrofork.{}()".format(func))
|
||||
|
||||
f.write(template.format(**fmt_keys))
|
||||
|
||||
|
|
@ -491,15 +421,7 @@ def pyrogram_api():
|
|||
categories = dict(
|
||||
users_chats="""
|
||||
Users & Chats
|
||||
Birthday
|
||||
BusinessInfo
|
||||
BusinessMessage
|
||||
BusinessRecipients
|
||||
BusinessSchedule
|
||||
BusinessWeeklyOpen
|
||||
BusinessWorkingHours
|
||||
User
|
||||
Username
|
||||
Chat
|
||||
ChatPreview
|
||||
ChatPhoto
|
||||
|
|
@ -515,41 +437,22 @@ def pyrogram_api():
|
|||
ChatJoinedByRequest
|
||||
ChatJoiner
|
||||
Dialog
|
||||
Folder
|
||||
Restriction
|
||||
EmojiStatus
|
||||
ExportedFolderLink
|
||||
ForumTopic
|
||||
PeerUser
|
||||
PeerChannel
|
||||
BotInfo
|
||||
GroupCallMember
|
||||
ChatColor
|
||||
CollectibleItemInfo
|
||||
BotVerification
|
||||
""",
|
||||
messages_media="""
|
||||
Messages & Media
|
||||
Message
|
||||
MessageEntity
|
||||
MessageOriginChannel
|
||||
MessageOriginChat
|
||||
MessageOriginHiddenUser
|
||||
MessageOriginImport
|
||||
MessageOriginUser
|
||||
MessageOrigin
|
||||
Photo
|
||||
Thumbnail
|
||||
TodoList
|
||||
TodoTask
|
||||
TodoTasksAdded
|
||||
TodoTasksCompleted
|
||||
TodoTasksIncompleted
|
||||
Audio
|
||||
AvailableEffect
|
||||
Document
|
||||
ExternalReplyInfo
|
||||
AlternativeVideo
|
||||
Animation
|
||||
Video
|
||||
Voice
|
||||
|
|
@ -560,8 +463,6 @@ def pyrogram_api():
|
|||
Sticker
|
||||
StickerSet
|
||||
Game
|
||||
Gift
|
||||
GiftAttribute
|
||||
Giveaway
|
||||
GiveawayLaunched
|
||||
GiveawayResult
|
||||
|
|
@ -569,9 +470,6 @@ def pyrogram_api():
|
|||
WebPage
|
||||
WebPageEmpty
|
||||
WebPagePreview
|
||||
TranscribedAudio
|
||||
TranslatedText
|
||||
TextQuote
|
||||
Poll
|
||||
PollOption
|
||||
Dice
|
||||
|
|
@ -582,26 +480,18 @@ def pyrogram_api():
|
|||
VideoChatMembersInvited
|
||||
WebAppData
|
||||
MessageReactions
|
||||
MessageReactor
|
||||
ChatReactions
|
||||
ForumTopicCreated
|
||||
ForumTopicEdited
|
||||
ForumTopicClosed
|
||||
ForumTopicDeleted
|
||||
ForumTopicReopened
|
||||
GeneralTopicHidden
|
||||
GeneralTopicUnhidden
|
||||
Reaction
|
||||
ReactionCount
|
||||
ReactionType
|
||||
MessageReactionUpdated
|
||||
MessageReactionCountUpdated
|
||||
ExportedStoryLink
|
||||
ChatTheme
|
||||
ChatWallpaper
|
||||
ContactRegistered
|
||||
ReadParticipant
|
||||
ScreenshotTaken
|
||||
Wallpaper
|
||||
WallpaperSettings
|
||||
""",
|
||||
stories="""
|
||||
Stories
|
||||
|
|
@ -617,36 +507,11 @@ def pyrogram_api():
|
|||
InputMediaArea
|
||||
InputMediaAreaChannelPost
|
||||
""",
|
||||
payment="""
|
||||
Payment
|
||||
CheckedGiftCode
|
||||
ExtendedMediaPreview
|
||||
GiftCode
|
||||
GiftedPremium
|
||||
InputStarsTransaction
|
||||
Invoice
|
||||
LabeledPrice
|
||||
PaidMedia
|
||||
PaidMessagePriceChanged
|
||||
PaymentForm
|
||||
PaymentInfo
|
||||
PaymentRefunded
|
||||
PurchasedPaidMedia
|
||||
StarsStatus
|
||||
StarsTransaction
|
||||
SuccessfulPayment
|
||||
""",
|
||||
pyromod="""
|
||||
Pyromod
|
||||
Identifier
|
||||
Listener
|
||||
""",
|
||||
bot="""
|
||||
Bot
|
||||
BotAllowed
|
||||
BotApp
|
||||
BotBusinessConnection
|
||||
""",
|
||||
bot_keyboards="""
|
||||
Bot keyboards
|
||||
ReplyKeyboardMarkup
|
||||
|
|
@ -654,13 +519,9 @@ def pyrogram_api():
|
|||
ReplyKeyboardRemove
|
||||
InlineKeyboardMarkup
|
||||
InlineKeyboardButton
|
||||
InlineKeyboardButtonBuy
|
||||
RequestPeerTypeChannel
|
||||
RequestPeerTypeChat
|
||||
RequestPeerTypeUser
|
||||
RequestedChats
|
||||
RequestedChat
|
||||
RequestedUser
|
||||
LoginUrl
|
||||
ForceReply
|
||||
CallbackQuery
|
||||
|
|
@ -685,13 +546,6 @@ def pyrogram_api():
|
|||
BotCommandScopeChatAdministrators
|
||||
BotCommandScopeChatMember
|
||||
""",
|
||||
business="""
|
||||
Telegram Business
|
||||
PreCheckoutQuery
|
||||
ShippingAddress
|
||||
ShippingOption
|
||||
ShippingQuery
|
||||
""",
|
||||
input_media="""
|
||||
Input Media
|
||||
InputMedia
|
||||
|
|
@ -725,32 +579,15 @@ def pyrogram_api():
|
|||
InlineQueryResultVoice
|
||||
ChosenInlineResult
|
||||
""",
|
||||
pre_checkout_query="""
|
||||
PreCheckoutQuery
|
||||
PreCheckoutQuery.answer
|
||||
""",
|
||||
shipping_query="""
|
||||
ShippingQuery
|
||||
ShippingQuery.answer
|
||||
""",
|
||||
input_message_content="""
|
||||
InputMessageContent
|
||||
InputMessageContent
|
||||
InputReplyToMessage
|
||||
InputReplyToMonoforum
|
||||
InputReplyToStory
|
||||
InputTextMessageContent
|
||||
InputLocationMessageContent
|
||||
InputVenueMessageContent
|
||||
InputContactMessageContent
|
||||
InputInvoiceMessageContent
|
||||
InputTodoTask
|
||||
""",
|
||||
authorization="""
|
||||
Authorization
|
||||
ActiveSession
|
||||
ActiveSessions
|
||||
LoginToken
|
||||
SentCode
|
||||
TermsOfService
|
||||
"""
|
||||
|
|
@ -768,7 +605,7 @@ def pyrogram_api():
|
|||
fmt_keys = {}
|
||||
|
||||
for k, v in categories.items():
|
||||
_, *types = get_title_list(v)
|
||||
name, *types = get_title_list(v)
|
||||
|
||||
fmt_keys.update({k: "\n ".join(types)})
|
||||
|
||||
|
|
@ -778,7 +615,7 @@ def pyrogram_api():
|
|||
title = "{}".format(type)
|
||||
|
||||
f2.write(title + "\n" + "=" * len(title) + "\n\n")
|
||||
f2.write(".. autoclass:: pyrogram.types.{}()\n".format(type))
|
||||
f2.write(".. autoclass:: pyrofork.types.{}()\n".format(type))
|
||||
|
||||
f.write(template.format(**fmt_keys))
|
||||
|
||||
|
|
@ -822,8 +659,6 @@ def pyrogram_api():
|
|||
Message.reply_web_page
|
||||
Message.get_media_group
|
||||
Message.react
|
||||
Message.transcribe
|
||||
Message.translate
|
||||
Message.wait_for_click
|
||||
""",
|
||||
chat="""
|
||||
|
|
@ -882,26 +717,6 @@ def pyrogram_api():
|
|||
Story.reply_video_note
|
||||
Story.reply_voice
|
||||
""",
|
||||
folder="""
|
||||
Folder
|
||||
Folder.delete
|
||||
Folder.update
|
||||
Folder.include_chat
|
||||
Folder.exclude_chat
|
||||
Folder.update_color
|
||||
Folder.pin_chat
|
||||
Folder.remove_chat
|
||||
Folder.export_link
|
||||
""",
|
||||
gift="""
|
||||
Gift
|
||||
Gift.show
|
||||
Gift.hide
|
||||
Gift.convert
|
||||
Gift.upgrade
|
||||
Gift.transfer
|
||||
Gift.wear
|
||||
""",
|
||||
callback_query="""
|
||||
Callback Query
|
||||
CallbackQuery.answer
|
||||
|
|
@ -914,14 +729,6 @@ def pyrogram_api():
|
|||
InlineQuery
|
||||
InlineQuery.answer
|
||||
""",
|
||||
pre_checkout_query="""
|
||||
PreCheckoutQuery
|
||||
PreCheckoutQuery.answer
|
||||
""",
|
||||
shipping_query="""
|
||||
ShippingQuery
|
||||
ShippingQuery.answer
|
||||
""",
|
||||
chat_join_request="""
|
||||
ChatJoinRequest
|
||||
ChatJoinRequest.approve
|
||||
|
|
@ -954,7 +761,7 @@ def pyrogram_api():
|
|||
title = "{}()".format(bm)
|
||||
|
||||
f2.write(title + "\n" + "=" * len(title) + "\n\n")
|
||||
f2.write(".. automethod:: pyrogram.types.{}()".format(bm))
|
||||
f2.write(".. automethod:: pyrofork.types.{}()".format(bm))
|
||||
|
||||
f.write(template.format(**fmt_keys))
|
||||
|
||||
|
|
@ -974,13 +781,13 @@ def start():
|
|||
generate(TYPES_PATH, TYPES_BASE)
|
||||
generate(FUNCTIONS_PATH, FUNCTIONS_BASE)
|
||||
generate(BASE_PATH, BASE_BASE)
|
||||
pyrogram_api()
|
||||
pyrofork_api()
|
||||
|
||||
|
||||
if "__main__" == __name__:
|
||||
FUNCTIONS_PATH = "../../pyrogram/raw/functions"
|
||||
TYPES_PATH = "../../pyrogram/raw/types"
|
||||
BASE_PATH = "../../pyrogram/raw/base"
|
||||
FUNCTIONS_PATH = "../../pyrofork/raw/functions"
|
||||
TYPES_PATH = "../../pyrofork/raw/types"
|
||||
BASE_PATH = "../../pyrofork/raw/base"
|
||||
HOME = "."
|
||||
DESTINATION = "../../docs/source/telegram"
|
||||
PYROGRAM_API_DEST = "../../docs/source/api"
|
||||
|
|
|
|||
55
compiler/docs/template/bound-methods.rst
vendored
55
compiler/docs/template/bound-methods.rst
vendored
|
|
@ -7,7 +7,7 @@ some of the required arguments.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ some of the required arguments.
|
|||
|
||||
-----
|
||||
|
||||
.. currentmodule:: pyrogram.types
|
||||
.. currentmodule:: pyrofork.types
|
||||
|
||||
Message
|
||||
-------
|
||||
|
|
@ -101,32 +101,6 @@ InlineQuery
|
|||
|
||||
{inline_query_toctree}
|
||||
|
||||
PreCheckoutQuery
|
||||
----------------
|
||||
|
||||
.. hlist::
|
||||
:columns: 2
|
||||
|
||||
{pre_checkout_query_hlist}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{pre_checkout_query_toctree}
|
||||
|
||||
ShippingQuery
|
||||
-------------
|
||||
|
||||
.. hlist::
|
||||
:columns: 2
|
||||
|
||||
{shipping_query_hlist}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{shipping_query_toctree}
|
||||
|
||||
ChatJoinRequest
|
||||
---------------
|
||||
|
||||
|
|
@ -140,28 +114,3 @@ ChatJoinRequest
|
|||
|
||||
{chat_join_request_toctree}
|
||||
|
||||
Folder
|
||||
---------------
|
||||
|
||||
.. hlist::
|
||||
:columns: 2
|
||||
|
||||
{folder_hlist}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{folder_toctree}
|
||||
|
||||
Gift
|
||||
---------------
|
||||
|
||||
.. hlist::
|
||||
:columns: 2
|
||||
|
||||
{gift_hlist}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{gift_toctree}
|
||||
|
|
|
|||
40
compiler/docs/template/methods.rst
vendored
40
compiler/docs/template/methods.rst
vendored
|
|
@ -1,13 +1,13 @@
|
|||
Available Methods
|
||||
=================
|
||||
|
||||
This page is about Pyrofork methods. All the methods listed here are bound to a :class:`~pyrogram.Client` instance,
|
||||
except for :meth:`~pyrogram.idle()` and :meth:`~pyrogram.compose()`, which are special functions that can be found in
|
||||
This page is about Pyrofork methods. All the methods listed here are bound to a :class:`~pyrofork.Client` instance,
|
||||
except for :meth:`~pyrofork.idle()` and :meth:`~pyrofork.compose()`, which are special functions that can be found in
|
||||
the main package directly.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ the main package directly.
|
|||
|
||||
-----
|
||||
|
||||
.. currentmodule:: pyrogram.Client
|
||||
.. currentmodule:: pyrofork.Client
|
||||
|
||||
Utilities
|
||||
---------
|
||||
|
|
@ -31,7 +31,7 @@ Utilities
|
|||
|
||||
{utilities}
|
||||
|
||||
.. currentmodule:: pyrogram
|
||||
.. currentmodule:: pyrofork
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
|
@ -45,7 +45,7 @@ Utilities
|
|||
idle
|
||||
compose
|
||||
|
||||
.. currentmodule:: pyrogram.Client
|
||||
.. currentmodule:: pyrofork.Client
|
||||
|
||||
Conversation
|
||||
------------
|
||||
|
|
@ -112,19 +112,6 @@ Stickers
|
|||
|
||||
{stickers}
|
||||
|
||||
Telegram Business
|
||||
-------------
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
||||
{business}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{business}
|
||||
|
||||
Users
|
||||
-----
|
||||
|
||||
|
|
@ -190,19 +177,6 @@ Bots
|
|||
|
||||
{bots}
|
||||
|
||||
Payments
|
||||
----
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
||||
{payments}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{payments}
|
||||
|
||||
Authorization
|
||||
-------------
|
||||
|
||||
|
|
@ -230,4 +204,4 @@ Learn more about how to use the raw API at :doc:`Advanced Usage <../../topics/ad
|
|||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{advanced}
|
||||
{advanced}
|
||||
73
compiler/docs/template/types.rst
vendored
73
compiler/docs/template/types.rst
vendored
|
|
@ -1,13 +1,13 @@
|
|||
Available Types
|
||||
===============
|
||||
|
||||
This page is about Pyrofork Types. All types listed here are available through the ``pyrogram.types`` package.
|
||||
This page is about Pyrofork Types. All types listed here are available through the ``pyrofork.types`` package.
|
||||
Unless required as argument to a client method, most of the types don't need to be manually instantiated because they
|
||||
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
|
||||
|
||||
from pyrogram.types import User, Message, ...
|
||||
from pyrofork.types import User, Message, ...
|
||||
|
||||
.. note::
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ are only returned by other methods. You also don't need to import them, unless y
|
|||
|
||||
-----
|
||||
|
||||
.. currentmodule:: pyrogram.types
|
||||
.. currentmodule:: pyrofork.types
|
||||
|
||||
Users & Chats
|
||||
-------------
|
||||
|
|
@ -73,19 +73,6 @@ Pyromod
|
|||
|
||||
{pyromod}
|
||||
|
||||
Bot
|
||||
---
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
||||
{bot}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{bot}
|
||||
|
||||
Bot keyboards
|
||||
-------------
|
||||
|
||||
|
|
@ -112,19 +99,6 @@ Bot commands
|
|||
|
||||
{bot_commands}
|
||||
|
||||
Telegram Business
|
||||
-------------
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
||||
{business}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{business}
|
||||
|
||||
Input Media
|
||||
-----------
|
||||
|
||||
|
|
@ -164,45 +138,6 @@ InputMessageContent
|
|||
|
||||
{input_message_content}
|
||||
|
||||
ShippingQuery
|
||||
-------------------
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
||||
{shipping_query}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{shipping_query}
|
||||
|
||||
PreCheckoutQuery
|
||||
-------------------
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
||||
{pre_checkout_query}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{pre_checkout_query}
|
||||
|
||||
Payment
|
||||
-------------------
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
||||
{payment}
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{payment}
|
||||
|
||||
Authorization
|
||||
-------------
|
||||
|
||||
|
|
@ -214,4 +149,4 @@ Authorization
|
|||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
{authorization}
|
||||
{authorization}
|
||||
|
|
@ -17,14 +17,13 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import ast
|
||||
import csv
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
|
||||
HOME = "compiler/errors"
|
||||
DEST = "pyrogram/errors/exceptions"
|
||||
DEST = "pyrofork/errors/exceptions"
|
||||
NOTICE_PATH = "NOTICE"
|
||||
|
||||
|
||||
|
|
@ -38,13 +37,6 @@ def caml(s):
|
|||
s = snek(s).split("_")
|
||||
return "".join([str(i.title()) for i in s])
|
||||
|
||||
def get_classes_from_file(file_path):
|
||||
with open(file_path, "r", encoding="utf-8") as f:
|
||||
tree = ast.parse(f.read())
|
||||
|
||||
classes = [node.name for node in ast.walk(tree) if isinstance(node, ast.ClassDef)]
|
||||
return classes
|
||||
|
||||
|
||||
def start():
|
||||
shutil.rmtree(DEST, ignore_errors=True)
|
||||
|
|
@ -135,20 +127,6 @@ def start():
|
|||
f_all.write(" },\n")
|
||||
|
||||
f_all.write("}\n")
|
||||
with open(init, "a", encoding="utf-8") as f_init:
|
||||
f_init.write("\n")
|
||||
all_classes = []
|
||||
for i in files:
|
||||
code, name = re.search(r"(\d+)_([A-Z_]+)", i).groups()
|
||||
classes = get_classes_from_file("{}/{}_{}.py".format(DEST, name.lower(), code))
|
||||
for j in classes:
|
||||
if j not in ["BaseException", "Exception", "PyrogramException"]:
|
||||
all_classes.append(j)
|
||||
f_init.write("__all__ = [\n")
|
||||
all_classes = sorted(set(all_classes))
|
||||
for i in all_classes:
|
||||
f_init.write(" \"{}\",\n".format(i))
|
||||
f_init.write("]\n")
|
||||
|
||||
with open("{}/all.py".format(DEST), encoding="utf-8") as f:
|
||||
content = f.read()
|
||||
|
|
@ -159,7 +137,7 @@ def start():
|
|||
|
||||
if "__main__" == __name__:
|
||||
HOME = "."
|
||||
DEST = "../../pyrogram/errors/exceptions"
|
||||
DEST = "../../pyrofork/errors/exceptions"
|
||||
NOTICE_PATH = "../../NOTICE"
|
||||
|
||||
start()
|
||||
|
|
|
|||
|
|
@ -2,40 +2,30 @@ id message
|
|||
ABOUT_TOO_LONG The provided about/bio text is too long
|
||||
ACCESS_TOKEN_EXPIRED The bot token has expired
|
||||
ACCESS_TOKEN_INVALID The bot access token is invalid
|
||||
ADDRESS_INVALID The specified geopoint address is invalid.
|
||||
ADMINS_TOO_MUCH The chat has too many administrators
|
||||
ADMIN_ID_INVALID The specified admin ID is invalid
|
||||
ADMIN_RANK_EMOJI_NOT_ALLOWED Emoji are not allowed in custom administrator titles
|
||||
ADMIN_RANK_INVALID The custom administrator title is invalid or too long
|
||||
ADMIN_RIGHTS_EMPTY The chatAdminRights constructor passed in keyboardButtonRequestPeer.peer_type.user_admin_rights has no rights set (i.e. flags is 0).
|
||||
ALBUM_PHOTOS_TOO_MANY Too many photos were included in the album
|
||||
API_ID_INVALID The api_id/api_hash combination is invalid
|
||||
API_ID_PUBLISHED_FLOOD You are using an API key that is limited on the server side because it was published somewhere
|
||||
ARTICLE_TITLE_EMPTY The article title is empty
|
||||
AUDIO_CONTENT_URL_EMPTY The remote URL specified in the content field is empty
|
||||
AUDIO_TITLE_EMPTY The title attribute of the audio is empty
|
||||
AUTH_BYTES_INVALID The authorization bytes are invalid
|
||||
AUTH_TOKEN_ALREADY_ACCEPTED The authorization token was already used
|
||||
AUTH_TOKEN_EXCEPTION An error occurred while importing the auth token
|
||||
AUTH_TOKEN_EXPIRED The provided authorization token has expired and the updated QR-code must be re-scanned
|
||||
AUTH_TOKEN_INVALID An invalid authorization token was provided
|
||||
AUTH_TOKEN_INVALID2 An invalid authorization token was provided
|
||||
AUTH_TOKEN_INVALIDX The specified auth token is invalid
|
||||
AUTOARCHIVE_NOT_AVAILABLE This feature is not yet enabled for your account due to it not receiving too many private messages from strangers
|
||||
BANK_CARD_NUMBER_INVALID The credit card number is invalid
|
||||
BANNED_RIGHTS_INVALID You provided a set of restrictions that is invalid
|
||||
BASE_PORT_LOC_INVALID The base port location is invalid
|
||||
BIRTHDAY_INVALID The age should be less than 150 year old in Telegram
|
||||
BOTS_TOO_MUCH The chat has too many bots
|
||||
BOT_CHANNELS_NA Bots can't edit admin privileges
|
||||
BOT_COMMAND_DESCRIPTION_INVALID The command description was empty, too long or had invalid characters
|
||||
BOT_COMMAND_INVALID The specified command is invalid
|
||||
BOT_DOMAIN_INVALID The domain used for the auth button does not match the one configured in @BotFather
|
||||
BOT_GAMES_DISABLED Bot games cannot be used in this type of chat
|
||||
BOT_GROUPS_BLOCKED This bot can't be added to groups
|
||||
BOT_INLINE_DISABLED The inline feature of the bot is disabled
|
||||
BOT_INVALID This is not a valid bot
|
||||
BOT_INVOICE_INVALID The provided invoice is invalid
|
||||
BOT_METHOD_INVALID The method can't be used by bots
|
||||
BOT_MISSING This method can only be run by a bot
|
||||
BOT_ONESIDE_NOT_AVAIL Bots can't pin messages for one side only in private chats
|
||||
|
|
@ -43,14 +33,10 @@ BOT_PAYMENTS_DISABLED This method can only be run by a bot
|
|||
BOT_POLLS_DISABLED Sending polls by bots has been disabled
|
||||
BOT_RESPONSE_TIMEOUT The bot did not answer to the callback query in time
|
||||
BOT_SCORE_NOT_MODIFIED The bot score was not modified
|
||||
BROADCAST_CALLS_DISABLED Broadcast calls disabled
|
||||
BROADCAST_ID_INVALID The channel is invalid
|
||||
BROADCAST_PUBLIC_VOTERS_FORBIDDEN Polls with public voters cannot be sent in channels
|
||||
BROADCAST_REQUIRED The request can only be used with a channel
|
||||
BUSINESS_BOT_MISSING Business bot missing
|
||||
BUTTON_DATA_INVALID The button callback data is invalid or too large
|
||||
BUTTON_ID_INVALID The button_id parameter is invalid
|
||||
BUTTON_TEXT_INVALID The specified button text is invalid
|
||||
BUTTON_TYPE_INVALID The type of one of the buttons you provided is invalid
|
||||
BUTTON_URL_INVALID The button url is invalid
|
||||
BUTTON_USER_PRIVACY_RESTRICTED The privacy settings of the user specified in a keyboard button do not allow creating such button
|
||||
|
|
@ -59,20 +45,13 @@ CALL_ALREADY_DECLINED The call is already declined
|
|||
CALL_PEER_INVALID The provided call peer object is invalid
|
||||
CALL_PROTOCOL_FLAGS_INVALID Call protocol flags invalid
|
||||
CDN_METHOD_INVALID The method can't be used on CDN DCs
|
||||
CHANNELS_ADMIN_LOCATED_TOO_MUCH The user has reached the limit of public geogroups
|
||||
CHANNELS_ADMIN_PUBLIC_TOO_MUCH You are an administrator of too many public channels
|
||||
CHANNELS_TOO_MUCH You have joined too many channels or supergroups, leave some and try again
|
||||
CHANNEL_ADD_INVALID Internal error.
|
||||
CHANNEL_BANNED The channel is banned
|
||||
CHANNEL_ID_INVALID The specified supergroup ID is invalid.
|
||||
CHANNEL_INVALID The channel parameter is invalid
|
||||
CHANNEL_PARICIPANT_MISSING The current user is not in the channel
|
||||
CHANNEL_PRIVATE The channel/supergroup is not accessible
|
||||
CHANNEL_TOO_BIG The channel too big
|
||||
CHANNEL_TOO_LARGE "Channel is too large to be deleted; this error is issued when trying to delete channels with more than 1000 members (subject to change)."
|
||||
CHARGE_ALREADY_REFUNDED The charge id was already used for a refund.
|
||||
CHARGE_NOT_FOUND The charge id was not found.
|
||||
CHATLIST_EXCLUDE_INVALID The specified `exclude_peers` are invalid.
|
||||
CHANNEL_TOO_LARGE The channel is too large
|
||||
CHAT_ABOUT_NOT_MODIFIED The chat about text was not modified because you tried to edit it using the same content
|
||||
CHAT_ABOUT_TOO_LONG The chat about text is too long
|
||||
CHAT_ADMIN_REQUIRED The method requires chat admin privileges
|
||||
|
|
@ -85,7 +64,6 @@ CHAT_INVITE_PERMANENT The chat invite link is primary
|
|||
CHAT_LINK_EXISTS The action failed because the supergroup is linked to a channel
|
||||
CHAT_NOT_MODIFIED The chat settings (title, permissions, photo, etc..) were not modified because you tried to edit them using the same content
|
||||
CHAT_RESTRICTED The chat is restricted and cannot be used
|
||||
CHAT_REVOKE_DATE_UNSUPPORTED `min_date` and `max_date` are not available for using with non-user peers
|
||||
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
|
||||
|
|
@ -103,11 +81,8 @@ CONNECTION_SYSTEM_EMPTY The connection to the system is empty
|
|||
CONNECTION_SYSTEM_LANG_CODE_EMPTY The system language code is empty
|
||||
CONTACT_ADD_MISSING Contact to add is missing
|
||||
CONTACT_ID_INVALID The provided contact id is invalid
|
||||
CONTACT_MISSING The specified user is not a contact.
|
||||
CONTACT_NAME_EMPTY The provided contact name is empty
|
||||
CONTACT_REQ_MISSING Missing contact request
|
||||
CREATE_CALL_FAILED An error occurred while creating the call
|
||||
CURRENCY_TOTAL_AMOUNT_INVALID The total amount of all prices is invalid
|
||||
DATA_INVALID The encrypted data is invalid
|
||||
DATA_JSON_INVALID The provided JSON data is invalid
|
||||
DATA_TOO_LONG Data too long
|
||||
|
|
@ -117,14 +92,9 @@ DH_G_A_INVALID The g_a parameter invalid
|
|||
DOCUMENT_INVALID The document is invalid
|
||||
EMAIL_HASH_EXPIRED The email hash expired and cannot be used to verify it
|
||||
EMAIL_INVALID The email provided is invalid
|
||||
EMAIL_NOT_ALLOWED This email is not allowed
|
||||
EMAIL_NOT_SETUP In order to change the login email with emailVerifyPurposeLoginChange, an existing login email must already be set using emailVerifyPurposeLoginSetup.
|
||||
EMAIL_UNCONFIRMED Email unconfirmed
|
||||
EMAIL_UNCONFIRMED_X The provided email isn't confirmed, {value} is the length of the verification code that was just sent to the email
|
||||
EMAIL_VERIFY_EXPIRED The verification email has expired
|
||||
EMOJI_INVALID The specified theme emoji is valid
|
||||
EMOJI_MARKUP_INVALID The specified `video_emoji_markup` was invalid.
|
||||
EMOJI_NOT_MODIFIED The theme wasn't changed
|
||||
EMOTICON_EMPTY The emoticon parameter is empty
|
||||
EMOTICON_INVALID The emoticon parameter is invalid
|
||||
EMOTICON_STICKERPACK_MISSING The emoticon sticker pack you are trying to obtain is missing
|
||||
|
|
@ -138,20 +108,13 @@ ENTITY_BOUNDS_INVALID The message entity bounds are invalid
|
|||
ENTITY_MENTION_USER_INVALID The mentioned entity is not an user
|
||||
ERROR_TEXT_EMPTY The provided error message is empty
|
||||
EXPIRE_DATE_INVALID The expiration date is invalid
|
||||
EXPIRE_FORBIDDEN Expire forbidden
|
||||
EXPORT_CARD_INVALID The provided card is invalid
|
||||
EXTENDED_MEDIA_AMOUNT_INVALID The maximum amount of `star_count` should be less than the `stars_paid_post_amount_max`
|
||||
EXTENDED_MEDIA_PEER_INVALID The specified chat type is invalid.
|
||||
EXTENDED_MEDIA_TYPE_INVALID The specified extended media type is unsupported.
|
||||
EXTERNAL_URL_INVALID The external media URL is invalid
|
||||
FIELD_NAME_EMPTY The field with the name FIELD_NAME is missing
|
||||
FIELD_NAME_INVALID The field with the name FIELD_NAME is invalid
|
||||
FILE_CONTENT_TYPE_INVALID File content-type is invalid
|
||||
FILE_EMTPY An empty file was provided
|
||||
FILE_ID_INVALID The file id is invalid
|
||||
FILE_MIGRATE_X The file is in Data Center No. {value}
|
||||
FILE_PARTS_INVALID Invalid number of parts.
|
||||
FILE_PART_0_MISSING File part 0 missing
|
||||
FILE_PART_EMPTY The file part sent is empty
|
||||
FILE_PART_INVALID The file part number is invalid.
|
||||
FILE_PART_LENGTH_INVALID The length of a file part is invalid
|
||||
|
|
@ -162,38 +125,25 @@ FILE_PART_X_MISSING Part {value} of the file is missing from storage
|
|||
FILE_REFERENCE_EMPTY The file id contains an empty file reference, you must obtain a valid one by fetching the message from the origin context
|
||||
FILE_REFERENCE_EXPIRED The file id contains an expired file reference, you must obtain a valid one by fetching the message from the origin context
|
||||
FILE_REFERENCE_INVALID The file id contains an invalid file reference, you must obtain a valid one by fetching the message from the origin context
|
||||
FILE_TITLE_EMPTY An empty file title was specified
|
||||
FILTER_ID_INVALID The specified filter ID is invalid
|
||||
FILTER_INCLUDE_EMPTY The filter include is empty
|
||||
FILTER_NOT_SUPPORTED The specified filter cannot be used in this context
|
||||
FILTER_TITLE_EMPTY The title field of the filter is empty
|
||||
FIRSTNAME_INVALID The first name is invalid
|
||||
FOLDER_ID_EMPTY The folder you tried to delete was already empty
|
||||
FOLDER_ID_INVALID The folder id is invalid
|
||||
FORM_ID_EXPIRED The specified id has expired.
|
||||
FORUM_ENABLED You can't execute the specified action because the group is a [forum](https://core.telegram.org/api/forum), disable forum functionality to continue.
|
||||
FRESH_CHANGE_ADMINS_FORBIDDEN You can't change administrator settings in this chat because your session was logged-in recently
|
||||
FROM_MESSAGE_BOT_DISABLED Bots can't use fromMessage min constructors
|
||||
FROM_PEER_INVALID The from peer value is invalid
|
||||
GAME_BOT_INVALID You cannot send that game with the current bot
|
||||
GENERAL_MODIFY_ICON_FORBIDDEN You can't modify the icon of the General topic.
|
||||
GEO_POINT_INVALID Invalid geo point provided
|
||||
GIF_CONTENT_TYPE_INVALID GIF content-type invalid
|
||||
GIF_ID_INVALID The provided gif/animation id is invalid
|
||||
GIFT_SLUG_INVALID The specified slug is invalid.
|
||||
GIFT_SLUG_EXPIRED The gift slug is expired
|
||||
GRAPH_EXPIRED_RELOAD This graph has expired, please obtain a new graph token
|
||||
GRAPH_INVALID_RELOAD Invalid graph token provided, please reload the stats and provide the updated token
|
||||
GRAPH_INVALID_RELOAD Invalid graph token provided,
|
||||
GRAPH_OUTDATED_RELOAD The graph data is outdated
|
||||
GROUPCALL_ALREADY_DISCARDED The group call was already discarded
|
||||
GROUPCALL_INVALID The specified group call is invalid
|
||||
GROUPCALL_JOIN_MISSING You haven't joined this group call
|
||||
GROUPCALL_NOT_MODIFIED Group call settings weren't modified
|
||||
GROUPCALL_SSRC_DUPLICATE_MUCH Too many group call synchronization source duplicates
|
||||
GROUPED_MEDIA_INVALID The album contains invalid media
|
||||
GROUP_CALL_INVALID The group call is invalid
|
||||
HASH_INVALID The provided hash is invalid
|
||||
HIDE_REQUESTER_MISSING The join request was missing or was already handled
|
||||
IMAGE_PROCESS_FAILED The server failed to process your image
|
||||
IMPORT_FILE_INVALID The imported file is invalid
|
||||
IMPORT_FORMAT_UNRECOGNIZED The imported format is unrecognized
|
||||
|
|
@ -206,35 +156,23 @@ INPUT_FILTER_INVALID The filter is invalid for this query
|
|||
INPUT_LAYER_INVALID The provided layer is invalid
|
||||
INPUT_METHOD_INVALID The method invoked is invalid in the current schema
|
||||
INPUT_REQUEST_TOO_LONG The input request is too long
|
||||
INPUT_TEXT_EMPTY The specified text is empty
|
||||
INPUT_TEXT_TOO_LONG The specified text is too long.
|
||||
INPUT_USER_DEACTIVATED The target user has been deleted/deactivated
|
||||
INVITES_TOO_MUCH The maximum number of per-folder invites specified by the `chatlist_invites_limit_default`/`chatlist_invites_limit_premium` was reached.
|
||||
INVITE_FORBIDDEN_WITH_JOINAS If the user has anonymously joined a group call as a channel, they can't invite other users to the group call because that would cause deanonymization, because the invite would be sent using the original user ID, not the anonymized channel ID
|
||||
INVITE_HASH_EMPTY The invite hash is empty
|
||||
INVITE_HASH_EXPIRED The chat invite link is no longer valid
|
||||
INVITE_HASH_INVALID The invite link hash is invalid
|
||||
INVITE_REQUEST_SENT The request to join this chat or channel has been successfully sent
|
||||
INVITE_REVOKED_MISSING The action required a chat invite link to be revoked first
|
||||
INVITE_SLUG_EMPTY The invite slug is empty
|
||||
INVITE_SLUG_EXPIRED The invite slug is expired
|
||||
INVOICE_PAYLOAD_INVALID The specified invoice payload is invalid
|
||||
JOIN_AS_PEER_INVALID The specified peer cannot be used to join a group call
|
||||
LANG_CODE_INVALID The specified language code is invalid
|
||||
LANG_CODE_NOT_SUPPORTED The specified language code is not supported
|
||||
LANG_PACK_INVALID The provided language pack is invalid
|
||||
LASTNAME_INVALID The last name is invalid
|
||||
LIMIT_INVALID The limit parameter is invalid
|
||||
LINK_NOT_MODIFIED The chat link was not modified because you tried to link to the same target
|
||||
LOCATION_INVALID The file location is invalid
|
||||
MAX_DATE_INVALID The specified maximum date is invalid
|
||||
MAX_ID_INVALID The max_id parameter is invalid
|
||||
MAX_QTS_INVALID The provided QTS is invalid
|
||||
MD5_CHECKSUM_INVALID The file's checksum did not match the md5_checksum parameter
|
||||
MEDIA_CAPTION_TOO_LONG The media caption is too long
|
||||
MEDIA_EMPTY The media you tried to send is invalid
|
||||
MEDIA_FILE_INVALID The provided media file is invalid
|
||||
MEDIA_GROUPED_INVALID You tried to send media of different types in an album
|
||||
MEDIA_FILE_INVALID The media file is invalid
|
||||
MEDIA_INVALID The media is invalid
|
||||
MEDIA_NEW_INVALID The new media to edit the message with is invalid
|
||||
MEDIA_PREV_INVALID The previous media cannot be edited with anything else
|
||||
|
|
@ -251,16 +189,12 @@ MESSAGE_NOT_MODIFIED The message was not modified because you tried to edit it u
|
|||
MESSAGE_POLL_CLOSED You can't interact with a closed poll
|
||||
MESSAGE_TOO_LONG The message text is too long
|
||||
METHOD_INVALID The API method is invalid and cannot be used
|
||||
MIN_DATE_INVALID The specified minimum date is invalid
|
||||
MSG_ID_INVALID The message ID used in the peer was invalid
|
||||
MSG_TOO_OLD chat_read_mark_expire_period have passed since the message was sent, read receipts were deleted
|
||||
MSG_VOICE_MISSING The message does not contain a voice message
|
||||
MSG_WAIT_FAILED A waiting call returned an error
|
||||
MULTI_MEDIA_TOO_LONG The album/media group contains too many items
|
||||
NEW_SALT_INVALID The new salt is invalid
|
||||
NEW_SETTINGS_EMPTY No password is set on the current account, and no new password was specified in `new_settings`
|
||||
NEW_SETTINGS_INVALID The new settings are invalid
|
||||
NOGENERAL_HIDE_FORBIDDEN The hidden parameter is only valid for the General topic message_thread_id=1
|
||||
NEXT_OFFSET_INVALID The next offset value is invalid
|
||||
OFFSET_INVALID The offset parameter is invalid
|
||||
OFFSET_PEER_ID_INVALID The provided offset peer is invalid
|
||||
|
|
@ -270,8 +204,6 @@ PACK_SHORT_NAME_INVALID Invalid sticker pack name. It must begin with a letter,
|
|||
PACK_SHORT_NAME_OCCUPIED A sticker pack with this name already exists
|
||||
PACK_TITLE_INVALID The sticker pack title is invalid
|
||||
PARTICIPANTS_TOO_FEW The chat doesn't have enough participants
|
||||
PARTICIPANT_ID_INVALID The specified participant ID is invalid
|
||||
PARTICIPANT_JOIN_MISSING Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall
|
||||
PARTICIPANT_VERSION_OUTDATED The other participant is using an outdated Telegram app version
|
||||
PASSWORD_EMPTY The password provided is empty
|
||||
PASSWORD_HASH_INVALID The two-step verification password is invalid
|
||||
|
|
@ -281,7 +213,6 @@ PASSWORD_REQUIRED The two-step verification password is required for this method
|
|||
PASSWORD_TOO_FRESH_X The two-step verification password was added recently and you are required to wait {value} seconds
|
||||
PAYMENT_PROVIDER_INVALID The payment provider was not recognised or its token was invalid
|
||||
PEER_FLOOD The method can't be used because your account is currently limited
|
||||
PEER_HISTORY_EMPTY Peer history empty
|
||||
PEER_ID_INVALID The peer id being used is invalid or not known yet. Make sure you meet the peer before interacting with it
|
||||
PEER_ID_NOT_SUPPORTED The provided peer id is not supported
|
||||
PERSISTENT_TIMESTAMP_EMPTY The pts argument is empty
|
||||
|
|
@ -290,8 +221,6 @@ PHONE_CODE_EMPTY The phone code is missing
|
|||
PHONE_CODE_EXPIRED The confirmation code has expired
|
||||
PHONE_CODE_HASH_EMPTY The phone code hash is missing
|
||||
PHONE_CODE_INVALID The confirmation code is invalid
|
||||
PHONE_HASH_EXPIRED An invalid or expired phone_code_hash was provided
|
||||
PHONE_NOT_OCCUPIED No user is associated to the specified phone number
|
||||
PHONE_NUMBER_APP_SIGNUP_FORBIDDEN You can't sign up using this app
|
||||
PHONE_NUMBER_BANNED The phone number is banned from Telegram and cannot be used
|
||||
PHONE_NUMBER_FLOOD This number has tried to login too many times
|
||||
|
|
@ -312,26 +241,20 @@ PHOTO_SAVE_FILE_INVALID The photo you tried to send cannot be saved by Telegram
|
|||
PHOTO_THUMB_URL_EMPTY The photo thumb URL is empty
|
||||
PHOTO_THUMB_URL_INVALID The photo thumb URL is invalid
|
||||
PINNED_DIALOGS_TOO_MUCH Too many pinned dialogs
|
||||
PINNED_TOPIC_NOT_MODIFIED The pinned topic was not modified.
|
||||
PIN_RESTRICTED You can't pin messages in private chats with other people
|
||||
POLL_ANSWERS_INVALID The poll answers are invalid
|
||||
POLL_ANSWER_INVALID One of the poll answers is not acceptable
|
||||
POLL_OPTION_DUPLICATE A duplicate option was sent in the same poll
|
||||
POLL_OPTION_INVALID A poll option used invalid data (the data may be too long)
|
||||
POLL_QUESTION_INVALID The poll question is invalid
|
||||
POLL_UNSUPPORTED This layer does not support polls in the invoked method
|
||||
POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method
|
||||
PREMIUM_ACCOUNT_REQUIRED The method requires a premium user account
|
||||
PREMIUM_GIFTCODE_WAS_REFUNDED This gift code can't be redeemed because the giveaway organizer requested a refund
|
||||
PRICING_CHAT_INVALID This chat chat doesn't support subscription link.
|
||||
PRIVACY_KEY_INVALID The privacy key is invalid
|
||||
PRIVACY_TOO_LONG Your privacy exception list has exceeded the maximum capacity
|
||||
PRIVACY_VALUE_INVALID The privacy value is invalid
|
||||
PUBLIC_KEY_REQUIRED A public key is required
|
||||
QUERY_ID_EMPTY The query ID is empty
|
||||
QUERY_ID_INVALID The callback query id is invalid
|
||||
QUERY_TOO_SHORT The query is too short
|
||||
QUIZ_ANSWER_MISSING You can forward a quiz while hiding the original author only after choosing an option in the quiz
|
||||
QUIZ_CORRECT_ANSWERS_EMPTY The correct answers of the quiz are empty
|
||||
QUIZ_CORRECT_ANSWERS_TOO_MUCH The quiz contains too many correct answers
|
||||
QUIZ_CORRECT_ANSWER_INVALID The correct answers of the quiz are invalid
|
||||
|
|
@ -348,7 +271,6 @@ REPLY_MARKUP_GAME_EMPTY The provided reply markup for the game is empty
|
|||
REPLY_MARKUP_INVALID The provided reply markup is invalid
|
||||
REPLY_MARKUP_TOO_LONG The reply markup is too long
|
||||
REPLY_MESSAGE_ID_INVALID The reply message id is invalid
|
||||
RESET_REQUEST_MISSING No password reset is in progress
|
||||
RESULTS_TOO_MUCH The result contains too many items
|
||||
RESULT_ID_DUPLICATE The result contains items with duplicated identifiers
|
||||
RESULT_ID_EMPTY Result ID empty
|
||||
|
|
@ -356,37 +278,27 @@ RESULT_ID_INVALID The given result cannot be used to send the selection to the b
|
|||
REACTIONS_TOO_MANY Currently, non-premium users, can set up to one reaction per message
|
||||
RESULT_TYPE_INVALID The result type is invalid
|
||||
REVOTE_NOT_ALLOWED You cannot change your vote
|
||||
RIGHTS_NOT_MODIFIED The new admin rights are equal to the old rights, no change was made
|
||||
RSA_DECRYPT_FAILED Internal RSA decryption failed
|
||||
SCHEDULE_BOT_NOT_ALLOWED Bots are not allowed to schedule messages
|
||||
SCHEDULE_DATE_INVALID Invalid schedule date provided
|
||||
SCHEDULE_DATE_TOO_LATE The date you tried to schedule is too far in the future (more than one year)
|
||||
SCHEDULE_STATUS_PRIVATE You cannot schedule a message until the person comes online if their privacy does not show this information
|
||||
SCHEDULE_TOO_MUCH You tried to schedule too many messages in this chat
|
||||
SCORE_INVALID The specified game score is invalid
|
||||
SEARCH_QUERY_EMPTY The search query is empty
|
||||
SEARCH_WITH_LINK_NOT_SUPPORTED You cannot provide a search query and an invite link at the same time
|
||||
SECONDS_INVALID The seconds interval is invalid
|
||||
SEND_AS_PEER_INVALID You can't send messages as the specified peer
|
||||
SEND_MESSAGE_MEDIA_INVALID The message media is invalid
|
||||
SEND_MESSAGE_TYPE_INVALID The message type is invalid
|
||||
SESSION_TOO_FRESH_X You can't do this action because the current session was logged-in recently
|
||||
SETTINGS_INVALID Invalid settings were provided
|
||||
SHA256_HASH_INVALID The provided SHA256 hash is invalid
|
||||
SHORTNAME_OCCUPY_FAILED An error occurred when trying to register the short-name used for the sticker pack. Try a different name
|
||||
SHORT_NAME_INVALID The specified short name is invalid
|
||||
SHORT_NAME_OCCUPIED The specified short name is already in use
|
||||
SLOWMODE_MULTI_MSGS_DISABLED Slowmode is enabled, you cannot forward multiple messages to this group
|
||||
SMS_CODE_CREATE_FAILED An error occurred while creating the SMS code
|
||||
SRP_ID_INVALID Invalid SRP ID provided
|
||||
SRP_PASSWORD_CHANGED The password has changed
|
||||
STARGIFT_ALREADY_CONVERTED The provided star gift already converted to stars
|
||||
STARGIFT_ALREADY_UPGRADED This star gift was already upgraded before
|
||||
STARGIFT_USAGE_LIMITED The star gift usage is limited
|
||||
START_PARAM_EMPTY The start parameter is empty
|
||||
START_PARAM_INVALID The start parameter is invalid
|
||||
START_PARAM_TOO_LONG The start parameter is too long
|
||||
STICKERPACK_STICKERS_TOO_MUCH There are too many stickers in this stickerpack, you can't add any more
|
||||
STICKERSET_INVALID The requested sticker set is invalid
|
||||
STICKERSET_NOT_MODIFIED The sticker set is not modified
|
||||
STICKERS_EMPTY The sticker provided is empty
|
||||
|
|
@ -394,55 +306,33 @@ STICKERS_TOO_MUCH Too many stickers in the set
|
|||
STICKER_DOCUMENT_INVALID The sticker document is invalid
|
||||
STICKER_EMOJI_INVALID The sticker emoji is invalid
|
||||
STICKER_FILE_INVALID The sticker file is invalid
|
||||
STICKER_GIF_DIMENSIONS The specified video sticker has invalid dimensions
|
||||
STICKER_ID_INVALID The provided sticker id is invalid
|
||||
STICKER_INVALID The provided sticker is invalid
|
||||
STICKER_MIME_INVALID Make sure to pass a valid image file for the right InputFile parameter
|
||||
STICKER_PNG_DIMENSIONS The sticker png dimensions are invalid
|
||||
STICKER_PNG_NOPNG Stickers must be png files but the provided image was not a png
|
||||
STICKER_TGS_NODOC You must send the animated sticker as a document
|
||||
STICKER_TGS_NOTGS A tgs sticker file was expected, but something else was provided
|
||||
STICKER_THUMB_PNG_NOPNG A png sticker thumbnail file was expected, but something else was provided
|
||||
STICKER_VIDEO_BIG The specified video sticker is too big
|
||||
STICKER_VIDEO_NODOC You must send the video sticker as a document
|
||||
STICKER_VIDEO_NOWEBM A webm video file was expected, but something else was provided
|
||||
STORY_ID_EMPTY You specified no story IDs.
|
||||
STORY_ID_INVALID The specified story ID is invalid.
|
||||
STORY_NOT_MODIFIED The new story information you passed is equal to the previous story information, thus it wasn't modified.
|
||||
STORY_PERIOD_INVALID The specified story period is invalid for this account.
|
||||
STORIES_TOO_MUCH Too many stories in the current account
|
||||
STORY_SEND_FLOOD_WEEKLY_X You've hit the weekly story limit, wait for the specified number of seconds before posting a new story.
|
||||
STORY_SEND_FLOOD_MONTHLY_X You've hit the monthly story limit, wait for the specified number of seconds before posting a new story.
|
||||
STORY_PERIOD_INVALID The story period is invalid
|
||||
SUBSCRIPTION_PERIOD_INVALID The subscription period is invalid.
|
||||
SWITCH_PM_TEXT_EMPTY The switch_pm.text field was empty
|
||||
TAKEOUT_INVALID The takeout id is invalid
|
||||
TAKEOUT_REQUIRED The method must be invoked inside a takeout session
|
||||
TEMP_AUTH_KEY_ALREADY_BOUND The passed temporary key is already bound to another perm_auth_key_id
|
||||
TEMP_AUTH_KEY_EMPTY The temporary auth key provided is empty
|
||||
THEME_FILE_INVALID Invalid theme file provided
|
||||
THEME_FORMAT_INVALID Invalid theme format provided
|
||||
THEME_INVALID Invalid theme provided
|
||||
THEME_MIME_INVALID You cannot create this theme because the mime-type is invalid
|
||||
THEME_TITLE_INVALID The specified theme title is invalid
|
||||
TITLE_INVALID The specified stickerpack title is invalid
|
||||
TMP_PASSWORD_DISABLED The temporary password is disabled
|
||||
TMP_PASSWORD_INVALID The temporary password is invalid
|
||||
TOKEN_INVALID The provided token is invalid
|
||||
TOPIC_CLOSED The topic was closed
|
||||
TOPIC_DELETED The topic was deleted
|
||||
TOPIC_CLOSE_SEPARATELY The close flag cannot be provided together with any of the other flags.
|
||||
TOPIC_HIDE_SEPARATELY The hide flag cannot be provided together with any of the other flags.
|
||||
TOPIC_ID_INVALID The provided topic ID is invalid
|
||||
TOPIC_NOT_MODIFIED The topic was not modified
|
||||
TOPIC_TITLE_EMPTY The specified topic title is empty.
|
||||
TO_LANG_INVALID The specified destination language is invalid
|
||||
TRANSCRIPTION_FAILED Telegram is having internal problems. Please try again later to transcribe the audio.
|
||||
TTL_DAYS_INVALID The provided TTL days is invalid
|
||||
TTL_MEDIA_INVALID The media does not support self-destruction
|
||||
TYPES_EMPTY The types parameter is empty
|
||||
TYPE_CONSTRUCTOR_INVALID The type constructor is invalid
|
||||
UNKNOWN_ERROR Unknown error
|
||||
UNTIL_DATE_INVALID That date parameter is invalid
|
||||
URL_INVALID The URL provided is invalid
|
||||
USAGE_LIMIT_INVALID The usage limit is invalid
|
||||
|
|
@ -455,7 +345,6 @@ USERPIC_UPLOAD_REQUIRED You are required to upload a profile picture for this ac
|
|||
USERS_TOO_FEW Not enough users (to create a chat, for example)
|
||||
USERS_TOO_MUCH The maximum number of users has been exceeded (to create a chat, for example)
|
||||
USER_ADMIN_INVALID The action requires admin privileges. Probably you tried to edit admin privileges on someone you don't have rights to
|
||||
USER_ALREADY_INVITED You have already invited this user
|
||||
USER_ALREADY_PARTICIPANT The user is already a participant of this chat
|
||||
USER_BANNED_IN_CHANNEL You are limited from sending messages in supergroups/channels, check @SpamBot for details
|
||||
USER_BLOCKED The user is blocked
|
||||
|
|
@ -471,17 +360,13 @@ USER_IS_BOT A bot cannot send messages to other bots or to itself
|
|||
USER_KICKED This user was kicked from this chat
|
||||
USER_NOT_MUTUAL_CONTACT The user is not a mutual contact
|
||||
USER_NOT_PARTICIPANT The user is not a member of this chat
|
||||
USER_PUBLIC_MISSING The accounts username is missing
|
||||
USER_VOLUME_INVALID The specified user volume is invalid
|
||||
VIDEO_CONTENT_TYPE_INVALID The video content type is invalid (i.e.: not streamable)
|
||||
VIDEO_FILE_INVALID The video file is invalid
|
||||
VIDEO_TITLE_EMPTY The specified video title is empty
|
||||
VOICE_MESSAGES_FORBIDDEN This user's privacy settings forbid you from sending voice messages
|
||||
VOICE_MESSAGES_FORBIDDEN Voice messages are restricted
|
||||
VOLUME_LOC_NOT_FOUND The volume location can't be found
|
||||
WALLPAPER_FILE_INVALID The provided file cannot be used as a wallpaper
|
||||
WALLPAPER_INVALID The input wallpaper was not valid
|
||||
WALLPAPER_MIME_INVALID The wallpaper mime type is invalid
|
||||
WALLPAPER_NOT_FOUND The specified wallpaper could not be found.
|
||||
WC_CONVERT_URL_INVALID WC convert URL invalid
|
||||
WEBDOCUMENT_INVALID The web document is invalid
|
||||
WEBDOCUMENT_MIME_INVALID The web document mime type is invalid
|
||||
|
|
@ -490,19 +375,9 @@ 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
|
||||
WEBPAGE_NOT_FOUND Webpage not found
|
||||
WEBPAGE_URL_INVALID Webpage url invalid
|
||||
WEBPUSH_AUTH_INVALID The specified web push authentication secret is invalid
|
||||
WEBPUSH_KEY_INVALID The specified web push elliptic curve Diffie-Hellman public key is invalid
|
||||
WEBPUSH_TOKEN_INVALID The specified web push token is invalid
|
||||
YOU_BLOCKED_USER You blocked this user
|
||||
STORIES_NEVER_CREATED You have never created any stories
|
||||
MEDIA_FILE_INVALID The provided media file is invalid
|
||||
CHANNEL_FORUM_MISSING The channel forum is missing
|
||||
TTL_PERIOD_INVALID The provided TTL period is invalid
|
||||
BOOSTS_REQUIRED The specified channel must first be boosted by its users in order to perform this action
|
||||
BOOSTS_EMPTY You can't modify the icon of the General topic.
|
||||
BOOST_NOT_MODIFIED You're already boosting the specified channel.
|
||||
PAYMENT_REQUIRED The payment is required
|
||||
BOOST_PEER_INVALID The specified `boost_peer` is invalid.
|
||||
STARS_AMOUNT_INVALID The specified `amount` is invalid.
|
||||
BOOSTS_REQUIRED Channel required more boost to upload a story
|
||||
|
|
|
|||
|
|
|
@ -9,19 +9,14 @@ EDIT_BOT_INVITE_FORBIDDEN Bots' chat invite links can't be edited
|
|||
INLINE_BOT_REQUIRED The action must be performed through an inline bot callback
|
||||
MESSAGE_AUTHOR_REQUIRED You are not the author of this message
|
||||
MESSAGE_DELETE_FORBIDDEN You don't have rights to delete messages in this chat, most likely because you are not the author of them
|
||||
NOT_ALLOWED Not allowed
|
||||
NOT_ELIGIBLE You are not eligible for this action
|
||||
PARTICIPANT_JOIN_MISSING Trying to enable a presentation, when the user hasn't joined the Video Chat with phone.joinGroupCall
|
||||
POLL_VOTE_REQUIRED Cast a vote in the poll before calling this method
|
||||
PREMIUM_ACCOUNT_REQUIRED This action requires a premium account
|
||||
PRIVACY_PREMIUM_REQUIRED The user has restricted from sending messages OR This action requires a premium account
|
||||
PUBLIC_CHANNEL_MISSING You can only export group call invite links for public chats or channels
|
||||
RIGHT_FORBIDDEN You don't have enough rights for this action, or you tried to set one or more admin rights that can't be applied to this kind of chat (channel or supergroup)
|
||||
SENSITIVE_CHANGE_FORBIDDEN Your sensitive content settings can't be changed at this time
|
||||
TAKEOUT_REQUIRED The method must be invoked inside a takeout session
|
||||
USER_BOT_INVALID This method can only be called by a bot
|
||||
USER_CHANNELS_TOO_MUCH One of the users you tried to add is already in too many channels/supergroups
|
||||
USER_DELETED You can't send this secret message because the other participant deleted their account
|
||||
USER_INVALID The provided user is invalid
|
||||
USER_IS_BLOCKED The user is blocked
|
||||
USER_NOT_MUTUAL_CONTACT The provided user is not a mutual contact
|
||||
|
|
@ -40,8 +35,6 @@ CHAT_SEND_STICKERS_FORBIDDEN You can't send stickers in this chat
|
|||
CHAT_SEND_VIDEOS_FORBIDDEN You can't send videos in this chat
|
||||
CHAT_SEND_VOICES_FORBIDDEN You can't send voice recordings in this chat
|
||||
CHAT_WRITE_FORBIDDEN You can't write in this chat
|
||||
GROUPCALL_ALREADY_STARTED The groupcall has already started, you can join directly using phone.joinGroupCall
|
||||
GROUPCALL_FORBIDDEN The group call has already ended
|
||||
LIVE_DISABLED Story is disabled server-side
|
||||
CHAT_GUEST_SEND_FORBIDDEN You need to join the discussion group before commenting
|
||||
ALLOW_PAYMENT_REQUIRED_X Payment of {value} stars is required to perform this action
|
||||
|
|
|
@ -2,22 +2,14 @@ id message
|
|||
AUTH_KEY_DUPLICATED The same authorization key (session file) was used in more than one place simultaneously. You must delete your session file and log in again with your phone number or bot token
|
||||
CHANNEL_PRIVATE The channel/supergroup is not accessible
|
||||
CHANNEL_TOO_LARGE Сhannel is too large to be deleted. Contact support for removal
|
||||
CHAT_FORWARDS_RESTRICTED You can't forward messages from a protected chat
|
||||
FILEREF_UPGRADE_NEEDED The file reference has expired and you must use a refreshed one by obtaining the original media message
|
||||
FRESH_CHANGE_ADMINS_FORBIDDEN You were just elected admin, you can't add or modify other admins yet
|
||||
FRESH_CHANGE_PHONE_FORBIDDEN You can't change your phone number because your session was logged-in recently
|
||||
FRESH_RESET_AUTHORISATION_FORBIDDEN You can't terminate other authorized sessions because the current was logged-in recently
|
||||
GIFTCODE_NOT_ALLOWED Giftcode not allowed
|
||||
INVITE_HASH_EXPIRED The chat the user tried to join has expired and is not valid anymore
|
||||
PHONE_NUMBER_INVALID The phone number is invalid
|
||||
PHONE_PASSWORD_FLOOD You have tried to log-in too many times
|
||||
PREMIUM_CURRENTLY_UNAVAILABLE Premium currently unavailable
|
||||
PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN Similar to a flood wait, must wait {value} minutes
|
||||
SEND_CODE_UNAVAILABLE Returned when all available options for this type of number were already used (e.g. flash-call, then SMS, then this error might be returned to trigger a second resend)
|
||||
PREMIUM_GIFTCODE_WAS_REFUNDED This gift code can't be redeemed because the giveaway organizer requested a refund
|
||||
STICKERSET_INVALID The sticker set is invalid
|
||||
STICKERSET_OWNER_ANONYMOUS This sticker set can't be used as the group's sticker set because it was created by one of its anonymous admins
|
||||
UPDATE_APP_TO_LOGIN Update app to login
|
||||
USERPIC_PRIVACY_REQUIRED You need to disable privacy settings for your profile picture in order to make your geolocation public
|
||||
USERPIC_UPLOAD_REQUIRED You must have a profile picture to publish your geolocation
|
||||
USER_RESTRICTED You are limited/restricted. You can't perform this action
|
||||
USER_RESTRICTED You are limited/restricted. You can't perform this action
|
||||
|
|
|
@ -2,7 +2,6 @@ id message
|
|||
2FA_CONFIRM_WAIT_X A wait of {value} seconds is required because this account is active and protected by a 2FA password
|
||||
FLOOD_TEST_PHONE_WAIT_X A wait of {value} seconds is required in the test servers
|
||||
FLOOD_WAIT_X A wait of {value} seconds is required
|
||||
FLOOD_PREMIUM_WAIT_X A wait of {value} seconds is required
|
||||
PREMIUM_SUB_ACTIVE_UNTIL_X A wait of {value} seconds is required
|
||||
SLOWMODE_WAIT_X A wait of {value} seconds is required to send messages in this chat
|
||||
STORY_SEND_FLOOD_X A wait of {value} seconds is required to continue posting stories
|
||||
|
|
|
|||
|
|
|
@ -38,7 +38,6 @@ RPC_MCGET_FAIL Telegram is having internal problems. Please try again later
|
|||
SIGN_IN_FAILED Failure while signing in due to Telegram having internal problems. Please try again later
|
||||
STORAGE_CHECK_FAILED Server storage check failed due to Telegram having internal problems. Please try again later
|
||||
STORE_INVALID_SCALAR_TYPE Telegram is having internal problems. Please try again later
|
||||
TIMEOUT A timeout occurred while fetching data from the worker
|
||||
UNKNOWN_METHOD The method you tried to call cannot be called on non-CDN DCs
|
||||
UPLOAD_NO_VOLUME Telegram is having internal problems. Please try again later
|
||||
VOLUME_LOC_NOT_FOUND Telegram is having internal problems. Please try again later
|
||||
|
|
|
|||
|
|
|
@ -1,7 +1,5 @@
|
|||
.. raw:: html
|
||||
|
||||
<blockquote>
|
||||
<strong>Usable by</strong>
|
||||
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Users</span>
|
||||
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>
|
||||
</blockquote>
|
||||
<strong>Usable by</strong>
|
||||
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Users</span>
|
||||
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
.. raw:: html
|
||||
|
||||
<blockquote>
|
||||
<strong>Usable by</strong>
|
||||
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
|
||||
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>
|
||||
</blockquote>
|
||||
<strong>Usable by</strong>
|
||||
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
|
||||
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Bots</span>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
.. raw:: html
|
||||
|
||||
<blockquote>
|
||||
<strong>Usable by</strong>
|
||||
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
|
||||
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Bots</span>
|
||||
</blockquote>
|
||||
<strong>Usable by</strong>
|
||||
<span class="usable-by"><i class="fa-solid fa-check" style="color: var(--color-green)"></i> Users</span>
|
||||
<span class="usable-by"><i class="fa-solid fa-xmark" style="color: var(--color-red)"></i> Bots</span>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ This page is about the Client class, which exposes high-level methods for an eas
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -21,4 +21,4 @@ This page is about the Client class, which exposes high-level methods for an eas
|
|||
Details
|
||||
-------
|
||||
|
||||
.. autoclass:: pyrogram.Client()
|
||||
.. autoclass:: pyrofork.Client()
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@ Decorators
|
|||
|
||||
Decorators are able to register callback functions for handling updates in a much easier and cleaner way compared to
|
||||
:doc:`Handlers <handlers>`; they do so by instantiating the correct handler and calling
|
||||
:meth:`~pyrogram.Client.add_handler` automatically. All you need to do is adding the decorators on top of your
|
||||
:meth:`~pyrofork.Client.add_handler` automatically. All you need to do is adding the decorators on top of your
|
||||
functions.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ functions.
|
|||
|
||||
-----
|
||||
|
||||
.. currentmodule:: pyrogram
|
||||
.. currentmodule:: pyrofork
|
||||
|
||||
Index
|
||||
-----
|
||||
|
|
@ -35,14 +35,9 @@ Index
|
|||
.. hlist::
|
||||
:columns: 3
|
||||
|
||||
- :meth:`~Client.on_bot_business_connect`
|
||||
- :meth:`~Client.on_message`
|
||||
- :meth:`~Client.on_bot_business_message`
|
||||
- :meth:`~Client.on_edited_message`
|
||||
- :meth:`~Client.on_edited_bot_business_message`
|
||||
- :meth:`~Client.on_callback_query`
|
||||
- :meth:`~Client.on_shipping_query`
|
||||
- :meth:`~Client.on_pre_checkout_query`
|
||||
- :meth:`~Client.on_message_reaction_updated`
|
||||
- :meth:`~Client.on_message_reaction_count_updated`
|
||||
- :meth:`~Client.on_inline_query`
|
||||
|
|
@ -50,13 +45,11 @@ Index
|
|||
- :meth:`~Client.on_chat_member_updated`
|
||||
- :meth:`~Client.on_chat_join_request`
|
||||
- :meth:`~Client.on_deleted_messages`
|
||||
- :meth:`~Client.on_deleted_bot_business_message`
|
||||
- :meth:`~Client.on_user_status`
|
||||
- :meth:`~Client.on_story`
|
||||
- :meth:`~Client.on_poll`
|
||||
- :meth:`~Client.on_disconnect`
|
||||
- :meth:`~Client.on_raw_update`
|
||||
- :meth:`~Client.on_error`
|
||||
|
||||
-----
|
||||
|
||||
|
|
@ -64,25 +57,18 @@ Details
|
|||
-------
|
||||
|
||||
.. Decorators
|
||||
.. autodecorator:: pyrogram.Client.on_bot_business_connect()
|
||||
.. autodecorator:: pyrogram.Client.on_message()
|
||||
.. autodecorator:: pyrogram.Client.on_bot_business_message()
|
||||
.. autodecorator:: pyrogram.Client.on_edited_message()
|
||||
.. autodecorator:: pyrogram.Client.on_edited_bot_business_message()
|
||||
.. autodecorator:: pyrogram.Client.on_callback_query()
|
||||
.. autodecorator:: pyrogram.Client.on_shipping_query()
|
||||
.. autodecorator:: pyrogram.Client.on_pre_checkout_query()
|
||||
.. autodecorator:: pyrogram.Client.on_message_reaction_updated()
|
||||
.. autodecorator:: pyrogram.Client.on_message_reaction_count_updated()
|
||||
.. autodecorator:: pyrogram.Client.on_inline_query()
|
||||
.. autodecorator:: pyrogram.Client.on_chosen_inline_result()
|
||||
.. autodecorator:: pyrogram.Client.on_chat_member_updated()
|
||||
.. autodecorator:: pyrogram.Client.on_chat_join_request()
|
||||
.. autodecorator:: pyrogram.Client.on_deleted_messages()
|
||||
.. autodecorator:: pyrogram.Client.on_deleted_bot_business_message()
|
||||
.. autodecorator:: pyrogram.Client.on_user_status()
|
||||
.. autodecorator:: pyrogram.Client.on_story()
|
||||
.. autodecorator:: pyrogram.Client.on_poll()
|
||||
.. autodecorator:: pyrogram.Client.on_disconnect()
|
||||
.. autodecorator:: pyrogram.Client.on_raw_update()
|
||||
.. autodecorator:: pyrogram.Client.on_error()
|
||||
.. autodecorator:: pyrofork.Client.on_message()
|
||||
.. autodecorator:: pyrofork.Client.on_edited_message()
|
||||
.. autodecorator:: pyrofork.Client.on_callback_query()
|
||||
.. autodecorator:: pyrofork.Client.on_message_reaction_updated()
|
||||
.. autodecorator:: pyrofork.Client.on_message_reaction_count_updated()
|
||||
.. autodecorator:: pyrofork.Client.on_inline_query()
|
||||
.. autodecorator:: pyrofork.Client.on_chosen_inline_result()
|
||||
.. autodecorator:: pyrofork.Client.on_chat_member_updated()
|
||||
.. autodecorator:: pyrofork.Client.on_chat_join_request()
|
||||
.. autodecorator:: pyrofork.Client.on_deleted_messages()
|
||||
.. autodecorator:: pyrofork.Client.on_user_status()
|
||||
.. autodecorator:: pyrofork.Client.on_story()
|
||||
.. autodecorator:: pyrofork.Client.on_poll()
|
||||
.. autodecorator:: pyrofork.Client.on_disconnect()
|
||||
.. autodecorator:: pyrofork.Client.on_raw_update()
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
BusinessSchedule
|
||||
==========
|
||||
|
||||
.. autoclass:: pyrogram.enums.BusinessSchedule()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
ChatAction
|
||||
==========
|
||||
|
||||
.. autoclass:: pyrogram.enums.ChatAction()
|
||||
.. autoclass:: pyrofork.enums.ChatAction()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
ChatEventAction
|
||||
===============
|
||||
|
||||
.. autoclass:: pyrogram.enums.ChatEventAction()
|
||||
.. autoclass:: pyrofork.enums.ChatEventAction()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
ChatJoinType
|
||||
==========
|
||||
|
||||
.. autoclass:: pyrogram.enums.ChatJoinType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
ChatMemberStatus
|
||||
================
|
||||
|
||||
.. autoclass:: pyrogram.enums.ChatMemberStatus()
|
||||
.. autoclass:: pyrofork.enums.ChatMemberStatus()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
ChatMembersFilter
|
||||
=================
|
||||
|
||||
.. autoclass:: pyrogram.enums.ChatMembersFilter()
|
||||
.. autoclass:: pyrofork.enums.ChatMembersFilter()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
ChatType
|
||||
========
|
||||
|
||||
.. autoclass:: pyrogram.enums.ChatType()
|
||||
.. autoclass:: pyrofork.enums.ChatType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
ClientPlatform
|
||||
==========
|
||||
|
||||
.. autoclass:: pyrogram.enums.ClientPlatform()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
FolderColor
|
||||
===========
|
||||
|
||||
.. autoclass:: pyrogram.enums.FolderColor()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
GiftAttributeType
|
||||
==========
|
||||
|
||||
.. autoclass:: pyrogram.enums.GiftAttributeType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
GiftAttributeType
|
||||
=================
|
||||
|
||||
.. autoclass:: pyrogram.enums.GiftForResaleOrder()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
ListenerTypes
|
||||
=============
|
||||
|
||||
.. autoclass:: pyrogram.enums.ListenerTypes()
|
||||
.. autoclass:: pyrofork.enums.ListenerTypes()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
MessageEntityType
|
||||
=================
|
||||
|
||||
.. autoclass:: pyrogram.enums.MessageEntityType()
|
||||
.. autoclass:: pyrofork.enums.MessageEntityType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
MessageMediaType
|
||||
================
|
||||
|
||||
.. autoclass:: pyrogram.enums.MessageMediaType()
|
||||
.. autoclass:: pyrofork.enums.MessageMediaType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
MessageOriginType
|
||||
=================
|
||||
|
||||
.. autoclass:: pyrogram.enums.MessageOriginType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
MessageServiceType
|
||||
==================
|
||||
|
||||
.. autoclass:: pyrogram.enums.MessageServiceType()
|
||||
.. autoclass:: pyrofork.enums.MessageServiceType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
MessagesFilter
|
||||
==============
|
||||
|
||||
.. autoclass:: pyrogram.enums.MessagesFilter()
|
||||
.. autoclass:: pyrofork.enums.MessagesFilter()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
NextCodeType
|
||||
============
|
||||
|
||||
.. autoclass:: pyrogram.enums.NextCodeType()
|
||||
.. autoclass:: pyrofork.enums.NextCodeType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
ParseMode
|
||||
=========
|
||||
|
||||
.. autoclass:: pyrogram.enums.ParseMode()
|
||||
.. autoclass:: pyrofork.enums.ParseMode()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
PollType
|
||||
========
|
||||
|
||||
.. autoclass:: pyrogram.enums.PollType()
|
||||
.. autoclass:: pyrofork.enums.PollType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
ProfileColor
|
||||
==========
|
||||
|
||||
.. autoclass:: pyrogram.enums.ProfileColor()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
ReactionType
|
||||
============
|
||||
|
||||
.. autoclass:: pyrogram.enums.ReactionType()
|
||||
.. autoclass:: pyrofork.enums.ReactionType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
ReplyColor
|
||||
==========
|
||||
|
||||
.. autoclass:: pyrogram.enums.ReplyColor()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
:file: ./cleanup.html
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
SentCodeType
|
||||
============
|
||||
|
||||
.. autoclass:: pyrogram.enums.SentCodeType()
|
||||
.. autoclass:: pyrofork.enums.SentCodeType()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
StoriesPrivacyRules
|
||||
===================
|
||||
|
||||
.. autoclass:: pyrogram.enums.StoriesPrivacyRules()
|
||||
.. autoclass:: pyrofork.enums.StoriesPrivacyRules()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
StoryPrivacy
|
||||
============
|
||||
|
||||
.. autoclass:: pyrogram.enums.StoryPrivacy()
|
||||
.. autoclass:: pyrofork.enums.StoryPrivacy()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
UserStatus
|
||||
==========
|
||||
|
||||
.. autoclass:: pyrogram.enums.UserStatus()
|
||||
.. autoclass:: pyrofork.enums.UserStatus()
|
||||
:members:
|
||||
|
||||
.. raw:: html
|
||||
|
|
|
|||
|
|
@ -8,21 +8,16 @@ to apply only a valid value among the expected ones.
|
|||
|
||||
-----
|
||||
|
||||
.. currentmodule:: pyrogram.enums
|
||||
.. currentmodule:: pyrofork.enums
|
||||
|
||||
.. autosummary::
|
||||
:nosignatures:
|
||||
|
||||
BusinessSchedule
|
||||
ChatAction
|
||||
ChatEventAction
|
||||
ChatJoinType
|
||||
ChatMemberStatus
|
||||
ChatMembersFilter
|
||||
ChatType
|
||||
ClientPlatform
|
||||
FolderColor
|
||||
GiftAttributeType
|
||||
ListenerTypes
|
||||
MessageEntityType
|
||||
MessageMediaType
|
||||
|
|
@ -30,28 +25,21 @@ to apply only a valid value among the expected ones.
|
|||
MessagesFilter
|
||||
ParseMode
|
||||
PollType
|
||||
ProfileColor
|
||||
SentCodeType
|
||||
NextCodeType
|
||||
UserStatus
|
||||
ReactionType
|
||||
ReplyColor
|
||||
StoriesPrivacyRules
|
||||
StoryPrivacy
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
||||
BusinessSchedule
|
||||
ChatAction
|
||||
ChatEventAction
|
||||
ChatJoinType
|
||||
ChatMemberStatus
|
||||
ChatMembersFilter
|
||||
ChatType
|
||||
ClientPlatform
|
||||
FolderColor
|
||||
GiftAttributeType
|
||||
ListenerTypes
|
||||
MessageEntityType
|
||||
MessageMediaType
|
||||
|
|
@ -59,11 +47,9 @@ to apply only a valid value among the expected ones.
|
|||
MessagesFilter
|
||||
ParseMode
|
||||
PollType
|
||||
ProfileColor
|
||||
SentCodeType
|
||||
NextCodeType
|
||||
UserStatus
|
||||
ReactionType
|
||||
ReplyColor
|
||||
StoriesPrivacyRules
|
||||
StoryPrivacy
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
RPC Errors
|
||||
==========
|
||||
|
||||
All Pyrofork API errors live inside the ``errors`` sub-package: ``pyrogram.errors``.
|
||||
All Pyrofork API errors live inside the ``errors`` sub-package: ``pyrofork.errors``.
|
||||
The errors ids listed here are shown as *UPPER_SNAKE_CASE*, but the actual exception names to import from Pyrofork
|
||||
follow the usual *PascalCase* convention.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram.errors import FloodWait
|
||||
from pyrofork.errors import FloodWait
|
||||
|
||||
try:
|
||||
...
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ Filters are objects that can be used to filter the content of incoming updates.
|
|||
Details
|
||||
-------
|
||||
|
||||
.. automodule:: pyrogram.filters
|
||||
.. automodule:: pyrofork.filters
|
||||
:members:
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ For a much more convenient way of registering callback functions have a look at
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrogram.handlers import MessageHandler
|
||||
from pyrofork import Client
|
||||
from pyrofork.handlers import MessageHandler
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ For a much more convenient way of registering callback functions have a look at
|
|||
|
||||
-----
|
||||
|
||||
.. currentmodule:: pyrogram.handlers
|
||||
.. currentmodule:: pyrofork.handlers
|
||||
|
||||
Index
|
||||
-----
|
||||
|
|
@ -35,16 +35,10 @@ Index
|
|||
.. hlist::
|
||||
:columns: 3
|
||||
|
||||
- :class:`BotBusinessConnectHandler`
|
||||
- :class:`MessageHandler`
|
||||
- :class:`BotBusinessMessageHandler`
|
||||
- :class:`EditedMessageHandler`
|
||||
- :class:`EditedBotBusinessMessageHandler`
|
||||
- :class:`DeletedMessagesHandler`
|
||||
- :class:`DeletedBotBusinessMessagesHandler`
|
||||
- :class:`CallbackQueryHandler`
|
||||
- :class:`PreCheckoutQueryHandler`
|
||||
- :class:`ShippingQueryHandler`
|
||||
- :class:`MessageReactionUpdatedHandler`
|
||||
- :class:`MessageReactionCountUpdatedHandler`
|
||||
- :class:`InlineQueryHandler`
|
||||
|
|
@ -55,7 +49,6 @@ Index
|
|||
- :class:`PollHandler`
|
||||
- :class:`DisconnectHandler`
|
||||
- :class:`RawUpdateHandler`
|
||||
- :class:`ErrorHandler`
|
||||
|
||||
-----
|
||||
|
||||
|
|
@ -63,16 +56,10 @@ Details
|
|||
-------
|
||||
|
||||
.. Handlers
|
||||
.. autoclass:: BotBusinessConnectHandler()
|
||||
.. autoclass:: MessageHandler()
|
||||
.. autoclass:: BotBusinessMessageHandler()
|
||||
.. autoclass:: EditedMessageHandler()
|
||||
.. autoclass:: EditedBotBusinessMessageHandler()
|
||||
.. autoclass:: DeletedMessagesHandler()
|
||||
.. autoclass:: DeletedBotBusinessMessagesHandler()
|
||||
.. autoclass:: CallbackQueryHandler()
|
||||
.. autoclass:: ShippingQueryHandler()
|
||||
.. autoclass:: PreCheckoutQueryHandler()
|
||||
.. autoclass:: MessageReactionUpdatedHandler()
|
||||
.. autoclass:: MessageReactionCountUpdatedHandler()
|
||||
.. autoclass:: InlineQueryHandler()
|
||||
|
|
@ -83,4 +70,3 @@ Details
|
|||
.. autoclass:: PollHandler()
|
||||
.. autoclass:: DisconnectHandler()
|
||||
.. autoclass:: RawUpdateHandler()
|
||||
.. autoclass:: ErrorHandler()
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@ import sys
|
|||
|
||||
sys.path.insert(0, os.path.abspath("../.."))
|
||||
|
||||
from pyrogram import __version__
|
||||
from pyrofork import __version__
|
||||
|
||||
from pygments.styles.friendly import FriendlyStyle
|
||||
|
||||
FriendlyStyle.background_color = "#f3f2f1"
|
||||
|
||||
project = "Pyrofork"
|
||||
copyright = "2022-present, Mayuri-Chan"
|
||||
copyright = f"2022-present, Mayuri-Chan"
|
||||
author = "Mayuri-Chan"
|
||||
|
||||
version = ".".join(__version__.split(".")[:-1])
|
||||
|
|
@ -73,7 +73,7 @@ html_theme_options = {
|
|||
"repo": "fontawesome/brands/github",
|
||||
"edit": "material/file-edit-outline",
|
||||
},
|
||||
"site_url": "https://pyrofork.wulan17.dev/",
|
||||
"site_url": "https://pyrofork.mayuri.my.id/",
|
||||
"repo_url": "https://github.com/Mayuri-Chan/pyrofork/",
|
||||
"repo_name": "pyrofork",
|
||||
"globaltoc_collapse": True,
|
||||
|
|
@ -102,11 +102,11 @@ html_theme_options = {
|
|||
],
|
||||
}
|
||||
|
||||
html_logo = "../resources/static/img/pyrogram.png"
|
||||
html_logo = "../resources/static/img/pyrofork.png"
|
||||
html_favicon = "../resources/static/img/favicon.ico"
|
||||
|
||||
latex_engine = "xelatex"
|
||||
latex_logo = "../resources/static/img/pyrogram.png"
|
||||
latex_logo = "../resources/static/img/pyrofork.png"
|
||||
|
||||
latex_elements = {
|
||||
"pointsize": "12pt",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ The following shows how to catch the exception in your code and wait the require
|
|||
.. code-block:: python
|
||||
|
||||
import asyncio
|
||||
from pyrogram.errors import FloodWait
|
||||
from pyrofork.errors import FloodWait
|
||||
|
||||
...
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Welcome to Pyrofork
|
|||
|
||||
<div align="center">
|
||||
<a href="/">
|
||||
<h1 class="pyrogram-text pyrogram-text-index">PyroFork</h1>
|
||||
<h1 class="pyrofork-text pyrofork-text-index">Pyrofork</h1>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
|
@ -29,14 +29,14 @@ Welcome to Pyrofork
|
|||
Support Chat
|
||||
</a>
|
||||
•
|
||||
<a href="https://t.me/Pyrofork_CH">
|
||||
<a href="https://t.me/wulan17">
|
||||
News/Releases
|
||||
</a>
|
||||
</p>
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client, filters
|
||||
from pyrofork import Client, filters
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -168,4 +168,4 @@ Meta
|
|||
|
||||
telegram/functions/index
|
||||
telegram/types/index
|
||||
telegram/base/index
|
||||
telegram/base/index
|
||||
|
|
@ -43,8 +43,8 @@ If no error shows up you are good to go.
|
|||
|
||||
.. parsed-literal::
|
||||
|
||||
>>> import pyrogram
|
||||
>>> pyrogram.__version__
|
||||
>>> import pyrofork
|
||||
>>> pyrofork.__version__
|
||||
'x.y.z'
|
||||
|
||||
.. _`Github repo`: http://github.com/Mayuri-Chan/pyrofork
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Get Pyrofork Real Fast
|
|||
.. code-block:: python
|
||||
|
||||
import asyncio
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
api_id = 12345
|
||||
api_hash = "0123456789abcdef0123456789abcdef"
|
||||
|
|
|
|||
|
|
@ -16,12 +16,12 @@ User Authorization
|
|||
|
||||
In order to use the API, Telegram requires that users be authorized via their phone numbers.
|
||||
Pyrofork automatically manages this process, all you need to do is create an instance of the
|
||||
:class:`~pyrogram.Client` class by passing to it a ``name`` of your choice (e.g.: "my_account") and call
|
||||
the :meth:`~pyrogram.Client.run` method:
|
||||
:class:`~pyrofork.Client` class by passing to it a ``name`` of your choice (e.g.: "my_account") and call
|
||||
the :meth:`~pyrofork.Client.run` method:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
api_id = 12345
|
||||
api_hash = "0123456789abcdef0123456789abcdef"
|
||||
|
|
@ -63,7 +63,7 @@ after the session name, which will be ``my_bot.session`` for the example below.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
api_id = 12345
|
||||
api_hash = "0123456789abcdef0123456789abcdef"
|
||||
|
|
@ -87,7 +87,7 @@ after the session name, which will be ``my_bot.session`` for the example below.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
app.run()
|
||||
|
|
@ -6,7 +6,7 @@ Pyrofork errors all live inside the ``errors`` package:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import errors
|
||||
from pyrofork import errors
|
||||
|
||||
.. contents:: Contents
|
||||
:backlinks: none
|
||||
|
|
@ -23,7 +23,7 @@ This error is raised every time a method call against Telegram's API was unsucce
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram.errors import RPCError
|
||||
from pyrofork.errors import RPCError
|
||||
|
||||
.. warning::
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ provides categories of errors, which are named after the common HTTP errors and
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram.errors import BadRequest, Forbidden, ...
|
||||
from pyrofork.errors import BadRequest, Forbidden, ...
|
||||
|
||||
- :doc:`303 - SeeOther <../api/errors/see-other>`
|
||||
- :doc:`400 - BadRequest <../api/errors/bad-request>`
|
||||
|
|
@ -56,7 +56,7 @@ issue. For example:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram.errors import FloodWait
|
||||
from pyrofork.errors import FloodWait
|
||||
|
||||
These errors subclass directly from the category of errors they belong to, which in turn subclass from the father
|
||||
``RPCError``, thus building a class of error hierarchy such as this:
|
||||
|
|
@ -91,7 +91,7 @@ The value is stored in the ``value`` attribute of the exception object:
|
|||
.. code-block:: python
|
||||
|
||||
import asyncio
|
||||
from pyrogram.errors import FloodWait
|
||||
from pyrofork.errors import FloodWait
|
||||
|
||||
...
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ like send_audio(), send_document(), send_location(), etc...
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrogram.types import (ReplyKeyboardMarkup, InlineKeyboardMarkup,
|
||||
from pyrofork import Client
|
||||
from pyrofork.types import (ReplyKeyboardMarkup, InlineKeyboardMarkup,
|
||||
InlineKeyboardButton)
|
||||
|
||||
# Create a client using your bot token
|
||||
|
|
@ -47,17 +47,17 @@ like send_audio(), send_document(), send_location(), etc...
|
|||
),
|
||||
InlineKeyboardButton( # Opens a web URL
|
||||
"URL",
|
||||
url="https://pyrofork.wulan17.dev"
|
||||
url="https://pyrofork.mayuri.my.id"
|
||||
),
|
||||
],
|
||||
[ # Second row
|
||||
InlineKeyboardButton( # Opens the inline interface
|
||||
"Choose chat",
|
||||
switch_inline_query="pyrogram"
|
||||
switch_inline_query="pyrofork"
|
||||
),
|
||||
InlineKeyboardButton( # Opens the inline interface in the current chat
|
||||
"Inline here",
|
||||
switch_inline_query_current_chat="pyrogram"
|
||||
switch_inline_query_current_chat="pyrofork"
|
||||
)
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ It uses the @on_callback_query decorator to register a CallbackQueryHandler.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_bot", bot_token="123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11")
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ It uses the ``@on_message`` decorator to register a ``MessageHandler`` and appli
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client, filters
|
||||
from pyrofork import Client, filters
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ This example shows how to get the full message history of a chat, starting from
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ This example shows how to get all the members of a chat.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
# Target channel/supergroup
|
||||
TARGET = -100123456789
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ This example shows how to get the full dialogs list (as user).
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ This example demonstrates a basic API usage
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
# Create a new Client instance
|
||||
app = Client("my_account")
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ to give you a basic idea.
|
|||
:doc:`bot_keyboards`, "Send normal and inline keyboards using regular bots"
|
||||
:doc:`raw_updates`, "Handle raw updates (old, should be avoided)"
|
||||
|
||||
For more advanced examples, see https://snippets.pyrogram.org.
|
||||
For more advanced examples, see https://snippets.pyrofork.org.
|
||||
|
||||
.. toctree::
|
||||
:hidden:
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ inline_queries
|
|||
|
||||
This example shows how to handle inline queries.
|
||||
|
||||
Two results are generated when users invoke the bot inline mode, e.g.: @pyrogrambot hi.
|
||||
Two results are generated when users invoke the bot inline mode, e.g.: @pyroforkbot hi.
|
||||
It uses the @on_inline_query decorator to register an InlineQueryHandler.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrogram.types import (InlineQueryResultArticle, InputTextMessageContent,
|
||||
from pyrofork import Client
|
||||
from pyrofork.types import (InlineQueryResultArticle, InputTextMessageContent,
|
||||
InlineKeyboardMarkup, InlineKeyboardButton)
|
||||
|
||||
app = Client("my_bot", bot_token="123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11")
|
||||
|
|
@ -24,13 +24,13 @@ It uses the @on_inline_query decorator to register an InlineQueryHandler.
|
|||
input_message_content=InputTextMessageContent(
|
||||
"Here's how to install **Pyrofork**"
|
||||
),
|
||||
url="https://pyrofork.wulan17.dev/intro/install",
|
||||
url="https://pyrofork.mayuri.my.id/intro/install",
|
||||
description="How to install Pyrofork",
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[InlineKeyboardButton(
|
||||
"Open website",
|
||||
url="https://pyrofork.wulan17.dev/intro/install"
|
||||
url="https://pyrofork.mayuri.my.id/intro/install"
|
||||
)]
|
||||
]
|
||||
)
|
||||
|
|
@ -40,13 +40,13 @@ It uses the @on_inline_query decorator to register an InlineQueryHandler.
|
|||
input_message_content=InputTextMessageContent(
|
||||
"Here's how to use **Pyrofork**"
|
||||
),
|
||||
url="https://pyrofork.wulan17.dev/start/invoking",
|
||||
url="https://pyrofork.mayuri.my.id/start/invoking",
|
||||
description="How to use Pyrofork",
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[
|
||||
[InlineKeyboardButton(
|
||||
"Open website",
|
||||
url="https://pyrofork.wulan17.dev/start/invoking"
|
||||
url="https://pyrofork.mayuri.my.id/start/invoking"
|
||||
)]
|
||||
]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ This example shows how to handle raw updates.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ This example shows how to query an inline bot (as user).
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
# Create a new Client
|
||||
app = Client("my_account")
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ to make it only work for specific messages in a specific chat.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client, emoji, filters
|
||||
from pyrofork import Client, emoji, filters
|
||||
|
||||
# Target chat. Can also be a list of multiple chat ids/usernames
|
||||
TARGET = -100123456789
|
||||
# Welcome message template
|
||||
MESSAGE = "{} Welcome to [Pyrofork](https://pyrofork.wulan17.dev/)'s group chat {}!"
|
||||
MESSAGE = "{} Welcome to [Pyrofork](https://pyrofork.mayuri.my.id/)'s group chat {}!"
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Making API calls with Pyrofork is very simple. Here's a basic example we are goi
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ Step-by-step
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
#. Now instantiate a new Client object, "my_account" is a session name of your choice.
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ Step-by-step
|
|||
async with app:
|
||||
await app.send_message("me", "Hi!")
|
||||
|
||||
#. Finally, we tell Python to schedule our ``main()`` async function by using Pyrofork's :meth:`~pyrogram.Client.run`
|
||||
#. Finally, we tell Python to schedule our ``main()`` async function by using Pyrofork's :meth:`~pyrofork.Client.run`
|
||||
method.
|
||||
|
||||
.. code-block:: python
|
||||
|
|
@ -66,15 +66,15 @@ Context Manager
|
|||
---------------
|
||||
|
||||
The ``async with`` statement starts a context manager, which is used as a shortcut for starting, executing and stopping
|
||||
the Client, asynchronously. It does so by automatically calling :meth:`~pyrogram.Client.start` and
|
||||
:meth:`~pyrogram.Client.stop` in a more convenient way which also gracefully stops the client, even in case of
|
||||
the Client, asynchronously. It does so by automatically calling :meth:`~pyrofork.Client.start` and
|
||||
:meth:`~pyrofork.Client.stop` in a more convenient way which also gracefully stops the client, even in case of
|
||||
unhandled exceptions in your code.
|
||||
|
||||
Below there's the same example as above, but without the use of the context manager:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -90,14 +90,14 @@ Below there's the same example as above, but without the use of the context mana
|
|||
Using asyncio.run()
|
||||
-------------------
|
||||
|
||||
Alternatively to the :meth:`~pyrogram.Client.run` method, you can use Python's ``asyncio.run()`` to execute the main
|
||||
Alternatively to the :meth:`~pyrofork.Client.run` method, you can use Python's ``asyncio.run()`` to execute the main
|
||||
function, with one little caveat: the Client instance (and possibly other asyncio resources you are going to use) must
|
||||
be instantiated inside the main function.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import asyncio
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
|
||||
async def main():
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ Having the API key from the previous step in handy, we can now begin to configur
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
api_id = 12345
|
||||
api_hash = "0123456789abcdef0123456789abcdef"
|
||||
|
|
|
|||
|
|
@ -24,18 +24,18 @@ function will be called back by the framework and its body executed.
|
|||
Registering a Handler
|
||||
---------------------
|
||||
|
||||
To explain how handlers work let's examine the one which will be in charge for handling :class:`~pyrogram.types.Message`
|
||||
To explain how handlers work let's examine the one which will be in charge for handling :class:`~pyrofork.types.Message`
|
||||
updates coming from all around your chats. Every other kind of handler shares the same setup logic and you should not
|
||||
have troubles settings them up once you learn from this section.
|
||||
|
||||
Using Decorators
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
The most elegant way to register a message handler is by using the :meth:`~pyrogram.Client.on_message` decorator:
|
||||
The most elegant way to register a message handler is by using the :meth:`~pyrofork.Client.on_message` decorator:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -50,20 +50,20 @@ The most elegant way to register a message handler is by using the :meth:`~pyrog
|
|||
The defined function ``my_handler``, which accepts the two arguments *(client, message)*, will be the function that gets
|
||||
executed every time a new message arrives.
|
||||
|
||||
In the last line we see again the :meth:`~pyrogram.Client.run` method, this time used without any argument.
|
||||
Its purpose here is simply to automatically :meth:`~pyrogram.Client.start`, keep the Client online so that it can listen
|
||||
for updates and :meth:`~pyrogram.Client.stop` it once you hit ``CTRL+C``.
|
||||
In the last line we see again the :meth:`~pyrofork.Client.run` method, this time used without any argument.
|
||||
Its purpose here is simply to automatically :meth:`~pyrofork.Client.start`, keep the Client online so that it can listen
|
||||
for updates and :meth:`~pyrofork.Client.stop` it once you hit ``CTRL+C``.
|
||||
|
||||
Using add_handler()
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The :meth:`~pyrogram.Client.add_handler` method takes any handler instance that wraps around your defined callback
|
||||
The :meth:`~pyrofork.Client.add_handler` method takes any handler instance that wraps around your defined callback
|
||||
function and registers it in your Client. It is useful in case you want to programmatically add handlers.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrogram.handlers import MessageHandler
|
||||
from pyrofork import Client
|
||||
from pyrofork.handlers import MessageHandler
|
||||
|
||||
|
||||
async def my_function(client, message):
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Telegram Raw API
|
|||
----------------
|
||||
|
||||
If you can't find a high-level method for your needs or if you want complete, low-level access to the whole
|
||||
Telegram API, you have to use the raw :mod:`~pyrogram.raw.functions` and :mod:`~pyrogram.raw.types`.
|
||||
Telegram API, you have to use the raw :mod:`~pyrofork.raw.functions` and :mod:`~pyrofork.raw.types`.
|
||||
|
||||
As already hinted, raw functions and types can be less convenient. This section will therefore explain some pitfalls to
|
||||
take into consideration when working with the raw API.
|
||||
|
|
@ -34,11 +34,11 @@ Unlike the :doc:`methods <../api/methods/index>` found in Pyrofork's API, which
|
|||
functions to be invoked from the raw Telegram API have a different way of usage.
|
||||
|
||||
First of all, both :doc:`raw functions <../telegram/functions/index>` and :doc:`raw types <../telegram/types/index>`
|
||||
live in their respective packages (and sub-packages): ``pyrogram.raw.functions``, ``pyrogram.raw.types``. They all exist
|
||||
live in their respective packages (and sub-packages): ``pyrofork.raw.functions``, ``pyrofork.raw.types``. They all exist
|
||||
as Python classes, meaning you need to create an instance of each every time you need them and fill them in with the
|
||||
correct values using named arguments.
|
||||
|
||||
Next, to actually invoke the raw function you have to use the :meth:`~pyrogram.Client.invoke` method provided by the
|
||||
Next, to actually invoke the raw function you have to use the :meth:`~pyrofork.Client.invoke` method provided by the
|
||||
Client class and pass the function object you created.
|
||||
|
||||
Here's some examples:
|
||||
|
|
@ -47,8 +47,8 @@ Here's some examples:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrogram.raw import functions
|
||||
from pyrofork import Client
|
||||
from pyrofork.raw import functions
|
||||
|
||||
async with Client("my_account") as app:
|
||||
await app.invoke(
|
||||
|
|
@ -62,8 +62,8 @@ Here's some examples:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrogram.raw import functions, types
|
||||
from pyrofork import Client
|
||||
from pyrofork.raw import functions, types
|
||||
|
||||
async with Client("my_account") as app:
|
||||
# Set online status
|
||||
|
|
@ -76,8 +76,8 @@ Here's some examples:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrogram.raw import functions, types
|
||||
from pyrofork import Client
|
||||
from pyrofork.raw import functions, types
|
||||
|
||||
async with Client("my_account") as app:
|
||||
r = await app.invoke(
|
||||
|
|
@ -98,12 +98,12 @@ sending messages with IDs only thanks to cached access hashes.
|
|||
There are three different InputPeer types, one for each kind of Telegram entity.
|
||||
Whenever an InputPeer is needed you must pass one of these:
|
||||
|
||||
- :class:`~pyrogram.raw.types.InputPeerUser` - Users
|
||||
- :class:`~pyrogram.raw.types.InputPeerChat` - Basic Chats
|
||||
- :class:`~pyrogram.raw.types.InputPeerChannel` - Channels & Supergroups
|
||||
- :class:`~pyrofork.raw.types.InputPeerUser` - Users
|
||||
- :class:`~pyrofork.raw.types.InputPeerChat` - Basic Chats
|
||||
- :class:`~pyrofork.raw.types.InputPeerChannel` - Channels & Supergroups
|
||||
|
||||
But you don't necessarily have to manually instantiate each object because Pyrofork already provides
|
||||
:meth:`~pyrogram.Client.resolve_peer` as a convenience utility method that returns the correct InputPeer
|
||||
:meth:`~pyrofork.Client.resolve_peer` as a convenience utility method that returns the correct InputPeer
|
||||
by accepting a peer ID only.
|
||||
|
||||
Another thing to take into consideration about chat IDs is the way they are represented: they are all integers and
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
Creating Filters
|
||||
================
|
||||
|
||||
Pyrofork already provides lots of built-in :class:`~pyrogram.filters` to work with, but in case you can't find a
|
||||
Pyrofork already provides lots of built-in :class:`~pyrofork.filters` to work with, but in case you can't find a
|
||||
specific one for your needs or want to build a custom filter by yourself you can use
|
||||
:meth:`filters.create() <pyrogram.filters.create>`.
|
||||
:meth:`filters.create() <pyrofork.filters.create>`.
|
||||
|
||||
.. contents:: Contents
|
||||
:backlinks: none
|
||||
|
|
@ -16,40 +16,40 @@ Custom Filters
|
|||
--------------
|
||||
|
||||
An example to demonstrate how custom filters work is to show how to create and use one for the
|
||||
:class:`~pyrogram.handlers.CallbackQueryHandler`. Note that callback queries updates are only received by bots as result
|
||||
:class:`~pyrofork.handlers.CallbackQueryHandler`. Note that callback queries updates are only received by bots as result
|
||||
of a user pressing an inline button attached to the bot's message; create and :doc:`authorize your bot <../start/auth>`,
|
||||
then send a message with an inline keyboard to yourself. This allows you to test your filter by pressing the inline
|
||||
button:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from pyrofork.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
|
||||
await app.send_message(
|
||||
"username", # Change this to your username or id
|
||||
"Pyrofork custom filter test",
|
||||
reply_markup=InlineKeyboardMarkup(
|
||||
[[InlineKeyboardButton("Press me", "pyrogram")]]
|
||||
[[InlineKeyboardButton("Press me", "pyrofork")]]
|
||||
)
|
||||
)
|
||||
|
||||
Basic Filters
|
||||
-------------
|
||||
|
||||
For this basic filter we will be using only the first parameter of :meth:`~pyrogram.filters.create`.
|
||||
For this basic filter we will be using only the first parameter of :meth:`~pyrofork.filters.create`.
|
||||
|
||||
The heart of a filter is its callback function, which accepts three arguments *(self, client, update)* and returns
|
||||
either ``True``, in case you want the update to pass the filter or ``False`` otherwise.
|
||||
|
||||
In this example we are matching the query data to "pyrogram", which means that the filter will only allow callback
|
||||
queries containing "pyrogram" as data:
|
||||
In this example we are matching the query data to "pyrofork", which means that the filter will only allow callback
|
||||
queries containing "pyrofork" as data:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import filters
|
||||
from pyrofork import filters
|
||||
|
||||
async def func(_, __, query):
|
||||
return query.data == "pyrogram"
|
||||
return query.data == "pyrofork"
|
||||
|
||||
static_data_filter = filters.create(func)
|
||||
|
||||
|
|
@ -61,14 +61,14 @@ Finally, the filter usage remains the same:
|
|||
.. code-block:: python
|
||||
|
||||
@app.on_callback_query(static_data_filter)
|
||||
async def pyrogram_data(_, query):
|
||||
async def pyrofork_data(_, query):
|
||||
query.answer("it works!")
|
||||
|
||||
Filters with Arguments
|
||||
----------------------
|
||||
|
||||
A more flexible filter would be one that accepts "pyrogram" or any other string as argument at usage time.
|
||||
A dynamic filter like this will make use of named arguments for the :meth:`~pyrogram.filters.create` method and the
|
||||
A more flexible filter would be one that accepts "pyrofork" or any other string as argument at usage time.
|
||||
A dynamic filter like this will make use of named arguments for the :meth:`~pyrofork.filters.create` method and the
|
||||
first argument of the callback function, which is a reference to the filter object itself holding the extra data passed
|
||||
via named arguments.
|
||||
|
||||
|
|
@ -76,7 +76,7 @@ This is how a dynamic custom filter looks like:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import filters
|
||||
from pyrofork import filters
|
||||
|
||||
def dynamic_data_filter(data):
|
||||
async def func(flt, _, query):
|
||||
|
|
@ -89,8 +89,8 @@ And finally its usage:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
@app.on_callback_query(dynamic_data_filter("pyrogram"))
|
||||
async def pyrogram_data(_, query):
|
||||
@app.on_callback_query(dynamic_data_filter("pyrofork"))
|
||||
async def pyrofork_data(_, query):
|
||||
query.answer("it works!")
|
||||
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ Method Calls Inside Filters
|
|||
---------------------------
|
||||
|
||||
The missing piece we haven't covered yet is the second argument of a filter callback function, namely, the ``client``
|
||||
argument. This is a reference to the :obj:`~pyrogram.Client` instance that is running the filter and it is useful in
|
||||
argument. This is a reference to the :obj:`~pyrofork.Client` instance that is running the filter and it is useful in
|
||||
case you would like to make some API calls before deciding whether the filter should allow the update or not:
|
||||
|
||||
.. code-block:: python
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ Consider the following code:
|
|||
me = await app.get_users("me")
|
||||
print(me) # User
|
||||
|
||||
This will show a JSON representation of the object returned by :meth:`~pyrogram.Client.get_users`, which is a
|
||||
:class:`~pyrogram.types.User` instance, in this case. The output on your terminal will be something similar to this:
|
||||
This will show a JSON representation of the object returned by :meth:`~pyrofork.Client.get_users`, which is a
|
||||
:class:`~pyrofork.types.User` instance, in this case. The output on your terminal will be something similar to this:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
|
|
@ -96,14 +96,14 @@ error. The correct way to get the object type is by using the built-in function
|
|||
|
||||
.. code-block:: text
|
||||
|
||||
<class 'pyrogram.types.UserStatus'>
|
||||
<class 'pyrofork.types.UserStatus'>
|
||||
|
||||
And to check if an object is an instance of a given class, you use the built-in function ``isinstance()``:
|
||||
|
||||
.. code-block:: python
|
||||
:name: this-py
|
||||
|
||||
from pyrogram.types import UserStatus
|
||||
from pyrofork.types import UserStatus
|
||||
|
||||
status = me.status
|
||||
print(isinstance(status, UserStatus))
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ Or, if you want ``just_text`` to be executed *before* ``text_or_sticker`` (note
|
|||
async def just_text(client, message):
|
||||
print("Just Text")
|
||||
|
||||
With :meth:`~pyrogram.Client.add_handler` (without decorators) the same can be achieved with:
|
||||
With :meth:`~pyrofork.Client.add_handler` (without decorators) the same can be achieved with:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ Example with ``raise StopPropagation``:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import StopPropagation
|
||||
from pyrofork import StopPropagation
|
||||
|
||||
@app.on_message(filters.private)
|
||||
async def _(client, message):
|
||||
|
|
@ -197,7 +197,7 @@ Example with ``raise ContinuePropagation``:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import ContinuePropagation
|
||||
from pyrofork import ContinuePropagation
|
||||
|
||||
@app.on_message(filters.private)
|
||||
async def _(client, message):
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ you can omit ``username`` and ``password``.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
proxy = {
|
||||
"scheme": "socks5", # "socks4", "socks5" and "http" are supported
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Asynchronously
|
|||
|
||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ Non-Asynchronously
|
|||
|
||||
from apscheduler.schedulers.background import BackgroundScheduler
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ For Machines - repr(obj)
|
|||
|
||||
If you want to share or store objects for future references in a more compact way, you can use ``repr(obj)``. While
|
||||
still pretty much readable, this format is not intended for humans. The advantage of this format is that once you
|
||||
serialize your object, you can use ``eval()`` to get back the original structure; just make sure to ``import pyrogram``,
|
||||
serialize your object, you can use ``eval()`` to get back the original structure; just make sure to ``import pyrofork``,
|
||||
as the process requires the package to be in scope.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import pyrogram
|
||||
import pyrofork
|
||||
|
||||
...
|
||||
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ after importing your modules, like this:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client, filters
|
||||
from pyrogram.handlers import MessageHandler
|
||||
from pyrofork import Client, filters
|
||||
from pyrofork.handlers import MessageHandler
|
||||
|
||||
from handlers import echo, echo_reversed
|
||||
|
||||
|
|
@ -72,8 +72,8 @@ after importing your modules, like this:
|
|||
app.run()
|
||||
|
||||
This is already nice and doesn't add *too much* boilerplate code, but things can get boring still; you have to
|
||||
manually ``import``, manually :meth:`~pyrogram.Client.add_handler` and manually instantiate each
|
||||
:class:`~pyrogram.handlers.MessageHandler` object because you can't use decorators for your functions.
|
||||
manually ``import``, manually :meth:`~pyrofork.Client.add_handler` and manually instantiate each
|
||||
:class:`~pyrofork.handlers.MessageHandler` object because you can't use decorators for your functions.
|
||||
So, what if you could? Smart Plugins solve this issue by taking care of handlers registration automatically.
|
||||
|
||||
Using Smart Plugins
|
||||
|
|
@ -100,7 +100,7 @@ Setting up your Pyrofork project to accommodate Smart Plugins is pretty straight
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client, filters
|
||||
from pyrofork import Client, filters
|
||||
|
||||
|
||||
@Client.on_message(filters.text & filters.private)
|
||||
|
|
@ -116,7 +116,7 @@ Setting up your Pyrofork project to accommodate Smart Plugins is pretty straight
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
plugins = dict(root="plugins")
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ Unloading
|
|||
^^^^^^^^^
|
||||
|
||||
In order to unload a plugin, all you need to do is obtain a reference to it by importing the relevant module and call
|
||||
:meth:`~pyrogram.Client.remove_handler` Client's method with your function's *handler* instance:
|
||||
:meth:`~pyrofork.Client.remove_handler` Client's method with your function's *handler* instance:
|
||||
|
||||
- ``main.py``
|
||||
|
||||
|
|
@ -290,7 +290,7 @@ Loading
|
|||
^^^^^^^
|
||||
|
||||
Similarly to the unloading process, in order to load again a previously unloaded plugin you do the same, but this time
|
||||
using :meth:`~pyrogram.Client.add_handler` instead. Example:
|
||||
using :meth:`~pyrofork.Client.add_handler` instead. Example:
|
||||
|
||||
- ``main.py``
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ Pyrofork's speed can be boosted up by using TgCrypto and uvloop.
|
|||
|
||||
-----
|
||||
|
||||
TgCrypto-pyrofork
|
||||
TgCrypto
|
||||
--------
|
||||
|
||||
TgCrypto-pyrofork_ is a high-performance, easy-to-install cryptography library specifically written in C for Pyrofork as a Python
|
||||
TgCrypto_ is a high-performance, easy-to-install cryptography library specifically written in C for Pyrofork as a Python
|
||||
extension. It is a replacement for a slower Python-only alternative and implements the cryptographic algorithms Telegram
|
||||
requires, namely: AES-256-IGE, AES-256-CTR and AES-256-CBC.
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ Installation
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
$ pip3 install -U tgcrypto-pyrofork
|
||||
$ pip3 install -U tgcrypto
|
||||
|
||||
Usage
|
||||
^^^^^
|
||||
|
|
@ -52,7 +52,7 @@ Call ``uvloop.install()`` before calling ``asyncio.run()`` or ``app.run()``.
|
|||
import asyncio
|
||||
import uvloop
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
|
||||
async def main():
|
||||
|
|
@ -70,7 +70,7 @@ The ``uvloop.install()`` call also needs to be placed before creating a Client i
|
|||
.. code-block:: python
|
||||
|
||||
import uvloop
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
uvloop.install()
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ authorization process from scratch each time, Pyrofork needs to store the genera
|
|||
Different Storage Engines
|
||||
-------------------------
|
||||
|
||||
Pyrofork offers two different types of storage engines: a **File Storage** and a **Memory Storage**.
|
||||
Pyrofork offers three different types of storage engines: a **File Storage**, a **Memory Storage** and a **Mongodb Storage**.
|
||||
These engines are well integrated in the framework and require a minimal effort to set up. Here's how they work:
|
||||
|
||||
File Storage
|
||||
|
|
@ -32,11 +32,11 @@ The database will be saved to disk as a single portable file and is designed to
|
|||
data whenever they are needed.
|
||||
|
||||
To use this type of engine, simply pass any name of your choice to the ``name`` parameter of the
|
||||
:obj:`~pyrogram.Client` constructor, as usual:
|
||||
:obj:`~pyrofork.Client` constructor, as usual:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
async with Client("my_account") as app:
|
||||
print(await app.get_me())
|
||||
|
|
@ -49,11 +49,11 @@ Memory Storage
|
|||
^^^^^^^^^^^^^^
|
||||
|
||||
In case you don't want to have any session file saved to disk, you can use an in-memory storage by passing True to the
|
||||
``in_memory`` parameter of the :obj:`~pyrogram.Client` constructor:
|
||||
``in_memory`` parameter of the :obj:`~pyrofork.Client` constructor:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
async with Client("my_account", in_memory=True) as app:
|
||||
print(await app.get_me())
|
||||
|
|
@ -65,14 +65,14 @@ Mongodb Storage
|
|||
^^^^^^^^^^^^^^^
|
||||
|
||||
In case you want to have persistent session but you don't have persistent storage you can use mongodb storage by passing
|
||||
mongodb config as ``dict`` to the ``mongodb`` parameter of the :obj:`~pyrogram.Client` constructor:
|
||||
mongodb config as ``dict`` to the ``mongodb`` parameter of the :obj:`~pyrofork.Client` constructor:
|
||||
|
||||
Using async_pymongo (Recommended for python3.9+):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from async_pymongo import AsyncClient
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
conn = AsyncClient("mongodb://...")
|
||||
|
||||
|
|
@ -80,25 +80,12 @@ Using async_pymongo (Recommended for python3.9+):
|
|||
print(await app.get_me())
|
||||
|
||||
|
||||
Using official mongodb driver:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pymongo import AsyncMongoClient
|
||||
from pyrogram import Client
|
||||
|
||||
conn = AsyncMongoClient("mongodb://...")
|
||||
|
||||
async with Client("my_account", mongodb=dict(connection=conn, remove_peers=False)) as app:
|
||||
print(await app.get_me())
|
||||
|
||||
|
||||
Using motor (Deprecated, but still works):
|
||||
Using motor:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from motor.motor_asyncio import AsyncIOMotorClient
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
conn = AsyncIOMotorClient("mongodb://...")
|
||||
|
||||
|
|
@ -106,17 +93,17 @@ Using motor (Deprecated, but still works):
|
|||
print(await app.get_me())
|
||||
|
||||
This storage engine is backed by MongoDB, a session will be created and saved to mongodb database. Any subsequent client
|
||||
restart will make PyroFork search for a database named that way and the session database will be automatically loaded.
|
||||
restart will make Pyrofork search for a database named that way and the session database will be automatically loaded.
|
||||
|
||||
Session Strings
|
||||
---------------
|
||||
|
||||
In case you want to use an in-memory storage, but also want to keep access to the session you created, call
|
||||
:meth:`~pyrogram.Client.export_session_string` anytime before stopping the client...
|
||||
:meth:`~pyrofork.Client.export_session_string` anytime before stopping the client...
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
async with Client("my_account", in_memory=True) as app:
|
||||
print(await app.export_session_string())
|
||||
|
|
@ -126,7 +113,7 @@ login using the same session; the storage used will still be in-memory:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
session_string = "...ZnUIFD8jsjXTb8g_vpxx48k1zkov9sapD-tzjz-S4WZv70M..."
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ Pyrofork is being used inside the main function with its asynchronous interface.
|
|||
.. code-block:: python
|
||||
|
||||
import asyncio
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
|
||||
async def main():
|
||||
|
|
@ -48,7 +48,7 @@ As you can see, the non-async example becomes less cluttered.
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
app = Client("my_account")
|
||||
|
||||
|
|
@ -83,6 +83,6 @@ Pyrofork.
|
|||
import uvloop
|
||||
uvloop.install()
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
...
|
||||
|
|
@ -7,7 +7,7 @@ Telegram's test servers without hassle. All you need to do is start a new sessio
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import Client
|
||||
from pyrofork import Client
|
||||
|
||||
async with Client("my_account_test", test_mode=True) as app:
|
||||
print(await app.get_me())
|
||||
|
|
|
|||
|
|
@ -35,24 +35,76 @@ list of the basic styles currently supported by Pyrofork.
|
|||
- :strike:`strike`
|
||||
- :underline:`underline`
|
||||
- spoiler
|
||||
- `text URL <https://pyrogram.org>`_
|
||||
- `text URL <https://pyrofork.org>`_
|
||||
- `user text mention <tg://user?id=123456789>`_
|
||||
- :emoji:`🔥`
|
||||
- ``inline fixed-width code``
|
||||
- .. code-block:: text
|
||||
|
||||
pre-formatted
|
||||
fixed-width
|
||||
code block
|
||||
- > Quoted text
|
||||
|
||||
- > Quoted text with collapse/expand button
|
||||
Markdown Style
|
||||
--------------
|
||||
|
||||
To strictly use this mode, pass :obj:`~pyrofork.enums.ParseMode.MARKDOWN` to the *parse_mode* parameter when using
|
||||
:meth:`~pyrofork.Client.send_message`. Use the following syntax in your message:
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
**bold**
|
||||
|
||||
__italic__
|
||||
|
||||
--underline--
|
||||
|
||||
~~strike~~
|
||||
|
||||
||spoiler||
|
||||
|
||||
[text URL](https://pyrofork.org/)
|
||||
|
||||
[text user mention](tg://user?id=123456789)
|
||||
|
||||
`inline fixed-width code`
|
||||
|
||||
```
|
||||
pre-formatted
|
||||
fixed-width
|
||||
code block
|
||||
```
|
||||
|
||||
> Quoted text
|
||||
|
||||
**Example**:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrofork import enums
|
||||
|
||||
await app.send_message(
|
||||
"me",
|
||||
(
|
||||
"**bold**, "
|
||||
"__italic__, "
|
||||
"--underline--, "
|
||||
"~~strike~~, "
|
||||
"||spoiler||, "
|
||||
"[URL](https://pyrofork.org), "
|
||||
"`code`, "
|
||||
"```"
|
||||
"for i in range(10):\n"
|
||||
" print(i)"
|
||||
"```"
|
||||
),
|
||||
parse_mode=enums.ParseMode.MARKDOWN
|
||||
)
|
||||
|
||||
HTML Style
|
||||
----------
|
||||
|
||||
To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode* parameter when using
|
||||
:meth:`~pyrogram.Client.send_message`. The following tags are currently supported:
|
||||
To strictly use this mode, pass :obj:`~pyrofork.enums.HTML` to the *parse_mode* parameter when using
|
||||
:meth:`~pyrofork.Client.send_message`. The following tags are currently supported:
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
|
|
@ -66,14 +118,14 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
|
|||
|
||||
<spoiler>spoiler</spoiler>
|
||||
|
||||
<a href="https://pyrogram.org/">text URL</a>
|
||||
<a href="https://pyrofork.org/">text URL</a>
|
||||
|
||||
<a href="tg://user?id=123456789">inline mention</a>
|
||||
|
||||
<emoji id="12345678901234567890">🔥</emoji>
|
||||
|
||||
<code>inline fixed-width code</code>
|
||||
|
||||
<emoji id="12345678901234567890">🔥</emoji>
|
||||
|
||||
<pre>
|
||||
pre-formatted
|
||||
fixed-width
|
||||
|
|
@ -82,13 +134,11 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
|
|||
|
||||
<blockquote>Quoted text</blockquote>
|
||||
|
||||
<blockquote expandable>Quoted text with collapse/expand button</blockquote>
|
||||
|
||||
**Example**:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import enums
|
||||
from pyrofork import enums
|
||||
|
||||
await app.send_message(
|
||||
"me",
|
||||
|
|
@ -98,7 +148,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
|
|||
"<u>underline</u>, "
|
||||
"<s>strike</s>, "
|
||||
"<spoiler>spoiler</spoiler>, "
|
||||
"<a href=\"https://pyrogram.org/\">URL</a>, "
|
||||
"<a href=\"https://pyrofork.org/\">URL</a>, "
|
||||
"<code>code</code>\n\n"
|
||||
"<pre>"
|
||||
"for i in range(10):\n"
|
||||
|
|
@ -128,72 +178,6 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
|
|||
|
||||
<my text>
|
||||
|
||||
Markdown Style
|
||||
--------------
|
||||
|
||||
.. warning::
|
||||
|
||||
The Markdown style is not recommended for complex text formatting.
|
||||
If you want to use complex text formatting such as nested entities, overlapping entities use the HTML style instead.
|
||||
|
||||
|
||||
To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the *parse_mode* parameter when using
|
||||
:meth:`~pyrogram.Client.send_message`. Use the following syntax in your message:
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
**bold**
|
||||
|
||||
__italic__
|
||||
|
||||
--underline--
|
||||
|
||||
~~strike~~
|
||||
|
||||
||spoiler||
|
||||
|
||||
[text URL](https://pyrogram.org/)
|
||||
|
||||
[text user mention](tg://user?id=123456789)
|
||||
|
||||

|
||||
|
||||
`inline fixed-width code`
|
||||
|
||||
```
|
||||
pre-formatted
|
||||
fixed-width
|
||||
code block
|
||||
```
|
||||
|
||||
> Quoted text
|
||||
|
||||
**> Quoted text with collapse/expand button
|
||||
|
||||
**Example**:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import enums
|
||||
|
||||
await app.send_message(
|
||||
"me",
|
||||
(
|
||||
"**bold**, "
|
||||
"__italic__, "
|
||||
"--underline--, "
|
||||
"~~strike~~, "
|
||||
"||spoiler||, "
|
||||
"[URL](https://pyrogram.org), "
|
||||
"`code`, "
|
||||
"```"
|
||||
"for i in range(10):\n"
|
||||
" print(i)"
|
||||
"```"
|
||||
),
|
||||
parse_mode=enums.ParseMode.MARKDOWN
|
||||
)
|
||||
|
||||
Different Styles
|
||||
----------------
|
||||
|
||||
|
|
@ -209,11 +193,11 @@ Result:
|
|||
**bold**, *italic*
|
||||
|
||||
If you don't like this behaviour you can always choose to only enable either Markdown or HTML in strict mode by passing
|
||||
:obj:`~pyrogram.enums.MARKDOWN` or :obj:`~pyrogram.enums.HTML` as argument to the *parse_mode* parameter.
|
||||
:obj:`~pyrofork.enums.MARKDOWN` or :obj:`~pyrofork.enums.HTML` as argument to the *parse_mode* parameter.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import enums
|
||||
from pyrofork import enums
|
||||
|
||||
await app.send_message("me", "**bold**, <i>italic</i>", parse_mode=enums.ParseMode.MARKDOWN)
|
||||
await app.send_message("me", "**bold**, <i>italic</i>", parse_mode=enums.ParseMode.HTML)
|
||||
|
|
@ -224,12 +208,12 @@ Result:
|
|||
|
||||
\*\*bold**, *italic*
|
||||
|
||||
In case you want to completely turn off the style parser, simply pass :obj:`~pyrogram.enums.DISABLED` to *parse_mode*.
|
||||
In case you want to completely turn off the style parser, simply pass :obj:`~pyrofork.enums.DISABLED` to *parse_mode*.
|
||||
The text will be sent as-is.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import enums
|
||||
from pyrofork import enums
|
||||
|
||||
await app.send_message("me", "**bold**, <i>italic</i>", parse_mode=enums.ParseMode.DISABLED)
|
||||
|
||||
|
|
@ -246,18 +230,18 @@ strike` styles, and you can still combine both Markdown and HTML together.
|
|||
|
||||
Here there are some example texts you can try sending:
|
||||
|
||||
**Markdown**:
|
||||
|
||||
- ``**bold, --underline--**``
|
||||
- ``**bold __italic --underline ~~strike~~--__**``
|
||||
- ``**bold __and** italic__``
|
||||
|
||||
**HTML**:
|
||||
|
||||
- ``<b>bold, <u>underline</u></b>``
|
||||
- ``<b>bold <i>italic <u>underline <s>strike</s></u></i></b>``
|
||||
- ``<b>bold <i>and</b> italic</i>``
|
||||
|
||||
**Markdown (Not Recommended)**:
|
||||
|
||||
- ``**bold, --underline--**``
|
||||
- ``**bold __italic --underline ~~strike~~--__**``
|
||||
- ``**bold __and** italic__``
|
||||
|
||||
**Combined**:
|
||||
|
||||
- ``--you can combine <i>HTML</i> with **Markdown**--``
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Using Filters
|
|||
So far we've seen :doc:`how to register a callback function <../start/updates>` that executes every time an update comes
|
||||
from the server, but there's much more than that to come.
|
||||
|
||||
Here we'll discuss about :obj:`~pyrogram.filters`. Filters enable a fine-grain control over what kind of
|
||||
Here we'll discuss about :obj:`~pyrofork.filters`. Filters enable a fine-grain control over what kind of
|
||||
updates are allowed or not to be passed in your callback functions, based on their inner details.
|
||||
|
||||
.. contents:: Contents
|
||||
|
|
@ -19,12 +19,12 @@ Single Filters
|
|||
|
||||
Let's start right away with a simple example:
|
||||
|
||||
- This example will show you how to **only** handle messages containing a :class:`~pyrogram.types.Sticker` object and
|
||||
- This example will show you how to **only** handle messages containing a :class:`~pyrofork.types.Sticker` object and
|
||||
ignore any other message. Filters are passed as the first argument of the decorator:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import filters
|
||||
from pyrofork import filters
|
||||
|
||||
|
||||
@app.on_message(filters.sticker)
|
||||
|
|
@ -36,8 +36,8 @@ Let's start right away with a simple example:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from pyrogram import filters
|
||||
from pyrogram.handlers import MessageHandler
|
||||
from pyrofork import filters
|
||||
from pyrofork.handlers import MessageHandler
|
||||
|
||||
|
||||
async def my_handler(client, message):
|
||||
|
|
@ -76,7 +76,7 @@ Here are some examples:
|
|||
Advanced Filters
|
||||
----------------
|
||||
|
||||
Some filters, like :meth:`~pyrogram.filters.command` or :meth:`~pyrogram.filters.regex`
|
||||
Some filters, like :meth:`~pyrofork.filters.command` or :meth:`~pyrofork.filters.regex`
|
||||
can also accept arguments:
|
||||
|
||||
- Message is either a */start* or */help* **command**.
|
||||
|
|
@ -91,7 +91,7 @@ can also accept arguments:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
@app.on_message(filters.regex("pyrogram"))
|
||||
@app.on_message(filters.regex("pyrofork"))
|
||||
async def my_handler(client, message):
|
||||
print(message)
|
||||
|
||||
|
|
@ -110,5 +110,5 @@ More handlers using different filters can also live together.
|
|||
|
||||
|
||||
@app.on_message(filters.chat("PyroforkChat"))
|
||||
async def from_pyrogramchat(client, message):
|
||||
async def from_pyroforkchat(client, message):
|
||||
print("New message in @PyroforkChat")
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ authors = [{ name = "wulan17", email = "mayuri@mayuri.my.id" }]
|
|||
dependencies = ["pyaes==1.6.1", "pysocks==1.7.1", "pymediainfo-pyrofork>=6.0.1,<7.0.0"]
|
||||
readme = "README.md"
|
||||
license = "LGPL-3.0-or-later"
|
||||
requires-python = "~=3.10"
|
||||
requires-python = "~=3.8"
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
|
|
@ -15,11 +15,11 @@ classifiers = [
|
|||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Programming Language :: Python :: 3.14",
|
||||
"Programming Language :: Python :: Implementation",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
|
|
@ -33,7 +33,7 @@ classifiers = [
|
|||
keywords = ["telegram chat messenger mtproto api client library python"]
|
||||
|
||||
[tool.hatch.version]
|
||||
path = "pyrogram/__init__.py"
|
||||
path = "pyrofork/__init__.py"
|
||||
|
||||
# Used to call hatch_build.py
|
||||
[tool.hatch.build.hooks.custom]
|
||||
|
|
@ -43,7 +43,7 @@ Homepage = "https://github.com/Mayuri-Chan"
|
|||
Tracker = "https://github.com/Mayuri-Chan/pyrofork/issues"
|
||||
Community = "https://t.me/MayuriChan_Chat"
|
||||
Source = "https://github.com/Mayuri-Chan/pyrofork"
|
||||
Documentation = "https://pyrofork.wulan17.dev"
|
||||
Documentation = "https://pyrofork.mayuri.my.id"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
|
|
@ -60,14 +60,14 @@ dev = [
|
|||
|
||||
docs = [
|
||||
"sphinx",
|
||||
"sphinx-immaterial==0.12.5",
|
||||
"sphinx-immaterial==0.11.10",
|
||||
"sphinx_copybutton",
|
||||
"sphinx-autobuild",
|
||||
"tornado>=6.3.3"
|
||||
]
|
||||
|
||||
speedup = [
|
||||
"tgcrypto-pyrofork>=1.2.6",
|
||||
"tgcrypto>=1.2.5",
|
||||
"uvloop>=0.19.0"
|
||||
]
|
||||
|
||||
|
|
@ -90,4 +90,4 @@ exclude = [
|
|||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
ignore-vcs = true
|
||||
packages = ["pyrogram"]
|
||||
packages = ["pyrofork"]
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
__fork_name__ = "PyroFork"
|
||||
__version__ = "2.3.69"
|
||||
__version__ = "2.4.0"
|
||||
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
|
||||
__copyright__ = "Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>"
|
||||
|
||||
|
|
@ -37,24 +36,8 @@ class ContinuePropagation(StopAsyncIteration):
|
|||
pass
|
||||
|
||||
|
||||
from . import raw, types, filters, handlers, emoji, enums # pylint: disable=wrong-import-position
|
||||
from .client import Client # pylint: disable=wrong-import-position
|
||||
from .sync import idle, compose # pylint: disable=wrong-import-position
|
||||
from . import raw, types, filters, handlers, emoji, enums
|
||||
from .client import Client
|
||||
from .sync import idle, compose
|
||||
|
||||
crypto_executor = ThreadPoolExecutor(1, thread_name_prefix="CryptoWorker")
|
||||
|
||||
__all__ = [
|
||||
"Client",
|
||||
"idle",
|
||||
"compose",
|
||||
"crypto_executor",
|
||||
"StopTransmission",
|
||||
"StopPropagation",
|
||||
"ContinuePropagation",
|
||||
"raw",
|
||||
"types",
|
||||
"filters",
|
||||
"handlers",
|
||||
"emoji",
|
||||
"enums",
|
||||
]
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue