diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index ef4c8db6..78855097 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -6,7 +6,7 @@ body:
label: Checklist
description: Invalid, incomplete or inadequate issue reports may not be taken into consideration
options:
- - label: I am sure the error is coming from Pyrogram's code and not elsewhere
+ - label: I am sure the error is coming from Pyrofork's code and not elsewhere
required: true
- label: I have searched in the issue tracker for similar bug reports, including closed ones
required: true
@@ -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
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index 453151d8..1d73bda7 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,8 +1,8 @@
blank_issues_enabled: false
contact_links:
- - name: Ask Pyrogram related questions
- url: https://stackoverflow.com/questions/tagged/pyrogram
- about: This place is only for reporting issues about Pyrogram. You can ask questions at StackOverflow.
- - name: Join the Telegram channel
- url: https://t.me/pyrogram
- about: Join the official channel and stay tuned for news, updates and announcements.
\ No newline at end of file
+ - 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
+ url: https://t.me/MayuriChan_Chat
+ about: Join the official chat and stay tuned for news, updates and announcements.
\ No newline at end of file
diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml
index 1c822799..885f8ccd 100644
--- a/.github/workflows/build-docs.yml
+++ b/.github/workflows/build-docs.yml
@@ -6,6 +6,7 @@ on:
- "*"
branches:
- staging
+ - dev/*
jobs:
build:
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index f65018ca..556c2f16 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -1,4 +1,4 @@
-name: Pyrogram
+name: Pyrofork
on: [push, pull_request]
diff --git a/.gitignore b/.gitignore
index 7a99a5db..81acb73f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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/
diff --git a/MANIFEST.in b/MANIFEST.in
index e028d633..5daf36ee 100644
--- a/MANIFEST.in
+++ b/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
diff --git a/Makefile b/Makefile
index a391f84b..15316f0b 100644
--- a/Makefile
+++ b/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
diff --git a/README.md b/README.md
index 5c431a54..5c410421 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,4 @@
-
-
-
Telegram MTProto API Framework for Python
@@ -23,7 +20,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")
@@ -51,7 +48,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.
diff --git a/build-docs.sh b/build-docs.sh
index 26c6196e..100e04ac 100644
--- a/build-docs.sh
+++ b/build-docs.sh
@@ -1,31 +1,42 @@
#!/bin/bash
export DOCS_KEY
-export VENV=$(pwd)/venv
+VENV="$(pwd)"/venv
+export VENV
make clean
make clean-docs
make venv
make api
"$VENV"/bin/pip install -e '.[docs]'
-cd compiler/docs && "$VENV"/bin/python compiler.py
-cd ../..
+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
refs=$(echo "$GITHUB_REF" | cut -d '/' -f "1 2")
if [[ "$refs" == "refs/tags" ]]; then
- mkdir -p main
- cd main
- 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/* .
+ branch="main"
+elif [[ "$GITHUB_REF" == "refs/heads/staging" ]]; then
+ branch="staging"
else
- mkdir -p staging
- cd staging
- 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/* .
+ 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
fi
+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: $(echo $GITHUB_REF | cut -d '/' -f 3): Update docs $(date '+%Y-%m-%d | %H:%m:%S %p %Z')" --signoff
+git commit -a -m "docs: $branch: Update docs $(date '+%Y-%m-%d | %H:%m:%S %p %Z')" --signoff
git push -u origin --all
diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py
index 07435778..aebf9944 100644
--- a/compiler/api/compiler.py
+++ b/compiler/api/compiler.py
@@ -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+)---")
@@ -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} `"
+ return f":obj:`{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,7 +423,7 @@ 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)
@@ -444,7 +444,7 @@ def start(format: bool = False):
if references:
docstring += f"\n Functions:\n This object can be returned by " \
f"{count} function{'s' if 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
@@ -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)
diff --git a/compiler/api/template/combinator.txt b/compiler/api/template/combinator.txt
index fa7a7697..4a22de01 100644
--- a/compiler/api/template/combinator.txt
+++ b/compiler/api/template/combinator.txt
@@ -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}
diff --git a/compiler/api/template/type.txt b/compiler/api/template/type.txt
index 3774fb0a..f4b65bd4 100644
--- a/compiler/api/template/type.txt
+++ b/compiler/api/template/type.txt
@@ -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,7 +14,7 @@ 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: "
diff --git a/compiler/docs/compiler.py b/compiler/docs/compiler.py
index e87eab49..5b6fea24 100644
--- a/compiler/docs/compiler.py
+++ b/compiler/docs/compiler.py
@@ -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]
@@ -403,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"]
@@ -412,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))
@@ -615,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))
@@ -761,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))
@@ -781,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"
diff --git a/compiler/docs/template/bound-methods.rst b/compiler/docs/template/bound-methods.rst
index ff712cdf..e58408f9 100644
--- a/compiler/docs/template/bound-methods.rst
+++ b/compiler/docs/template/bound-methods.rst
@@ -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
-------
diff --git a/compiler/docs/template/methods.rst b/compiler/docs/template/methods.rst
index e69a89c2..ebe8bb04 100644
--- a/compiler/docs/template/methods.rst
+++ b/compiler/docs/template/methods.rst
@@ -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
------------
diff --git a/compiler/docs/template/types.rst b/compiler/docs/template/types.rst
index 0ae41f4b..dbf8a5c8 100644
--- a/compiler/docs/template/types.rst
+++ b/compiler/docs/template/types.rst
@@ -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
-------------
diff --git a/compiler/errors/compiler.py b/compiler/errors/compiler.py
index 383ae06f..af3feef9 100644
--- a/compiler/errors/compiler.py
+++ b/compiler/errors/compiler.py
@@ -23,7 +23,7 @@ import re
import shutil
HOME = "compiler/errors"
-DEST = "pyrogram/errors/exceptions"
+DEST = "pyrofork/errors/exceptions"
NOTICE_PATH = "NOTICE"
@@ -137,7 +137,7 @@ def start():
if "__main__" == __name__:
HOME = "."
- DEST = "../../pyrogram/errors/exceptions"
+ DEST = "../../pyrofork/errors/exceptions"
NOTICE_PATH = "../../NOTICE"
start()
diff --git a/docs/source/api/client.rst b/docs/source/api/client.rst
index 54d1772f..45ca8eb8 100644
--- a/docs/source/api/client.rst
+++ b/docs/source/api/client.rst
@@ -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()
diff --git a/docs/source/api/decorators.rst b/docs/source/api/decorators.rst
index 90a01cbe..8b398779 100644
--- a/docs/source/api/decorators.rst
+++ b/docs/source/api/decorators.rst
@@ -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 `; 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
-----
@@ -57,18 +57,18 @@ Details
-------
.. Decorators
-.. autodecorator:: pyrogram.Client.on_message()
-.. autodecorator:: pyrogram.Client.on_edited_message()
-.. autodecorator:: pyrogram.Client.on_callback_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_user_status()
-.. autodecorator:: pyrogram.Client.on_story()
-.. autodecorator:: pyrogram.Client.on_poll()
-.. autodecorator:: pyrogram.Client.on_disconnect()
-.. autodecorator:: pyrogram.Client.on_raw_update()
+.. 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()
diff --git a/docs/source/api/enums/ChatAction.rst b/docs/source/api/enums/ChatAction.rst
index b66df5fd..09dd3181 100644
--- a/docs/source/api/enums/ChatAction.rst
+++ b/docs/source/api/enums/ChatAction.rst
@@ -1,7 +1,7 @@
ChatAction
==========
-.. autoclass:: pyrogram.enums.ChatAction()
+.. autoclass:: pyrofork.enums.ChatAction()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/ChatEventAction.rst b/docs/source/api/enums/ChatEventAction.rst
index 0403e781..9686a258 100644
--- a/docs/source/api/enums/ChatEventAction.rst
+++ b/docs/source/api/enums/ChatEventAction.rst
@@ -1,7 +1,7 @@
ChatEventAction
===============
-.. autoclass:: pyrogram.enums.ChatEventAction()
+.. autoclass:: pyrofork.enums.ChatEventAction()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/ChatMemberStatus.rst b/docs/source/api/enums/ChatMemberStatus.rst
index bff23eda..5a1c6e4d 100644
--- a/docs/source/api/enums/ChatMemberStatus.rst
+++ b/docs/source/api/enums/ChatMemberStatus.rst
@@ -1,7 +1,7 @@
ChatMemberStatus
================
-.. autoclass:: pyrogram.enums.ChatMemberStatus()
+.. autoclass:: pyrofork.enums.ChatMemberStatus()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/ChatMembersFilter.rst b/docs/source/api/enums/ChatMembersFilter.rst
index 5a970ffc..07c53e02 100644
--- a/docs/source/api/enums/ChatMembersFilter.rst
+++ b/docs/source/api/enums/ChatMembersFilter.rst
@@ -1,7 +1,7 @@
ChatMembersFilter
=================
-.. autoclass:: pyrogram.enums.ChatMembersFilter()
+.. autoclass:: pyrofork.enums.ChatMembersFilter()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/ChatType.rst b/docs/source/api/enums/ChatType.rst
index dd653055..8ab6af04 100644
--- a/docs/source/api/enums/ChatType.rst
+++ b/docs/source/api/enums/ChatType.rst
@@ -1,7 +1,7 @@
ChatType
========
-.. autoclass:: pyrogram.enums.ChatType()
+.. autoclass:: pyrofork.enums.ChatType()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/ListenerTypes.rst b/docs/source/api/enums/ListenerTypes.rst
index 39d8b960..091144f3 100644
--- a/docs/source/api/enums/ListenerTypes.rst
+++ b/docs/source/api/enums/ListenerTypes.rst
@@ -1,7 +1,7 @@
ListenerTypes
=============
-.. autoclass:: pyrogram.enums.ListenerTypes()
+.. autoclass:: pyrofork.enums.ListenerTypes()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/MessageEntityType.rst b/docs/source/api/enums/MessageEntityType.rst
index c7a8965f..a79dba9d 100644
--- a/docs/source/api/enums/MessageEntityType.rst
+++ b/docs/source/api/enums/MessageEntityType.rst
@@ -1,7 +1,7 @@
MessageEntityType
=================
-.. autoclass:: pyrogram.enums.MessageEntityType()
+.. autoclass:: pyrofork.enums.MessageEntityType()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/MessageMediaType.rst b/docs/source/api/enums/MessageMediaType.rst
index 04e439d2..54b82b2d 100644
--- a/docs/source/api/enums/MessageMediaType.rst
+++ b/docs/source/api/enums/MessageMediaType.rst
@@ -1,7 +1,7 @@
MessageMediaType
================
-.. autoclass:: pyrogram.enums.MessageMediaType()
+.. autoclass:: pyrofork.enums.MessageMediaType()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/MessageServiceType.rst b/docs/source/api/enums/MessageServiceType.rst
index 2de56818..5e9e6d1d 100644
--- a/docs/source/api/enums/MessageServiceType.rst
+++ b/docs/source/api/enums/MessageServiceType.rst
@@ -1,7 +1,7 @@
MessageServiceType
==================
-.. autoclass:: pyrogram.enums.MessageServiceType()
+.. autoclass:: pyrofork.enums.MessageServiceType()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/MessagesFilter.rst b/docs/source/api/enums/MessagesFilter.rst
index 09090707..c44fc8f3 100644
--- a/docs/source/api/enums/MessagesFilter.rst
+++ b/docs/source/api/enums/MessagesFilter.rst
@@ -1,7 +1,7 @@
MessagesFilter
==============
-.. autoclass:: pyrogram.enums.MessagesFilter()
+.. autoclass:: pyrofork.enums.MessagesFilter()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/NextCodeType.rst b/docs/source/api/enums/NextCodeType.rst
index 46164e47..9a593e88 100644
--- a/docs/source/api/enums/NextCodeType.rst
+++ b/docs/source/api/enums/NextCodeType.rst
@@ -1,7 +1,7 @@
NextCodeType
============
-.. autoclass:: pyrogram.enums.NextCodeType()
+.. autoclass:: pyrofork.enums.NextCodeType()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/ParseMode.rst b/docs/source/api/enums/ParseMode.rst
index 1bcc74da..d61e1c1e 100644
--- a/docs/source/api/enums/ParseMode.rst
+++ b/docs/source/api/enums/ParseMode.rst
@@ -1,7 +1,7 @@
ParseMode
=========
-.. autoclass:: pyrogram.enums.ParseMode()
+.. autoclass:: pyrofork.enums.ParseMode()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/PollType.rst b/docs/source/api/enums/PollType.rst
index d00f9ce8..6e63abc0 100644
--- a/docs/source/api/enums/PollType.rst
+++ b/docs/source/api/enums/PollType.rst
@@ -1,7 +1,7 @@
PollType
========
-.. autoclass:: pyrogram.enums.PollType()
+.. autoclass:: pyrofork.enums.PollType()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/ReactionType.rst b/docs/source/api/enums/ReactionType.rst
index 59692fba..b7c05b5d 100644
--- a/docs/source/api/enums/ReactionType.rst
+++ b/docs/source/api/enums/ReactionType.rst
@@ -1,7 +1,7 @@
ReactionType
============
-.. autoclass:: pyrogram.enums.ReactionType()
+.. autoclass:: pyrofork.enums.ReactionType()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/SentCodeType.rst b/docs/source/api/enums/SentCodeType.rst
index d738b195..5010a6a6 100644
--- a/docs/source/api/enums/SentCodeType.rst
+++ b/docs/source/api/enums/SentCodeType.rst
@@ -1,7 +1,7 @@
SentCodeType
============
-.. autoclass:: pyrogram.enums.SentCodeType()
+.. autoclass:: pyrofork.enums.SentCodeType()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/StoriesPrivacyRules.rst b/docs/source/api/enums/StoriesPrivacyRules.rst
index 995cd073..1a5783af 100644
--- a/docs/source/api/enums/StoriesPrivacyRules.rst
+++ b/docs/source/api/enums/StoriesPrivacyRules.rst
@@ -1,7 +1,7 @@
StoriesPrivacyRules
===================
-.. autoclass:: pyrogram.enums.StoriesPrivacyRules()
+.. autoclass:: pyrofork.enums.StoriesPrivacyRules()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/StoryPrivacy.rst b/docs/source/api/enums/StoryPrivacy.rst
index 8438febf..5ca8c11b 100644
--- a/docs/source/api/enums/StoryPrivacy.rst
+++ b/docs/source/api/enums/StoryPrivacy.rst
@@ -1,7 +1,7 @@
StoryPrivacy
============
-.. autoclass:: pyrogram.enums.StoryPrivacy()
+.. autoclass:: pyrofork.enums.StoryPrivacy()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/UserStatus.rst b/docs/source/api/enums/UserStatus.rst
index c9a77e1b..d0a12c74 100644
--- a/docs/source/api/enums/UserStatus.rst
+++ b/docs/source/api/enums/UserStatus.rst
@@ -1,7 +1,7 @@
UserStatus
==========
-.. autoclass:: pyrogram.enums.UserStatus()
+.. autoclass:: pyrofork.enums.UserStatus()
:members:
.. raw:: html
diff --git a/docs/source/api/enums/index.rst b/docs/source/api/enums/index.rst
index aca1a605..bf3c705c 100644
--- a/docs/source/api/enums/index.rst
+++ b/docs/source/api/enums/index.rst
@@ -8,7 +8,7 @@ to apply only a valid value among the expected ones.
-----
-.. currentmodule:: pyrogram.enums
+.. currentmodule:: pyrofork.enums
.. autosummary::
:nosignatures:
diff --git a/docs/source/api/errors/index.rst b/docs/source/api/errors/index.rst
index 476c1821..08906776 100644
--- a/docs/source/api/errors/index.rst
+++ b/docs/source/api/errors/index.rst
@@ -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:
...
diff --git a/docs/source/api/filters.rst b/docs/source/api/filters.rst
index eb3c9522..a94d94e5 100644
--- a/docs/source/api/filters.rst
+++ b/docs/source/api/filters.rst
@@ -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:
diff --git a/docs/source/api/handlers.rst b/docs/source/api/handlers.rst
index cfe99bbe..e46e88bc 100644
--- a/docs/source/api/handlers.rst
+++ b/docs/source/api/handlers.rst
@@ -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
-----
diff --git a/docs/source/conf.py b/docs/source/conf.py
index a6163641..c9e49e08 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -22,7 +22,7 @@ import sys
sys.path.insert(0, os.path.abspath("../.."))
-from pyrogram import __version__
+from pyrofork import __version__
from pygments.styles.friendly import FriendlyStyle
@@ -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",
diff --git a/docs/source/faq/how-to-avoid-flood-waits.rst b/docs/source/faq/how-to-avoid-flood-waits.rst
index 06d1cdc2..13005f58 100644
--- a/docs/source/faq/how-to-avoid-flood-waits.rst
+++ b/docs/source/faq/how-to-avoid-flood-waits.rst
@@ -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:
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 83d8c523..4fbb4ebf 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -5,7 +5,7 @@ Welcome to Pyrofork
@@ -28,7 +28,7 @@ Welcome to Pyrofork
.. code-block:: python
- from pyrogram import Client, filters
+ from pyrofork import Client, filters
app = Client("my_account")
diff --git a/docs/source/intro/install.rst b/docs/source/intro/install.rst
index ceeecbda..31f7faba 100644
--- a/docs/source/intro/install.rst
+++ b/docs/source/intro/install.rst
@@ -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
diff --git a/docs/source/intro/quickstart.rst b/docs/source/intro/quickstart.rst
index 9aad7aa9..ecdeb2f4 100644
--- a/docs/source/intro/quickstart.rst
+++ b/docs/source/intro/quickstart.rst
@@ -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"
diff --git a/docs/source/start/auth.rst b/docs/source/start/auth.rst
index e8172d99..78e3bf9c 100644
--- a/docs/source/start/auth.rst
+++ b/docs/source/start/auth.rst
@@ -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()
\ No newline at end of file
diff --git a/docs/source/start/errors.rst b/docs/source/start/errors.rst
index e53edbb5..0adc0d73 100644
--- a/docs/source/start/errors.rst
+++ b/docs/source/start/errors.rst
@@ -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:
diff --git a/docs/source/start/examples/bot_keyboards.rst b/docs/source/start/examples/bot_keyboards.rst
index a98389a3..49469c51 100644
--- a/docs/source/start/examples/bot_keyboards.rst
+++ b/docs/source/start/examples/bot_keyboards.rst
@@ -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
@@ -53,11 +53,11 @@ like send_audio(), send_document(), send_location(), etc...
[ # 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"
)
]
]
diff --git a/docs/source/start/examples/callback_queries.rst b/docs/source/start/examples/callback_queries.rst
index 64da57b3..9cf931e2 100644
--- a/docs/source/start/examples/callback_queries.rst
+++ b/docs/source/start/examples/callback_queries.rst
@@ -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")
diff --git a/docs/source/start/examples/echo_bot.rst b/docs/source/start/examples/echo_bot.rst
index de8288b5..34841699 100644
--- a/docs/source/start/examples/echo_bot.rst
+++ b/docs/source/start/examples/echo_bot.rst
@@ -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")
diff --git a/docs/source/start/examples/get_chat_history.rst b/docs/source/start/examples/get_chat_history.rst
index 59939948..e69a6aaf 100644
--- a/docs/source/start/examples/get_chat_history.rst
+++ b/docs/source/start/examples/get_chat_history.rst
@@ -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")
diff --git a/docs/source/start/examples/get_chat_members.rst b/docs/source/start/examples/get_chat_members.rst
index 26636ca3..4c427898 100644
--- a/docs/source/start/examples/get_chat_members.rst
+++ b/docs/source/start/examples/get_chat_members.rst
@@ -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
diff --git a/docs/source/start/examples/get_dialogs.rst b/docs/source/start/examples/get_dialogs.rst
index e5b10609..01065307 100644
--- a/docs/source/start/examples/get_dialogs.rst
+++ b/docs/source/start/examples/get_dialogs.rst
@@ -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")
diff --git a/docs/source/start/examples/hello_world.rst b/docs/source/start/examples/hello_world.rst
index 16480d9f..1b44c3d1 100644
--- a/docs/source/start/examples/hello_world.rst
+++ b/docs/source/start/examples/hello_world.rst
@@ -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")
diff --git a/docs/source/start/examples/index.rst b/docs/source/start/examples/index.rst
index d3d2a100..0cc9eb98 100644
--- a/docs/source/start/examples/index.rst
+++ b/docs/source/start/examples/index.rst
@@ -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:
diff --git a/docs/source/start/examples/inline_queries.rst b/docs/source/start/examples/inline_queries.rst
index 537762e4..8e300245 100644
--- a/docs/source/start/examples/inline_queries.rst
+++ b/docs/source/start/examples/inline_queries.rst
@@ -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")
diff --git a/docs/source/start/examples/raw_updates.rst b/docs/source/start/examples/raw_updates.rst
index 463a45a8..4a198c80 100644
--- a/docs/source/start/examples/raw_updates.rst
+++ b/docs/source/start/examples/raw_updates.rst
@@ -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")
diff --git a/docs/source/start/examples/use_inline_bots.rst b/docs/source/start/examples/use_inline_bots.rst
index 8a2a72ac..8e4895d5 100644
--- a/docs/source/start/examples/use_inline_bots.rst
+++ b/docs/source/start/examples/use_inline_bots.rst
@@ -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")
diff --git a/docs/source/start/examples/welcome_bot.rst b/docs/source/start/examples/welcome_bot.rst
index 8610aca6..4baeb40f 100644
--- a/docs/source/start/examples/welcome_bot.rst
+++ b/docs/source/start/examples/welcome_bot.rst
@@ -6,7 +6,7 @@ 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
diff --git a/docs/source/start/invoking.rst b/docs/source/start/invoking.rst
index dc1beea5..9f9a3e99 100644
--- a/docs/source/start/invoking.rst
+++ b/docs/source/start/invoking.rst
@@ -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():
diff --git a/docs/source/start/setup.rst b/docs/source/start/setup.rst
index 0e667578..3c4d7767 100644
--- a/docs/source/start/setup.rst
+++ b/docs/source/start/setup.rst
@@ -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"
diff --git a/docs/source/start/updates.rst b/docs/source/start/updates.rst
index 69781f94..129a74bc 100644
--- a/docs/source/start/updates.rst
+++ b/docs/source/start/updates.rst
@@ -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):
diff --git a/docs/source/topics/advanced-usage.rst b/docs/source/topics/advanced-usage.rst
index d190ef96..547a41df 100644
--- a/docs/source/topics/advanced-usage.rst
+++ b/docs/source/topics/advanced-usage.rst
@@ -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
diff --git a/docs/source/topics/create-filters.rst b/docs/source/topics/create-filters.rst
index 0b90245d..bd113682 100644
--- a/docs/source/topics/create-filters.rst
+++ b/docs/source/topics/create-filters.rst
@@ -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() `.
+:meth:`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
diff --git a/docs/source/topics/debugging.rst b/docs/source/topics/debugging.rst
index a99126a4..52661782 100644
--- a/docs/source/topics/debugging.rst
+++ b/docs/source/topics/debugging.rst
@@ -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
-
+
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))
diff --git a/docs/source/topics/more-on-updates.rst b/docs/source/topics/more-on-updates.rst
index 2cb49ab1..46ebea2e 100644
--- a/docs/source/topics/more-on-updates.rst
+++ b/docs/source/topics/more-on-updates.rst
@@ -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):
diff --git a/docs/source/topics/proxy.rst b/docs/source/topics/proxy.rst
index 4a43e997..2906727a 100644
--- a/docs/source/topics/proxy.rst
+++ b/docs/source/topics/proxy.rst
@@ -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
diff --git a/docs/source/topics/scheduling.rst b/docs/source/topics/scheduling.rst
index ffbb59f0..2294856d 100644
--- a/docs/source/topics/scheduling.rst
+++ b/docs/source/topics/scheduling.rst
@@ -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")
diff --git a/docs/source/topics/serializing.rst b/docs/source/topics/serializing.rst
index f2e077e6..1caf28fc 100644
--- a/docs/source/topics/serializing.rst
+++ b/docs/source/topics/serializing.rst
@@ -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
...
diff --git a/docs/source/topics/smart-plugins.rst b/docs/source/topics/smart-plugins.rst
index bf30a824..052ba6a4 100644
--- a/docs/source/topics/smart-plugins.rst
+++ b/docs/source/topics/smart-plugins.rst
@@ -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``
diff --git a/docs/source/topics/speedups.rst b/docs/source/topics/speedups.rst
index 3767e055..6f21c13c 100644
--- a/docs/source/topics/speedups.rst
+++ b/docs/source/topics/speedups.rst
@@ -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()
diff --git a/docs/source/topics/storage-engines.rst b/docs/source/topics/storage-engines.rst
index 4b89e31e..2b70377e 100644
--- a/docs/source/topics/storage-engines.rst
+++ b/docs/source/topics/storage-engines.rst
@@ -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://...")
@@ -85,7 +85,7 @@ Using motor:
.. code-block:: python
from motor.motor_asyncio import AsyncIOMotorClient
- from pyrogram import Client
+ from pyrofork import Client
conn = AsyncIOMotorClient("mongodb://...")
@@ -93,17 +93,17 @@ Using motor:
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())
@@ -113,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..."
diff --git a/docs/source/topics/synchronous.rst b/docs/source/topics/synchronous.rst
index a7a54f59..13acd518 100644
--- a/docs/source/topics/synchronous.rst
+++ b/docs/source/topics/synchronous.rst
@@ -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
...
\ No newline at end of file
diff --git a/docs/source/topics/test-servers.rst b/docs/source/topics/test-servers.rst
index 10399e06..73c4c5d2 100644
--- a/docs/source/topics/test-servers.rst
+++ b/docs/source/topics/test-servers.rst
@@ -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())
diff --git a/docs/source/topics/text-formatting.rst b/docs/source/topics/text-formatting.rst
index 10772e8a..fa32d300 100644
--- a/docs/source/topics/text-formatting.rst
+++ b/docs/source/topics/text-formatting.rst
@@ -35,7 +35,7 @@ list of the basic styles currently supported by Pyrofork.
- :strike:`strike`
- :underline:`underline`
- spoiler
-- `text URL `_
+- `text URL `_
- `user text mention `_
- ``inline fixed-width code``
- .. code-block:: text
@@ -47,8 +47,8 @@ list of the basic styles currently supported by Pyrofork.
Markdown Style
--------------
-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:
+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
@@ -62,7 +62,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
||spoiler||
- [text URL](https://pyrogram.org/)
+ [text URL](https://pyrofork.org/)
[text user mention](tg://user?id=123456789)
@@ -80,7 +80,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
.. code-block:: python
- from pyrogram import enums
+ from pyrofork import enums
await app.send_message(
"me",
@@ -90,7 +90,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
"--underline--, "
"~~strike~~, "
"||spoiler||, "
- "[URL](https://pyrogram.org), "
+ "[URL](https://pyrofork.org), "
"`code`, "
"```"
"for i in range(10):\n"
@@ -103,8 +103,8 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the
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
@@ -118,7 +118,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
spoiler
- text URL
+ text URL
inline mention
@@ -138,7 +138,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
.. code-block:: python
- from pyrogram import enums
+ from pyrofork import enums
await app.send_message(
"me",
@@ -148,7 +148,7 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
"underline, "
"strike, "
"spoiler, "
- "URL, "
+ "URL, "
"code\n\n"
""
"for i in range(10):\n"
@@ -193,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**, italic", parse_mode=enums.ParseMode.MARKDOWN)
await app.send_message("me", "**bold**, italic", parse_mode=enums.ParseMode.HTML)
@@ -208,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**, italic", parse_mode=enums.ParseMode.DISABLED)
diff --git a/docs/source/topics/use-filters.rst b/docs/source/topics/use-filters.rst
index a352fefa..e18501dc 100644
--- a/docs/source/topics/use-filters.rst
+++ b/docs/source/topics/use-filters.rst
@@ -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")
diff --git a/pyproject.toml b/pyproject.toml
index aa230739..58767256 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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]
@@ -89,4 +89,4 @@ exclude = [
[tool.hatch.build.targets.wheel]
ignore-vcs = true
-packages = ["pyrogram"]
+packages = ["pyrofork"]
diff --git a/pyrogram/__init__.py b/pyrofork/__init__.py
similarity index 96%
rename from pyrogram/__init__.py
rename to pyrofork/__init__.py
index 7209d27b..1c88edb0 100644
--- a/pyrogram/__init__.py
+++ b/pyrofork/__init__.py
@@ -17,8 +17,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-__fork_name__ = "PyroFork"
-__version__ = "2.3.17.post2"
+__version__ = "2.4.0"
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
__copyright__ = "Copyright (C) 2022-present Mayuri-Chan "
diff --git a/pyrogram/client.py b/pyrofork/client.py
similarity index 96%
rename from pyrogram/client.py
rename to pyrofork/client.py
index 71c94264..ab4844d8 100644
--- a/pyrogram/client.py
+++ b/pyrofork/client.py
@@ -35,30 +35,30 @@ from mimetypes import MimeTypes
from pathlib import Path
from typing import Union, List, Optional, Callable, AsyncGenerator
-import pyrogram
-from pyrogram import __version__, __license__
-from pyrogram import enums
-from pyrogram import raw
-from pyrogram import utils
-from pyrogram.crypto import aes
-from pyrogram.errors import CDNFileHashMismatch
-from pyrogram.errors import (
+import pyrofork
+from pyrofork import __version__, __license__
+from pyrofork import enums
+from pyrofork import raw
+from pyrofork import utils
+from pyrofork.crypto import aes
+from pyrofork.errors import CDNFileHashMismatch
+from pyrofork.errors import (
SessionPasswordNeeded,
VolumeLocNotFound, ChannelPrivate,
BadRequest
)
-from pyrogram.handlers.handler import Handler
-from pyrogram.methods import Methods
-from pyrogram.session import Auth, Session
-from pyrogram.storage import FileStorage, MemoryStorage, Storage
+from pyrofork.handlers.handler import Handler
+from pyrofork.methods import Methods
+from pyrofork.session import Auth, Session
+from pyrofork.storage import FileStorage, MemoryStorage, Storage
try:
import pymongo
except Exception:
pass
else:
- from pyrogram.storage import MongoStorage
-from pyrogram.types import User, TermsOfService
-from pyrogram.utils import ainput
+ from pyrofork.storage import MongoStorage
+from pyrofork.types import User, TermsOfService
+from pyrofork.utils import ainput
from .dispatcher import Dispatcher
from .file_id import FileId, FileType, ThumbnailSource
from .filters import Filter
@@ -70,7 +70,7 @@ log = logging.getLogger(__name__)
class Client(Methods):
- """Pyrogram Client, the main means for interacting with Telegram.
+ """Pyrofork Client, the main means for interacting with Telegram.
Parameters:
name (``str``):
@@ -86,7 +86,7 @@ class Client(Methods):
app_version (``str``, *optional*):
Application version.
- Defaults to "Pyrogram x.y.z".
+ Defaults to "Pyrofork x.y.z".
device_model (``str``, *optional*):
Device model.
@@ -129,7 +129,7 @@ class Client(Methods):
in_memory (``bool``, *optional*):
Pass True to start an in-memory session that will be discarded as soon as the client stops.
In order to reconnect again using an in-memory session without having to login again, you can use
- :meth:`~pyrogram.Client.export_session_string` before stopping the client to get a session string you can
+ :meth:`~pyrofork.Client.export_session_string` before stopping the client to get a session string you can
pass to the ``session_string`` parameter.
Defaults to False.
@@ -137,7 +137,7 @@ class Client(Methods):
Mongodb config as dict, e.g.: *dict(connection=async_pymongo.AsyncClient("mongodb://..."), remove_peers=False)*.
Only applicable for new sessions.
- storage (:obj:`~pyrogram.storage.Storage`, *optional*):
+ storage (:obj:`~pyrofork.storage.Storage`, *optional*):
Custom session storage.
phone_number (``str``, *optional*):
@@ -158,13 +158,13 @@ class Client(Methods):
workdir (``str``, *optional*):
Define a custom working directory.
- The working directory is the location in the filesystem where Pyrogram will store the session files.
+ The working directory is the location in the filesystem where Pyrofork will store the session files.
Defaults to the parent directory of the main script.
plugins (``dict``, *optional*):
Smart Plugins settings as dict, e.g.: *dict(root="plugins")*.
- parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
+ parse_mode (:obj:`~pyrofork.enums.ParseMode`, *optional*):
Set the global parse mode of the client. By default, texts are parsed using both Markdown and HTML styles.
You can combine both syntaxes together.
@@ -198,7 +198,7 @@ class Client(Methods):
Defaults to 1.
"""
- APP_VERSION = f"Pyrogram {__version__}"
+ APP_VERSION = f"Pyrofork {__version__}"
DEVICE_MODEL = f"{platform.python_implementation()} {platform.python_version()}"
SYSTEM_VERSION = f"{platform.system()} {platform.release()}"
@@ -332,7 +332,7 @@ class Client(Methods):
self.updates_watchdog_task = None
self.updates_watchdog_event = asyncio.Event()
self.last_update_time = datetime.now()
- self.listeners = {listener_type: [] for listener_type in pyrogram.enums.ListenerTypes}
+ self.listeners = {listener_type: [] for listener_type in pyrofork.enums.ListenerTypes}
self.loop = asyncio.get_event_loop()
def __enter__(self):
@@ -369,8 +369,8 @@ class Client(Methods):
if self.bot_token:
return await self.sign_in_bot(self.bot_token)
- print(f"Welcome to Pyrogram (version {__version__})")
- print(f"Pyrogram is free software and comes with ABSOLUTELY NO WARRANTY. Licensed\n"
+ print(f"Welcome to Pyrofork (version {__version__})")
+ print(f"Pyrofork is free software and comes with ABSOLUTELY NO WARRANTY. Licensed\n"
f"under the terms of the {__license__}.\n")
while True:
@@ -490,14 +490,14 @@ class Client(Methods):
global value by default.
Parameters:
- parse_mode (:obj:`~pyrogram.enums.ParseMode`):
+ parse_mode (:obj:`~pyrofork.enums.ParseMode`):
By default, texts are parsed using both Markdown and HTML styles.
You can combine both syntaxes together.
Example:
.. code-block:: python
- from pyrogram import enums
+ from pyrofork import enums
# Default combined mode: Markdown + HTML
await app.send_message("me", "1. **markdown** and html")
@@ -840,7 +840,7 @@ class Client(Methods):
if isinstance(e, asyncio.CancelledError):
raise e
- if isinstance(e, pyrogram.errors.FloodWait):
+ if isinstance(e, pyrofork.errors.FloodWait):
raise e
return None
@@ -1063,9 +1063,9 @@ class Client(Methods):
raise e
finally:
await cdn_session.stop()
- except pyrogram.StopTransmission:
+ except pyrofork.StopTransmission:
raise
- except pyrogram.errors.FloodWait:
+ except pyrofork.errors.FloodWait:
raise
except Exception as e:
log.exception(e)
diff --git a/pyrogram/connection/__init__.py b/pyrofork/connection/__init__.py
similarity index 61%
rename from pyrogram/connection/__init__.py
rename to pyrofork/connection/__init__.py
index 4665ce91..9dc28845 100644
--- a/pyrogram/connection/__init__.py
+++ b/pyrofork/connection/__init__.py
@@ -1,19 +1,20 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from .connection import Connection
diff --git a/pyrogram/connection/connection.py b/pyrofork/connection/connection.py
similarity index 100%
rename from pyrogram/connection/connection.py
rename to pyrofork/connection/connection.py
diff --git a/pyrogram/connection/transport/__init__.py b/pyrofork/connection/transport/__init__.py
similarity index 60%
rename from pyrogram/connection/transport/__init__.py
rename to pyrofork/connection/transport/__init__.py
index 2d08832a..4536e971 100644
--- a/pyrogram/connection/transport/__init__.py
+++ b/pyrofork/connection/transport/__init__.py
@@ -1,19 +1,20 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from .tcp import *
diff --git a/pyrogram/connection/transport/tcp/__init__.py b/pyrofork/connection/transport/tcp/__init__.py
similarity index 67%
rename from pyrogram/connection/transport/tcp/__init__.py
rename to pyrofork/connection/transport/tcp/__init__.py
index 3e23a883..9107c9ef 100644
--- a/pyrogram/connection/transport/tcp/__init__.py
+++ b/pyrofork/connection/transport/tcp/__init__.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from .tcp import TCP
from .tcp_abridged import TCPAbridged
diff --git a/pyrogram/connection/transport/tcp/tcp.py b/pyrofork/connection/transport/tcp/tcp.py
similarity index 91%
rename from pyrogram/connection/transport/tcp/tcp.py
rename to pyrofork/connection/transport/tcp/tcp.py
index 82ef033b..80288ded 100644
--- a/pyrogram/connection/transport/tcp/tcp.py
+++ b/pyrofork/connection/transport/tcp/tcp.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import asyncio
import ipaddress
diff --git a/pyrogram/connection/transport/tcp/tcp_abridged.py b/pyrofork/connection/transport/tcp/tcp_abridged.py
similarity index 80%
rename from pyrogram/connection/transport/tcp/tcp_abridged.py
rename to pyrofork/connection/transport/tcp/tcp_abridged.py
index 77d44cf4..f20e1b3c 100644
--- a/pyrogram/connection/transport/tcp/tcp_abridged.py
+++ b/pyrofork/connection/transport/tcp/tcp_abridged.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
from typing import Optional
diff --git a/pyrogram/connection/transport/tcp/tcp_abridged_o.py b/pyrofork/connection/transport/tcp/tcp_abridged_o.py
similarity index 81%
rename from pyrogram/connection/transport/tcp/tcp_abridged_o.py
rename to pyrofork/connection/transport/tcp/tcp_abridged_o.py
index 6f57ab11..79980871 100644
--- a/pyrogram/connection/transport/tcp/tcp_abridged_o.py
+++ b/pyrofork/connection/transport/tcp/tcp_abridged_o.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
import os
from typing import Optional
-import pyrogram
-from pyrogram.crypto import aes
+import pyrofork
+from pyrofork.crypto import aes
from .tcp import TCP
log = logging.getLogger(__name__)
@@ -58,7 +59,7 @@ class TCPAbridgedO(TCP):
async def send(self, data: bytes, *args):
length = len(data) // 4
data = (bytes([length]) if length <= 126 else b"\x7f" + length.to_bytes(3, "little")) + data
- payload = await self.loop.run_in_executor(pyrogram.crypto_executor, aes.ctr256_encrypt, data, *self.encrypt)
+ payload = await self.loop.run_in_executor(pyrofork.crypto_executor, aes.ctr256_encrypt, data, *self.encrypt)
await super().send(payload)
@@ -83,4 +84,4 @@ class TCPAbridgedO(TCP):
if data is None:
return None
- return await self.loop.run_in_executor(pyrogram.crypto_executor, aes.ctr256_decrypt, data, *self.decrypt)
+ return await self.loop.run_in_executor(pyrofork.crypto_executor, aes.ctr256_decrypt, data, *self.decrypt)
diff --git a/pyrogram/connection/transport/tcp/tcp_full.py b/pyrofork/connection/transport/tcp/tcp_full.py
similarity index 81%
rename from pyrogram/connection/transport/tcp/tcp_full.py
rename to pyrofork/connection/transport/tcp/tcp_full.py
index 8bd89000..df19b12c 100644
--- a/pyrogram/connection/transport/tcp/tcp_full.py
+++ b/pyrofork/connection/transport/tcp/tcp_full.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
from binascii import crc32
diff --git a/pyrogram/connection/transport/tcp/tcp_intermediate.py b/pyrofork/connection/transport/tcp/tcp_intermediate.py
similarity index 77%
rename from pyrogram/connection/transport/tcp/tcp_intermediate.py
rename to pyrofork/connection/transport/tcp/tcp_intermediate.py
index b6aef335..9c2c9002 100644
--- a/pyrogram/connection/transport/tcp/tcp_intermediate.py
+++ b/pyrofork/connection/transport/tcp/tcp_intermediate.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
from struct import pack, unpack
diff --git a/pyrogram/connection/transport/tcp/tcp_intermediate_o.py b/pyrofork/connection/transport/tcp/tcp_intermediate_o.py
similarity index 84%
rename from pyrogram/connection/transport/tcp/tcp_intermediate_o.py
rename to pyrofork/connection/transport/tcp/tcp_intermediate_o.py
index 48b2d445..96ea9ea7 100644
--- a/pyrogram/connection/transport/tcp/tcp_intermediate_o.py
+++ b/pyrofork/connection/transport/tcp/tcp_intermediate_o.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
import os
from struct import pack, unpack
from typing import Optional
-from pyrogram.crypto import aes
+from pyrofork.crypto import aes
from .tcp import TCP
log = logging.getLogger(__name__)
diff --git a/pyrogram/crypto/__init__.py b/pyrofork/crypto/__init__.py
similarity index 59%
rename from pyrogram/crypto/__init__.py
rename to pyrofork/crypto/__init__.py
index 46887cb7..c0ec805b 100644
--- a/pyrogram/crypto/__init__.py
+++ b/pyrofork/crypto/__init__.py
@@ -1,17 +1,18 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
diff --git a/pyrogram/crypto/aes.py b/pyrofork/crypto/aes.py
similarity index 89%
rename from pyrogram/crypto/aes.py
rename to pyrofork/crypto/aes.py
index 2e96f971..d91d7b43 100644
--- a/pyrogram/crypto/aes.py
+++ b/pyrofork/crypto/aes.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
@@ -53,7 +54,7 @@ except ImportError:
log.warning(
"TgCrypto is missing! "
- "Pyrogram will work the same, but at a much slower speed. "
+ "Pyrofork will work the same, but at a much slower speed. "
"More info: https://pyrofork.mayuri.my.id/topics/speedups"
)
diff --git a/pyrogram/crypto/mtproto.py b/pyrofork/crypto/mtproto.py
similarity index 88%
rename from pyrogram/crypto/mtproto.py
rename to pyrofork/crypto/mtproto.py
index 6d1521a4..d34ec652 100644
--- a/pyrogram/crypto/mtproto.py
+++ b/pyrofork/crypto/mtproto.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from hashlib import sha256
from io import BytesIO
from os import urandom
-from pyrogram.errors import SecurityCheckMismatch
-from pyrogram.raw.core import Message, Long
+from pyrofork.errors import SecurityCheckMismatch
+from pyrofork.raw.core import Message, Long
from . import aes
diff --git a/pyrogram/crypto/prime.py b/pyrofork/crypto/prime.py
similarity index 85%
rename from pyrogram/crypto/prime.py
rename to pyrofork/crypto/prime.py
index e919e22c..ee806525 100644
--- a/pyrogram/crypto/prime.py
+++ b/pyrofork/crypto/prime.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from random import randint
diff --git a/pyrogram/crypto/rsa.py b/pyrofork/crypto/rsa.py
similarity index 97%
rename from pyrogram/crypto/rsa.py
rename to pyrofork/crypto/rsa.py
index 25c23229..9c28166e 100644
--- a/pyrogram/crypto/rsa.py
+++ b/pyrofork/crypto/rsa.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from collections import namedtuple
diff --git a/pyrogram/dispatcher.py b/pyrofork/dispatcher.py
similarity index 91%
rename from pyrogram/dispatcher.py
rename to pyrofork/dispatcher.py
index 701e5fcb..a73cb44a 100644
--- a/pyrogram/dispatcher.py
+++ b/pyrofork/dispatcher.py
@@ -22,12 +22,12 @@ import inspect
import logging
from collections import OrderedDict
-import pyrogram
-from pyrogram import utils
-from pyrogram.handlers import (
+import pyrofork
+from pyrofork import utils
+from pyrofork.handlers import (
CallbackQueryHandler, MessageHandler, EditedMessageHandler, DeletedMessagesHandler, MessageReactionUpdatedHandler, MessageReactionCountUpdatedHandler, UserStatusHandler, RawUpdateHandler, InlineQueryHandler, PollHandler, ConversationHandler, ChosenInlineResultHandler, ChatMemberUpdatedHandler, ChatJoinRequestHandler, StoryHandler
)
-from pyrogram.raw.types import (
+from pyrofork.raw.types import (
UpdateNewMessage, UpdateNewChannelMessage, UpdateNewScheduledMessage,
UpdateEditMessage, UpdateEditChannelMessage,
UpdateDeleteMessages, UpdateDeleteChannelMessages,
@@ -57,7 +57,7 @@ class Dispatcher:
MESSAGE_BOT_NA_REACTION_UPDATES = (UpdateBotMessageReaction,)
MESSAGE_BOT_A_REACTION_UPDATES = (UpdateBotMessageReactions,)
- def __init__(self, client: "pyrogram.Client"):
+ def __init__(self, client: "pyrofork.Client"):
self.client = client
self.loop = asyncio.get_event_loop()
@@ -72,7 +72,7 @@ class Dispatcher:
async def message_parser(update, users, chats):
return (
- await pyrogram.types.Message._parse(self.client, update.message, users, chats,
+ await pyrofork.types.Message._parse(self.client, update.message, users, chats,
is_scheduled=isinstance(update, UpdateNewScheduledMessage)),
MessageHandler
)
@@ -94,61 +94,61 @@ class Dispatcher:
async def callback_query_parser(update, users, chats):
return (
- await pyrogram.types.CallbackQuery._parse(self.client, update, users),
+ await pyrofork.types.CallbackQuery._parse(self.client, update, users),
CallbackQueryHandler
)
async def user_status_parser(update, users, chats):
return (
- pyrogram.types.User._parse_user_status(self.client, update),
+ pyrofork.types.User._parse_user_status(self.client, update),
UserStatusHandler
)
async def inline_query_parser(update, users, chats):
return (
- pyrogram.types.InlineQuery._parse(self.client, update, users),
+ pyrofork.types.InlineQuery._parse(self.client, update, users),
InlineQueryHandler
)
async def poll_parser(update, users, chats):
return (
- pyrogram.types.Poll._parse_update(self.client, update),
+ pyrofork.types.Poll._parse_update(self.client, update),
PollHandler
)
async def chosen_inline_result_parser(update, users, chats):
return (
- pyrogram.types.ChosenInlineResult._parse(self.client, update, users),
+ pyrofork.types.ChosenInlineResult._parse(self.client, update, users),
ChosenInlineResultHandler
)
async def chat_member_updated_parser(update, users, chats):
return (
- pyrogram.types.ChatMemberUpdated._parse(self.client, update, users, chats),
+ pyrofork.types.ChatMemberUpdated._parse(self.client, update, users, chats),
ChatMemberUpdatedHandler
)
async def chat_join_request_parser(update, users, chats):
return (
- pyrogram.types.ChatJoinRequest._parse(self.client, update, users, chats),
+ pyrofork.types.ChatJoinRequest._parse(self.client, update, users, chats),
ChatJoinRequestHandler
)
async def story_parser(update, users, chats):
return (
- await pyrogram.types.Story._parse(self.client, update.story, update.peer),
+ await pyrofork.types.Story._parse(self.client, update.story, update.peer),
StoryHandler
)
async def message_bot_na_reaction_parser(update, users, chats):
return (
- pyrogram.types.MessageReactionUpdated._parse(self.client, update, users, chats),
+ pyrofork.types.MessageReactionUpdated._parse(self.client, update, users, chats),
MessageReactionUpdatedHandler
)
async def message_bot_a_reaction_parser(update, users, chats):
return (
- pyrogram.types.MessageReactionCountUpdated._parse(self.client, update, users, chats),
+ pyrofork.types.MessageReactionCountUpdated._parse(self.client, update, users, chats),
MessageReactionCountUpdatedHandler
)
@@ -273,15 +273,15 @@ class Dispatcher:
self.client,
*args
)
- except pyrogram.StopPropagation:
+ except pyrofork.StopPropagation:
raise
- except pyrogram.ContinuePropagation:
+ except pyrofork.ContinuePropagation:
continue
except Exception as e:
log.exception(e)
break
- except pyrogram.StopPropagation:
+ except pyrofork.StopPropagation:
pass
except Exception as e:
log.exception(e)
diff --git a/pyrogram/emoji.py b/pyrofork/emoji.py
similarity index 99%
rename from pyrogram/emoji.py
rename to pyrofork/emoji.py
index d135faf7..53bba4d2 100644
--- a/pyrogram/emoji.py
+++ b/pyrofork/emoji.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
GRINNING_FACE = "\U0001f600"
GRINNING_FACE_WITH_BIG_EYES = "\U0001f603"
diff --git a/pyrogram/enums/__init__.py b/pyrofork/enums/__init__.py
similarity index 83%
rename from pyrogram/enums/__init__.py
rename to pyrofork/enums/__init__.py
index 15eadf27..4cd76f1a 100644
--- a/pyrogram/enums/__init__.py
+++ b/pyrofork/enums/__init__.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from .chat_action import ChatAction
from .chat_event_action import ChatEventAction
diff --git a/pyrogram/enums/auto_name.py b/pyrofork/enums/auto_name.py
similarity index 62%
rename from pyrogram/enums/auto_name.py
rename to pyrofork/enums/auto_name.py
index b43fa741..07288f37 100644
--- a/pyrogram/enums/auto_name.py
+++ b/pyrofork/enums/auto_name.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from enum import Enum
@@ -24,4 +25,4 @@ class AutoName(Enum):
return self.lower()
def __repr__(self):
- return f"pyrogram.enums.{self}"
+ return f"pyrofork.enums.{self}"
diff --git a/pyrogram/enums/chat_action.py b/pyrofork/enums/chat_action.py
similarity index 81%
rename from pyrogram/enums/chat_action.py
rename to pyrofork/enums/chat_action.py
index 167937e0..395c4992 100644
--- a/pyrogram/enums/chat_action.py
+++ b/pyrofork/enums/chat_action.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-from pyrogram import raw
+from pyrofork import raw
from .auto_name import AutoName
class ChatAction(AutoName):
- """Chat action enumeration used in :obj:`~pyrogram.types.ChatEvent`."""
+ """Chat action enumeration used in :obj:`~pyrofork.types.ChatEvent`."""
TYPING = raw.types.SendMessageTypingAction
"Typing text message"
diff --git a/pyrogram/enums/chat_event_action.py b/pyrofork/enums/chat_event_action.py
similarity index 98%
rename from pyrogram/enums/chat_event_action.py
rename to pyrofork/enums/chat_event_action.py
index 12355b66..260b50d6 100644
--- a/pyrogram/enums/chat_event_action.py
+++ b/pyrofork/enums/chat_event_action.py
@@ -23,7 +23,7 @@ from .auto_name import AutoName
class ChatEventAction(AutoName):
- """Chat event action enumeration used in :meth:`~pyrogram.Client.get_chat_event_log`."""
+ """Chat event action enumeration used in :meth:`~pyrofork.Client.get_chat_event_log`."""
DESCRIPTION_CHANGED = auto()
"The chat description has been changed (see ``old_description`` and ``new_description``)"
diff --git a/pyrogram/enums/chat_member_status.py b/pyrofork/enums/chat_member_status.py
similarity index 68%
rename from pyrogram/enums/chat_member_status.py
rename to pyrofork/enums/chat_member_status.py
index 7fa9e8ec..bd7fabfc 100644
--- a/pyrogram/enums/chat_member_status.py
+++ b/pyrofork/enums/chat_member_status.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from enum import auto
@@ -22,7 +23,7 @@ from .auto_name import AutoName
class ChatMemberStatus(AutoName):
- """Chat member status enumeration used in :obj:`~pyrogram.types.ChatMember`."""
+ """Chat member status enumeration used in :obj:`~pyrofork.types.ChatMember`."""
OWNER = auto()
"Chat owner"
diff --git a/pyrogram/enums/chat_members_filter.py b/pyrofork/enums/chat_members_filter.py
similarity index 70%
rename from pyrogram/enums/chat_members_filter.py
rename to pyrofork/enums/chat_members_filter.py
index bf0e7ef3..ddeec776 100644
--- a/pyrogram/enums/chat_members_filter.py
+++ b/pyrofork/enums/chat_members_filter.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-from pyrogram import raw
+from pyrofork import raw
from .auto_name import AutoName
class ChatMembersFilter(AutoName):
- """Chat members filter enumeration used in :meth:`~pyrogram.Client.get_chat_members`"""
+ """Chat members filter enumeration used in :meth:`~pyrofork.Client.get_chat_members`"""
SEARCH = raw.types.ChannelParticipantsSearch
"Search for members"
diff --git a/pyrogram/enums/chat_type.py b/pyrofork/enums/chat_type.py
similarity index 67%
rename from pyrogram/enums/chat_type.py
rename to pyrofork/enums/chat_type.py
index 5750e16d..85c0e03e 100644
--- a/pyrogram/enums/chat_type.py
+++ b/pyrofork/enums/chat_type.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from enum import auto
@@ -22,7 +23,7 @@ from .auto_name import AutoName
class ChatType(AutoName):
- """Chat type enumeration used in :obj:`~pyrogram.types.Chat`."""
+ """Chat type enumeration used in :obj:`~pyrofork.types.Chat`."""
PRIVATE = auto()
"Chat is a private chat with a user"
diff --git a/pyrogram/enums/listerner_types.py b/pyrofork/enums/listerner_types.py
similarity index 94%
rename from pyrogram/enums/listerner_types.py
rename to pyrofork/enums/listerner_types.py
index 2e9c8b50..2266d618 100644
--- a/pyrogram/enums/listerner_types.py
+++ b/pyrofork/enums/listerner_types.py
@@ -23,7 +23,7 @@ from .auto_name import AutoName
class ListenerTypes(AutoName):
- """Listener type enumeration used in :obj:`~pyrogram.types.Client`."""
+ """Listener type enumeration used in :obj:`~pyrofork.types.Client`."""
MESSAGE = auto()
"A Message"
diff --git a/pyrogram/enums/message_entity_type.py b/pyrofork/enums/message_entity_type.py
similarity index 77%
rename from pyrogram/enums/message_entity_type.py
rename to pyrofork/enums/message_entity_type.py
index 4db75f93..0fc051ac 100644
--- a/pyrogram/enums/message_entity_type.py
+++ b/pyrofork/enums/message_entity_type.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-from pyrogram import raw
+from pyrofork import raw
from .auto_name import AutoName
class MessageEntityType(AutoName):
- """Message entity type enumeration used in :obj:`~pyrogram.types.MessageEntity`."""
+ """Message entity type enumeration used in :obj:`~pyrofork.types.MessageEntity`."""
MENTION = raw.types.MessageEntityMention
"``@username``"
@@ -33,13 +34,13 @@ class MessageEntityType(AutoName):
"``$USD``"
BOT_COMMAND = raw.types.MessageEntityBotCommand
- "``/start@pyrogrambot``"
+ "``/start@pyroforkbot``"
URL = raw.types.MessageEntityUrl
- "``https://pyrogram.org`` (see ``url``)"
+ "``https://pyrofork.org`` (see ``url``)"
EMAIL = raw.types.MessageEntityEmail
- "``do-not-reply@pyrogram.org``"
+ "``do-not-reply@pyrofork.org``"
PHONE_NUMBER = raw.types.MessageEntityPhone
"``+1-123-456-7890``"
diff --git a/pyrogram/enums/message_media_type.py b/pyrofork/enums/message_media_type.py
similarity index 76%
rename from pyrogram/enums/message_media_type.py
rename to pyrofork/enums/message_media_type.py
index 722d3464..61d6fbb6 100644
--- a/pyrogram/enums/message_media_type.py
+++ b/pyrofork/enums/message_media_type.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from enum import auto
@@ -22,7 +23,7 @@ from .auto_name import AutoName
class MessageMediaType(AutoName):
- """Message media type enumeration used in :obj:`~pyrogram.types.Message`."""
+ """Message media type enumeration used in :obj:`~pyrofork.types.Message`."""
AUDIO = auto()
"Audio media"
diff --git a/pyrogram/enums/message_service_type.py b/pyrofork/enums/message_service_type.py
similarity index 97%
rename from pyrogram/enums/message_service_type.py
rename to pyrofork/enums/message_service_type.py
index fe7cf324..42fffae4 100644
--- a/pyrogram/enums/message_service_type.py
+++ b/pyrofork/enums/message_service_type.py
@@ -23,7 +23,7 @@ from .auto_name import AutoName
class MessageServiceType(AutoName):
- """Message service type enumeration used in :obj:`~pyrogram.types.Message`."""
+ """Message service type enumeration used in :obj:`~pyrofork.types.Message`."""
NEW_CHAT_MEMBERS = auto()
"New members join"
diff --git a/pyrogram/enums/messages_filter.py b/pyrofork/enums/messages_filter.py
similarity index 79%
rename from pyrogram/enums/messages_filter.py
rename to pyrofork/enums/messages_filter.py
index 67bfac63..eddc7015 100644
--- a/pyrogram/enums/messages_filter.py
+++ b/pyrofork/enums/messages_filter.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-from pyrogram import raw
+from pyrofork import raw
from .auto_name import AutoName
class MessagesFilter(AutoName):
- """Messages filter enumeration used in :meth:`~pyrogram.Client.search_messages` and :meth:`~pyrogram.Client.search_global`"""
+ """Messages filter enumeration used in :meth:`~pyrofork.Client.search_messages` and :meth:`~pyrofork.Client.search_global`"""
EMPTY = raw.types.InputMessagesFilterEmpty
"Empty filter (any kind of messages)"
diff --git a/pyrogram/enums/next_code_type.py b/pyrofork/enums/next_code_type.py
similarity index 71%
rename from pyrogram/enums/next_code_type.py
rename to pyrofork/enums/next_code_type.py
index 7b3137a7..e0fe1c0f 100644
--- a/pyrogram/enums/next_code_type.py
+++ b/pyrofork/enums/next_code_type.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-from pyrogram import raw
+from pyrofork import raw
from .auto_name import AutoName
class NextCodeType(AutoName):
- """Next code type enumeration used in :obj:`~pyrogram.types.SentCode`."""
+ """Next code type enumeration used in :obj:`~pyrofork.types.SentCode`."""
CALL = raw.types.auth.CodeTypeCall
"The code will be sent via a phone call. A synthesized voice will tell the user which verification code to input."
diff --git a/pyrogram/enums/parse_mode.py b/pyrofork/enums/parse_mode.py
similarity index 71%
rename from pyrogram/enums/parse_mode.py
rename to pyrofork/enums/parse_mode.py
index 26dc165a..6e2a19f3 100644
--- a/pyrogram/enums/parse_mode.py
+++ b/pyrofork/enums/parse_mode.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from enum import auto
diff --git a/pyrogram/enums/poll_type.py b/pyrofork/enums/poll_type.py
similarity index 62%
rename from pyrogram/enums/poll_type.py
rename to pyrofork/enums/poll_type.py
index 384592de..dcdd14c2 100644
--- a/pyrogram/enums/poll_type.py
+++ b/pyrofork/enums/poll_type.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from enum import auto
@@ -22,7 +23,7 @@ from .auto_name import AutoName
class PollType(AutoName):
- """Poll type enumeration used in :obj:`~pyrogram.types.Poll`."""
+ """Poll type enumeration used in :obj:`~pyrofork.types.Poll`."""
QUIZ = auto()
"Quiz poll"
diff --git a/pyrogram/enums/profile_color.py b/pyrofork/enums/profile_color.py
similarity index 93%
rename from pyrogram/enums/profile_color.py
rename to pyrofork/enums/profile_color.py
index b86c42b1..783dbf53 100644
--- a/pyrogram/enums/profile_color.py
+++ b/pyrofork/enums/profile_color.py
@@ -21,7 +21,7 @@ from .auto_name import AutoName
class ProfileColor(AutoName):
- """Profile color enumeration used in :meth:`~pyrogram.Client.update_color` and :obj:`~pyrogram.types.ChatColor`."""
+ """Profile color enumeration used in :meth:`~pyrofork.Client.update_color` and :obj:`~pyrofork.types.ChatColor`."""
RED = 0
"Red color."
diff --git a/pyrogram/enums/reaction_type.py b/pyrofork/enums/reaction_type.py
similarity index 94%
rename from pyrogram/enums/reaction_type.py
rename to pyrofork/enums/reaction_type.py
index 829de1ec..251dfe2f 100644
--- a/pyrogram/enums/reaction_type.py
+++ b/pyrofork/enums/reaction_type.py
@@ -21,7 +21,7 @@ from .auto_name import AutoName
class ReactionType(AutoName):
- """Reaction type enumeration used in :obj:`~pyrogram.types.ReactionType`."""
+ """Reaction type enumeration used in :obj:`~pyrofork.types.ReactionType`."""
EMOJI = auto()
"""Emoji reaction type."""
diff --git a/pyrogram/enums/reply_color.py b/pyrofork/enums/reply_color.py
similarity index 95%
rename from pyrogram/enums/reply_color.py
rename to pyrofork/enums/reply_color.py
index 428297f6..327260ac 100644
--- a/pyrogram/enums/reply_color.py
+++ b/pyrofork/enums/reply_color.py
@@ -21,7 +21,7 @@ from .auto_name import AutoName
class ReplyColor(AutoName):
- """Reply color enumeration used in :meth:`~pyrogram.Client.update_color` and :obj:`~pyrogram.types.ChatColor`."""
+ """Reply color enumeration used in :meth:`~pyrofork.Client.update_color` and :obj:`~pyrofork.types.ChatColor`."""
RED = 0
"Red color."
diff --git a/pyrogram/enums/sent_code_type.py b/pyrofork/enums/sent_code_type.py
similarity index 74%
rename from pyrogram/enums/sent_code_type.py
rename to pyrofork/enums/sent_code_type.py
index 474ed6b0..0cad9aaf 100644
--- a/pyrogram/enums/sent_code_type.py
+++ b/pyrofork/enums/sent_code_type.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-from pyrogram import raw
+from pyrofork import raw
from .auto_name import AutoName
class SentCodeType(AutoName):
- """Sent code type enumeration used in :obj:`~pyrogram.types.SentCode`."""
+ """Sent code type enumeration used in :obj:`~pyrofork.types.SentCode`."""
APP = raw.types.auth.SentCodeTypeApp
"The code was sent through the telegram app."
diff --git a/pyrogram/enums/stories_privacy_rules.py b/pyrofork/enums/stories_privacy_rules.py
similarity index 95%
rename from pyrogram/enums/stories_privacy_rules.py
rename to pyrofork/enums/stories_privacy_rules.py
index 72728691..509a2955 100644
--- a/pyrogram/enums/stories_privacy_rules.py
+++ b/pyrofork/enums/stories_privacy_rules.py
@@ -22,7 +22,7 @@ from .auto_name import AutoName
class StoriesPrivacyRules(AutoName):
- """Stories privacy rules type enumeration used in :meth:`~pyrogram.Client.send_story` and :meth:`~pyrogram.Client.edit_story`."""
+ """Stories privacy rules type enumeration used in :meth:`~pyrofork.Client.send_story` and :meth:`~pyrofork.Client.edit_story`."""
PUBLIC = auto()
"Public stories"
diff --git a/pyrogram/enums/story_privacy.py b/pyrofork/enums/story_privacy.py
similarity index 94%
rename from pyrogram/enums/story_privacy.py
rename to pyrofork/enums/story_privacy.py
index 34367c8d..f384cd78 100644
--- a/pyrogram/enums/story_privacy.py
+++ b/pyrofork/enums/story_privacy.py
@@ -22,7 +22,7 @@ from .auto_name import AutoName
class StoryPrivacy(AutoName):
- """Story privacy type enumeration used in :obj:`~pyrogram.types.Story`."""
+ """Story privacy type enumeration used in :obj:`~pyrofork.types.Story`."""
PUBLIC = auto()
"Public stories"
diff --git a/pyrogram/enums/user_status.py b/pyrofork/enums/user_status.py
similarity index 69%
rename from pyrogram/enums/user_status.py
rename to pyrofork/enums/user_status.py
index c7c25234..4959f8a9 100644
--- a/pyrogram/enums/user_status.py
+++ b/pyrofork/enums/user_status.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from enum import auto
@@ -22,7 +23,7 @@ from .auto_name import AutoName
class UserStatus(AutoName):
- """User status enumeration used in :obj:`~pyrogram.types.User`."""
+ """User status enumeration used in :obj:`~pyrofork.types.User`."""
ONLINE = auto()
"""User is online"""
diff --git a/pyrogram/errors/__init__.py b/pyrofork/errors/__init__.py
similarity index 86%
rename from pyrogram/errors/__init__.py
rename to pyrofork/errors/__init__.py
index c084f877..f74d8e57 100644
--- a/pyrogram/errors/__init__.py
+++ b/pyrofork/errors/__init__.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from .exceptions import *
from .pyromod import *
diff --git a/pyrogram/errors/pyromod/__init__.py b/pyrofork/errors/pyromod/__init__.py
similarity index 100%
rename from pyrogram/errors/pyromod/__init__.py
rename to pyrofork/errors/pyromod/__init__.py
diff --git a/pyrogram/errors/pyromod/listener_stopped.py b/pyrofork/errors/pyromod/listener_stopped.py
similarity index 100%
rename from pyrogram/errors/pyromod/listener_stopped.py
rename to pyrofork/errors/pyromod/listener_stopped.py
diff --git a/pyrogram/errors/pyromod/listener_timeout.py b/pyrofork/errors/pyromod/listener_timeout.py
similarity index 100%
rename from pyrogram/errors/pyromod/listener_timeout.py
rename to pyrofork/errors/pyromod/listener_timeout.py
diff --git a/pyrogram/errors/rpc_error.py b/pyrofork/errors/rpc_error.py
similarity index 84%
rename from pyrogram/errors/rpc_error.py
rename to pyrofork/errors/rpc_error.py
index 63375f19..d8daa8a3 100644
--- a/pyrogram/errors/rpc_error.py
+++ b/pyrofork/errors/rpc_error.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import re
from datetime import datetime
from importlib import import_module
from typing import Type, Union
-from pyrogram import raw
-from pyrogram.raw.core import TLObject
+from pyrofork import raw
+from pyrofork.raw.core import TLObject
from .exceptions.all import exceptions
@@ -78,7 +79,7 @@ class RPCError(Exception):
if error_id not in exceptions[error_code]:
raise getattr(
- import_module("pyrogram.errors"),
+ import_module("pyrofork.errors"),
exceptions[error_code]["_"]
)(value=f"[{error_code} {error_message}]",
rpc_name=rpc_name,
@@ -89,7 +90,7 @@ class RPCError(Exception):
value = value.group(1) if value is not None else value
raise getattr(
- import_module("pyrogram.errors"),
+ import_module("pyrofork.errors"),
exceptions[error_code][error_id]
)(value=value,
rpc_name=rpc_name,
diff --git a/pyrogram/file_id.py b/pyrofork/file_id.py
similarity index 97%
rename from pyrogram/file_id.py
rename to pyrofork/file_id.py
index 1a54a49d..03c2ba7f 100644
--- a/pyrogram/file_id.py
+++ b/pyrofork/file_id.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import base64
import logging
@@ -23,7 +24,7 @@ from enum import IntEnum
from io import BytesIO
from typing import List
-from pyrogram.raw.core import Bytes, String
+from pyrofork.raw.core import Bytes, String
log = logging.getLogger(__name__)
diff --git a/pyrogram/filters.py b/pyrofork/filters.py
similarity index 91%
rename from pyrogram/filters.py
rename to pyrofork/filters.py
index bcb20c0e..e596243d 100644
--- a/pyrogram/filters.py
+++ b/pyrofork/filters.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import inspect
import re
from typing import Callable, List, Pattern, Union
-import pyrogram
-from pyrogram import enums
-from pyrogram.types import (
+import pyrofork
+from pyrofork import enums
+from pyrofork.types import (
CallbackQuery,
InlineKeyboardMarkup,
InlineQuery,
@@ -34,7 +35,7 @@ from pyrogram.types import (
class Filter:
- async def __call__(self, client: "pyrogram.Client", update: Update):
+ async def __call__(self, client: "pyrofork.Client", update: Update):
raise NotImplementedError
def __invert__(self):
@@ -51,7 +52,7 @@ class InvertFilter(Filter):
def __init__(self, base):
self.base = base
- async def __call__(self, client: "pyrogram.Client", update: Update):
+ async def __call__(self, client: "pyrofork.Client", update: Update):
if inspect.iscoroutinefunction(self.base.__call__):
x = await self.base(client, update)
else:
@@ -69,7 +70,7 @@ class AndFilter(Filter):
self.base = base
self.other = other
- async def __call__(self, client: "pyrogram.Client", update: Update):
+ async def __call__(self, client: "pyrofork.Client", update: Update):
if inspect.iscoroutinefunction(self.base.__call__):
x = await self.base(client, update)
else:
@@ -100,7 +101,7 @@ class OrFilter(Filter):
self.base = base
self.other = other
- async def __call__(self, client: "pyrogram.Client", update: Update):
+ async def __call__(self, client: "pyrofork.Client", update: Update):
if inspect.iscoroutinefunction(self.base.__call__):
x = await self.base(client, update)
else:
@@ -139,9 +140,9 @@ def create(func: Callable, name: str = None, **kwargs) -> Filter:
A function that accepts three positional arguments *(filter, client, update)* and returns a boolean: True if the
update should be handled, False otherwise.
The *filter* argument refers to the filter itself and can be used to access keyword arguments (read below).
- The *client* argument refers to the :obj:`~pyrogram.Client` that received the update.
+ The *client* argument refers to the :obj:`~pyrofork.Client` that received the update.
The *update* argument type will vary depending on which `Handler `_ is coming from.
- For example, in a :obj:`~pyrogram.handlers.MessageHandler` the *update* argument will be a :obj:`~pyrogram.types.Message`; in a :obj:`~pyrogram.handlers.CallbackQueryHandler` the *update* will be a :obj:`~pyrogram.types.CallbackQuery`.
+ For example, in a :obj:`~pyrofork.handlers.MessageHandler` the *update* argument will be a :obj:`~pyrofork.types.Message`; in a :obj:`~pyrofork.handlers.CallbackQueryHandler` the *update* will be a :obj:`~pyrofork.types.CallbackQuery`.
Your function body can then access the incoming update attributes and decide whether to allow it or not.
name (``str``, *optional*):
@@ -150,7 +151,7 @@ def create(func: Callable, name: str = None, **kwargs) -> Filter:
**kwargs (``any``, *optional*):
Any keyword argument you would like to pass. Useful when creating parameterized custom filters, such as
- :meth:`~pyrogram.filters.command` or :meth:`~pyrogram.filters.regex`.
+ :meth:`~pyrofork.filters.command` or :meth:`~pyrofork.filters.regex`.
"""
return type(
name or func.__name__ or CUSTOM_FILTER_NAME,
@@ -275,7 +276,7 @@ async def audio_filter(_, __, m: Message):
audio = create(audio_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Audio` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Audio` objects."""
# endregion
@@ -286,7 +287,7 @@ async def document_filter(_, __, m: Message):
document = create(document_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Document` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Document` objects."""
# endregion
@@ -297,7 +298,7 @@ async def photo_filter(_, __, m: Message):
photo = create(photo_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Photo` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Photo` objects."""
# endregion
@@ -308,7 +309,7 @@ async def sticker_filter(_, __, m: Message):
sticker = create(sticker_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Sticker` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Sticker` objects."""
# endregion
@@ -319,7 +320,7 @@ async def animation_filter(_, __, m: Message):
animation = create(animation_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Animation` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Animation` objects."""
# endregion
@@ -330,7 +331,7 @@ async def game_filter(_, __, m: Message):
game = create(game_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Game` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Game` objects."""
# endregion
@@ -341,7 +342,7 @@ async def video_filter(_, __, m: Message):
video = create(video_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Video` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Video` objects."""
# endregion
@@ -363,7 +364,7 @@ async def voice_filter(_, __, m: Message):
voice = create(voice_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Voice` note objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Voice` note objects."""
# endregion
@@ -374,7 +375,7 @@ async def video_note_filter(_, __, m: Message):
video_note = create(video_note_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.VideoNote` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.VideoNote` objects."""
# endregion
@@ -385,7 +386,7 @@ async def contact_filter(_, __, m: Message):
contact = create(contact_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Contact` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Contact` objects."""
# endregion
@@ -396,7 +397,7 @@ async def location_filter(_, __, m: Message):
location = create(location_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Location` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Location` objects."""
# endregion
@@ -407,7 +408,7 @@ async def venue_filter(_, __, m: Message):
venue = create(venue_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Venue` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Venue` objects."""
# endregion
@@ -429,7 +430,7 @@ async def poll_filter(_, __, m: Message):
poll = create(poll_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Poll` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Poll` objects."""
# endregion
@@ -440,7 +441,7 @@ async def dice_filter(_, __, m: Message):
dice = create(dice_filter)
-"""Filter messages that contain :obj:`~pyrogram.types.Dice` objects."""
+"""Filter messages that contain :obj:`~pyrofork.types.Dice` objects."""
# endregion
@@ -834,7 +835,7 @@ def command(commands: Union[str, List[str]], prefixes: Union[str, List[str]] = "
The command or list of commands as string the filter should look for.
Examples: "start", ["start", "help", "settings"]. When a message text containing
a command arrives, the command itself and its arguments will be stored in the *command*
- field of the :obj:`~pyrogram.types.Message`.
+ field of the :obj:`~pyrofork.types.Message`.
prefixes (``str`` | ``list``, *optional*):
A prefix or a list of prefixes as string the filter should look for.
@@ -847,7 +848,7 @@ def command(commands: Union[str, List[str]], prefixes: Union[str, List[str]] = "
"""
command_re = re.compile(r"([\"'])(.*?)(?`_ are
stored in the ``matches`` field of the update object itself.
diff --git a/pyrogram/handlers/__init__.py b/pyrofork/handlers/__init__.py
similarity index 100%
rename from pyrogram/handlers/__init__.py
rename to pyrofork/handlers/__init__.py
diff --git a/pyrogram/handlers/callback_query_handler.py b/pyrofork/handlers/callback_query_handler.py
similarity index 86%
rename from pyrogram/handlers/callback_query_handler.py
rename to pyrofork/handlers/callback_query_handler.py
index 88ea285f..88bdeb05 100644
--- a/pyrogram/handlers/callback_query_handler.py
+++ b/pyrofork/handlers/callback_query_handler.py
@@ -1,38 +1,39 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from asyncio import iscoroutinefunction
from typing import Callable, Tuple
-import pyrogram
+import pyrofork
-from pyrogram.utils import PyromodConfig
-from pyrogram.types import CallbackQuery, Identifier, Listener
+from pyrofork.utils import PyromodConfig
+from pyrofork.types import CallbackQuery, Identifier, Listener
from .handler import Handler
class CallbackQueryHandler(Handler):
"""The CallbackQuery handler class. Used to handle callback queries coming from inline buttons.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_callback_query` decorator.
+ :meth:`~pyrofork.Client.on_callback_query` decorator.
Parameters:
callback (``Callable``):
@@ -44,10 +45,10 @@ class CallbackQueryHandler(Handler):
in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the message handler.
- callback_query (:obj:`~pyrogram.types.CallbackQuery`):
+ callback_query (:obj:`~pyrofork.types.CallbackQuery`):
The received callback query.
"""
@@ -85,7 +86,7 @@ class CallbackQueryHandler(Handler):
)
async def check_if_has_matching_listener(
- self, client: "pyrogram.Client", query: CallbackQuery
+ self, client: "pyrofork.Client", query: CallbackQuery
) -> Tuple[bool, Listener]:
"""
Checks if the CallbackQuery object has a matching listener.
@@ -99,7 +100,7 @@ class CallbackQueryHandler(Handler):
data = self.compose_data_identifier(query)
listener = client.get_listener_matching_with_data(
- data, pyrogram.enums.ListenerTypes.CALLBACK_QUERY
+ data, pyrofork.enums.ListenerTypes.CALLBACK_QUERY
)
listener_does_match = False
@@ -118,7 +119,7 @@ class CallbackQueryHandler(Handler):
return listener_does_match, listener
- async def check(self, client: "pyrogram.Client", query: CallbackQuery):
+ async def check(self, client: "pyrofork.Client", query: CallbackQuery):
"""
Checks if the CallbackQuery object has a matching listener or handler.
@@ -172,7 +173,7 @@ class CallbackQueryHandler(Handler):
return listener_does_match or handler_does_match
async def resolve_future_or_callback(
- self, client: "pyrogram.Client", query: CallbackQuery, *args
+ self, client: "pyrofork.Client", query: CallbackQuery, *args
):
"""
Resolves the future or calls the callback of the listener. Will call the original handler if no listener.
@@ -192,14 +193,14 @@ class CallbackQueryHandler(Handler):
if listener.future and not listener.future.done():
listener.future.set_result(query)
- raise pyrogram.StopPropagation
+ raise pyrofork.StopPropagation
elif listener.callback:
if iscoroutinefunction(listener.callback):
await listener.callback(client, query, *args)
else:
listener.callback(client, query, *args)
- raise pyrogram.StopPropagation
+ raise pyrofork.StopPropagation
else:
raise ValueError("Listener must have either a future or a callback")
else:
diff --git a/pyrogram/handlers/chat_join_request_handler.py b/pyrofork/handlers/chat_join_request_handler.py
similarity index 71%
rename from pyrogram/handlers/chat_join_request_handler.py
rename to pyrofork/handlers/chat_join_request_handler.py
index 54b8b86a..e2423d52 100644
--- a/pyrogram/handlers/chat_join_request_handler.py
+++ b/pyrofork/handlers/chat_join_request_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -23,10 +24,10 @@ from .handler import Handler
class ChatJoinRequestHandler(Handler):
"""The ChatJoinRequest handler class. Used to handle join chat requests.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`.
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`.
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_chat_join_request` decorator.
+ :meth:`~pyrofork.Client.on_chat_join_request` decorator.
Parameters:
callback (``Callable``):
@@ -38,10 +39,10 @@ class ChatJoinRequestHandler(Handler):
Pass one or more filters to allow only a subset of updates to be passed in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the handler.
- chat_join_request (:obj:`~pyrogram.types.ChatJoinRequest`):
+ chat_join_request (:obj:`~pyrofork.types.ChatJoinRequest`):
The received chat join request.
"""
diff --git a/pyrogram/handlers/chat_member_updated_handler.py b/pyrofork/handlers/chat_member_updated_handler.py
similarity index 71%
rename from pyrogram/handlers/chat_member_updated_handler.py
rename to pyrofork/handlers/chat_member_updated_handler.py
index a89e7e2b..2a00b71b 100644
--- a/pyrogram/handlers/chat_member_updated_handler.py
+++ b/pyrofork/handlers/chat_member_updated_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -23,10 +24,10 @@ from .handler import Handler
class ChatMemberUpdatedHandler(Handler):
"""The ChatMemberUpdated handler class. Used to handle changes in the status of a chat member.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`.
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`.
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_chat_member_updated` decorator.
+ :meth:`~pyrofork.Client.on_chat_member_updated` decorator.
Parameters:
callback (``Callable``):
@@ -38,10 +39,10 @@ class ChatMemberUpdatedHandler(Handler):
Pass one or more filters to allow only a subset of updates to be passed in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the handler.
- chat_member_updated (:obj:`~pyrogram.types.ChatMemberUpdated`):
+ chat_member_updated (:obj:`~pyrofork.types.ChatMemberUpdated`):
The received chat member update.
"""
diff --git a/pyrogram/handlers/chosen_inline_result_handler.py b/pyrofork/handlers/chosen_inline_result_handler.py
similarity index 72%
rename from pyrogram/handlers/chosen_inline_result_handler.py
rename to pyrofork/handlers/chosen_inline_result_handler.py
index 1c04f8f4..c24385b2 100644
--- a/pyrogram/handlers/chosen_inline_result_handler.py
+++ b/pyrofork/handlers/chosen_inline_result_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -23,10 +24,10 @@ from .handler import Handler
class ChosenInlineResultHandler(Handler):
"""The ChosenInlineResultHandler handler class. Used to handle chosen inline results coming from inline queries.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_chosen_inline_result` decorator.
+ :meth:`~pyrofork.Client.on_chosen_inline_result` decorator.
Parameters:
callback (``Callable``):
@@ -39,10 +40,10 @@ class ChosenInlineResultHandler(Handler):
in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the message handler.
- chosen_inline_result (:obj:`~pyrogram.types.ChosenInlineResult`):
+ chosen_inline_result (:obj:`~pyrofork.types.ChosenInlineResult`):
The received chosen inline result.
"""
diff --git a/pyrogram/handlers/conversation_handler.py b/pyrofork/handlers/conversation_handler.py
similarity index 80%
rename from pyrogram/handlers/conversation_handler.py
rename to pyrofork/handlers/conversation_handler.py
index 03de1e84..3e28cf3e 100644
--- a/pyrogram/handlers/conversation_handler.py
+++ b/pyrofork/handlers/conversation_handler.py
@@ -1,26 +1,27 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import inspect
from typing import Union
-import pyrogram
-from pyrogram.types import Message, CallbackQuery
+import pyrofork
+from pyrofork.types import Message, CallbackQuery
from .message_handler import MessageHandler
from .callback_query_handler import CallbackQueryHandler
@@ -30,7 +31,7 @@ class ConversationHandler(MessageHandler, CallbackQueryHandler):
def __init__(self):
self.waiters = {}
- async def check(self, client: "pyrogram.Client", update: Union[Message, CallbackQuery]):
+ async def check(self, client: "pyrofork.Client", update: Union[Message, CallbackQuery]):
if isinstance(update, Message) and update.outgoing:
return False
diff --git a/pyrogram/handlers/deleted_messages_handler.py b/pyrofork/handlers/deleted_messages_handler.py
similarity index 72%
rename from pyrogram/handlers/deleted_messages_handler.py
rename to pyrofork/handlers/deleted_messages_handler.py
index ab9f8347..fb8e14a5 100644
--- a/pyrogram/handlers/deleted_messages_handler.py
+++ b/pyrofork/handlers/deleted_messages_handler.py
@@ -1,35 +1,36 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import List, Callable
-import pyrogram
-from pyrogram.filters import Filter
-from pyrogram.types import Message
+import pyrofork
+from pyrofork.filters import Filter
+from pyrofork.types import Message
from .handler import Handler
class DeletedMessagesHandler(Handler):
"""The deleted messages handler class. Used to handle deleted messages coming from any chat
- (private, group, channel). It is intended to be used with :meth:`~pyrogram.Client.add_handler`
+ (private, group, channel). It is intended to be used with :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_deleted_messages` decorator.
+ :meth:`~pyrofork.Client.on_deleted_messages` decorator.
Parameters:
callback (``Callable``):
@@ -41,17 +42,17 @@ class DeletedMessagesHandler(Handler):
in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the message handler.
- messages (List of :obj:`~pyrogram.types.Message`):
+ messages (List of :obj:`~pyrofork.types.Message`):
The deleted messages, as list.
"""
def __init__(self, callback: Callable, filters: Filter = None):
super().__init__(callback, filters)
- async def check(self, client: "pyrogram.Client", messages: List[Message]):
+ async def check(self, client: "pyrofork.Client", messages: List[Message]):
# Every message should be checked, if at least one matches the filter True is returned
# otherwise, or if the list is empty, False is returned
for message in messages:
diff --git a/pyrogram/handlers/disconnect_handler.py b/pyrofork/handlers/disconnect_handler.py
similarity index 71%
rename from pyrogram/handlers/disconnect_handler.py
rename to pyrofork/handlers/disconnect_handler.py
index 7420afd6..cf516e3b 100644
--- a/pyrogram/handlers/disconnect_handler.py
+++ b/pyrofork/handlers/disconnect_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -23,10 +24,10 @@ from .handler import Handler
class DisconnectHandler(Handler):
"""The Disconnect handler class. Used to handle disconnections. It is intended to be used with
- :meth:`~pyrogram.Client.add_handler`
+ :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_disconnect` decorator.
+ :meth:`~pyrofork.Client.on_disconnect` decorator.
Parameters:
callback (``Callable``):
@@ -34,7 +35,7 @@ class DisconnectHandler(Handler):
as positional argument (look at the section below for a detailed description).
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself. Useful, for example, when you want to change the proxy before a new connection
is established.
"""
diff --git a/pyrogram/handlers/edited_message_handler.py b/pyrofork/handlers/edited_message_handler.py
similarity index 71%
rename from pyrogram/handlers/edited_message_handler.py
rename to pyrofork/handlers/edited_message_handler.py
index 78deaf0f..4eefde73 100644
--- a/pyrogram/handlers/edited_message_handler.py
+++ b/pyrofork/handlers/edited_message_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -23,10 +24,10 @@ from .handler import Handler
class EditedMessageHandler(Handler):
"""The EditedMessage handler class. Used to handle edited messages.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_edited_message` decorator.
+ :meth:`~pyrofork.Client.on_edited_message` decorator.
Parameters:
callback (``Callable``):
@@ -38,10 +39,10 @@ class EditedMessageHandler(Handler):
in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the message handler.
- edited_message (:obj:`~pyrogram.types.Message`):
+ edited_message (:obj:`~pyrofork.types.Message`):
The received edited message.
"""
diff --git a/pyrogram/handlers/handler.py b/pyrofork/handlers/handler.py
similarity index 68%
rename from pyrogram/handlers/handler.py
rename to pyrofork/handlers/handler.py
index c666d042..1f82206d 100644
--- a/pyrogram/handlers/handler.py
+++ b/pyrofork/handlers/handler.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import inspect
from typing import Callable
-import pyrogram
-from pyrogram.filters import Filter
-from pyrogram.types import Update
+import pyrofork
+from pyrofork.filters import Filter
+from pyrofork.types import Update
class Handler:
@@ -29,7 +30,7 @@ class Handler:
self.callback = callback
self.filters = filters
- async def check(self, client: "pyrogram.Client", update: Update):
+ async def check(self, client: "pyrofork.Client", update: Update):
if callable(self.filters):
if inspect.iscoroutinefunction(self.filters.__call__):
return await self.filters(client, update)
diff --git a/pyrogram/handlers/inline_query_handler.py b/pyrofork/handlers/inline_query_handler.py
similarity index 71%
rename from pyrogram/handlers/inline_query_handler.py
rename to pyrofork/handlers/inline_query_handler.py
index f5ea23bc..f3290dea 100644
--- a/pyrogram/handlers/inline_query_handler.py
+++ b/pyrofork/handlers/inline_query_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -23,10 +24,10 @@ from .handler import Handler
class InlineQueryHandler(Handler):
"""The InlineQuery handler class. Used to handle inline queries.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_inline_query` decorator.
+ :meth:`~pyrofork.Client.on_inline_query` decorator.
Parameters:
callback (``Callable``):
@@ -38,10 +39,10 @@ class InlineQueryHandler(Handler):
in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the inline query handler.
- inline_query (:obj:`~pyrogram.types.InlineQuery`):
+ inline_query (:obj:`~pyrofork.types.InlineQuery`):
The received inline query.
"""
diff --git a/pyrogram/handlers/message_handler.py b/pyrofork/handlers/message_handler.py
similarity index 84%
rename from pyrogram/handlers/message_handler.py
rename to pyrofork/handlers/message_handler.py
index 55739c63..1206418f 100644
--- a/pyrogram/handlers/message_handler.py
+++ b/pyrofork/handlers/message_handler.py
@@ -1,35 +1,36 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from inspect import iscoroutinefunction
from typing import Callable
-import pyrogram
+import pyrofork
-from pyrogram.types import Message, Identifier
+from pyrofork.types import Message, Identifier
from .handler import Handler
class MessageHandler(Handler):
"""The Message handler class. Used to handle new messages.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_message` decorator.
+ :meth:`~pyrofork.Client.on_message` decorator.
Parameters:
callback (``Callable``):
@@ -41,10 +42,10 @@ class MessageHandler(Handler):
in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the message handler.
- message (:obj:`~pyrogram.types.Message`):
+ message (:obj:`~pyrofork.types.Message`):
The received message.
"""
@@ -52,7 +53,7 @@ class MessageHandler(Handler):
self.original_callback = callback
super().__init__(self.resolve_future_or_callback, filters)
- async def check_if_has_matching_listener(self, client: "pyrogram.Client", message: Message):
+ async def check_if_has_matching_listener(self, client: "pyrofork.Client", message: Message):
"""
Checks if the message has a matching listener.
@@ -73,7 +74,7 @@ class MessageHandler(Handler):
from_user_id=[from_user_id, from_user_username],
)
- listener = client.get_listener_matching_with_data(data, pyrogram.enums.ListenerTypes.MESSAGE)
+ listener = client.get_listener_matching_with_data(data, pyrofork.enums.ListenerTypes.MESSAGE)
listener_does_match = False
@@ -91,7 +92,7 @@ class MessageHandler(Handler):
return listener_does_match, listener
- async def check(self, client: "pyrogram.Client", message: Message):
+ async def check(self, client: "pyrofork.Client", message: Message):
"""
Checks if the message has a matching listener or handler and its filters does match with the Message.
@@ -117,7 +118,7 @@ class MessageHandler(Handler):
# exists but its filters doesn't match
return listener_does_match or handler_does_match
- async def resolve_future_or_callback(self, client: "pyrogram.Client", message: Message, *args):
+ async def resolve_future_or_callback(self, client: "pyrofork.Client", message: Message, *args):
"""
Resolves the future or calls the callback of the listener if the message has a matching listener.
@@ -136,14 +137,14 @@ class MessageHandler(Handler):
if listener.future and not listener.future.done():
listener.future.set_result(message)
- raise pyrogram.StopPropagation
+ raise pyrofork.StopPropagation
elif listener.callback:
if iscoroutinefunction(listener.callback):
await listener.callback(client, message, *args)
else:
listener.callback(client, message, *args)
- raise pyrogram.StopPropagation
+ raise pyrofork.StopPropagation
else:
raise ValueError("Listener must have either a future or a callback")
else:
diff --git a/pyrogram/handlers/message_reaction_count_updated_handler.py b/pyrofork/handlers/message_reaction_count_updated_handler.py
similarity index 73%
rename from pyrogram/handlers/message_reaction_count_updated_handler.py
rename to pyrofork/handlers/message_reaction_count_updated_handler.py
index 74ab37a8..843656b2 100644
--- a/pyrogram/handlers/message_reaction_count_updated_handler.py
+++ b/pyrofork/handlers/message_reaction_count_updated_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -25,10 +26,10 @@ class MessageReactionCountUpdatedHandler(Handler):
"""The MessageReactionCountUpdated handler class.
Used to handle changes in the anonymous reaction of a message.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`.
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`.
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_message_reaction_count_updated` decorator.
+ :meth:`~pyrofork.Client.on_message_reaction_count_updated` decorator.
Parameters:
callback (``Callable``):
@@ -40,10 +41,10 @@ class MessageReactionCountUpdatedHandler(Handler):
Pass one or more filters to allow only a subset of updates to be passed in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the handler.
- message_reaction_count_updated (:obj:`~pyrogram.types.MessageReactionCountUpdated`):
+ message_reaction_count_updated (:obj:`~pyrofork.types.MessageReactionCountUpdated`):
The received message reaction count update.
"""
diff --git a/pyrogram/handlers/message_reaction_updated_handler.py b/pyrofork/handlers/message_reaction_updated_handler.py
similarity index 72%
rename from pyrogram/handlers/message_reaction_updated_handler.py
rename to pyrofork/handlers/message_reaction_updated_handler.py
index ea86a6d7..4efd1bef 100644
--- a/pyrogram/handlers/message_reaction_updated_handler.py
+++ b/pyrofork/handlers/message_reaction_updated_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -25,10 +26,10 @@ class MessageReactionUpdatedHandler(Handler):
"""The MessageReactionUpdated handler class.
Used to handle changes in the reaction of a message.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`.
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`.
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_message_reaction_updated` decorator.
+ :meth:`~pyrofork.Client.on_message_reaction_updated` decorator.
Parameters:
callback (``Callable``):
@@ -40,10 +41,10 @@ class MessageReactionUpdatedHandler(Handler):
Pass one or more filters to allow only a subset of updates to be passed in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the handler.
- message_reaction_updated (:obj:`~pyrogram.types.MessageReactionUpdated`):
+ message_reaction_updated (:obj:`~pyrofork.types.MessageReactionUpdated`):
The received message reaction update.
"""
diff --git a/pyrogram/handlers/poll_handler.py b/pyrofork/handlers/poll_handler.py
similarity index 71%
rename from pyrogram/handlers/poll_handler.py
rename to pyrofork/handlers/poll_handler.py
index 332ca7ea..eea7ab97 100644
--- a/pyrogram/handlers/poll_handler.py
+++ b/pyrofork/handlers/poll_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -24,10 +25,10 @@ from .handler import Handler
class PollHandler(Handler):
"""The Poll handler class. Used to handle polls updates.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_poll` decorator.
+ :meth:`~pyrofork.Client.on_poll` decorator.
Parameters:
callback (``Callable``):
@@ -39,10 +40,10 @@ class PollHandler(Handler):
in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the poll handler.
- poll (:obj:`~pyrogram.types.Poll`):
+ poll (:obj:`~pyrofork.types.Poll`):
The received poll.
"""
diff --git a/pyrogram/handlers/raw_update_handler.py b/pyrofork/handlers/raw_update_handler.py
similarity index 68%
rename from pyrogram/handlers/raw_update_handler.py
rename to pyrofork/handlers/raw_update_handler.py
index d957083b..cf3b2e9b 100644
--- a/pyrogram/handlers/raw_update_handler.py
+++ b/pyrofork/handlers/raw_update_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -23,10 +24,10 @@ from .handler import Handler
class RawUpdateHandler(Handler):
"""The Raw Update handler class. Used to handle raw updates. It is intended to be used with
- :meth:`~pyrogram.Client.add_handler`
+ :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_raw_update` decorator.
+ :meth:`~pyrofork.Client.on_raw_update` decorator.
Parameters:
callback (``Callable``):
@@ -35,21 +36,21 @@ class RawUpdateHandler(Handler):
a detailed description).
Other Parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the update handler.
update (``Update``):
The received update, which can be one of the many single Updates listed in the
- :obj:`~pyrogram.raw.base.Update` base type.
+ :obj:`~pyrofork.raw.base.Update` base type.
users (``dict``):
- Dictionary of all :obj:`~pyrogram.types.User` mentioned in the update.
+ Dictionary of all :obj:`~pyrofork.types.User` mentioned in the update.
You can access extra info about the user (such as *first_name*, *last_name*, etc...) by using
the IDs you find in the *update* argument (e.g.: *users[1768841572]*).
chats (``dict``):
- Dictionary of all :obj:`~pyrogram.types.Chat` and
- :obj:`~pyrogram.raw.types.Channel` mentioned in the update.
+ Dictionary of all :obj:`~pyrofork.types.Chat` and
+ :obj:`~pyrofork.raw.types.Channel` mentioned in the update.
You can access extra info about the chat (such as *title*, *participants_count*, etc...)
by using the IDs you find in the *update* argument (e.g.: *chats[1701277281]*).
@@ -57,10 +58,10 @@ class RawUpdateHandler(Handler):
The following Empty or Forbidden types may exist inside the *users* and *chats* dictionaries.
They mean you have been blocked by the user or banned from the group/channel.
- - :obj:`~pyrogram.raw.types.UserEmpty`
- - :obj:`~pyrogram.raw.types.ChatEmpty`
- - :obj:`~pyrogram.raw.types.ChatForbidden`
- - :obj:`~pyrogram.raw.types.ChannelForbidden`
+ - :obj:`~pyrofork.raw.types.UserEmpty`
+ - :obj:`~pyrofork.raw.types.ChatEmpty`
+ - :obj:`~pyrofork.raw.types.ChatForbidden`
+ - :obj:`~pyrofork.raw.types.ChannelForbidden`
"""
def __init__(self, callback: Callable):
diff --git a/pyrogram/handlers/story_handler.py b/pyrofork/handlers/story_handler.py
similarity index 89%
rename from pyrogram/handlers/story_handler.py
rename to pyrofork/handlers/story_handler.py
index f881a89e..e7b25b96 100644
--- a/pyrogram/handlers/story_handler.py
+++ b/pyrofork/handlers/story_handler.py
@@ -23,10 +23,10 @@ from .handler import Handler
class StoryHandler(Handler):
"""The Story handler class. Used to handle new stories.
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`
For a nicer way to register this handler, have a look at the
- :meth:`~pyrogram.Client.on_story` decorator.
+ :meth:`~pyrofork.Client.on_story` decorator.
Parameters:
callback (``Callable``):
@@ -38,10 +38,10 @@ class StoryHandler(Handler):
in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the story handler.
- story (:obj:`~pyrogram.types.Story`):
+ story (:obj:`~pyrofork.types.Story`):
The received story.
"""
diff --git a/pyrogram/handlers/user_status_handler.py b/pyrofork/handlers/user_status_handler.py
similarity index 72%
rename from pyrogram/handlers/user_status_handler.py
rename to pyrofork/handlers/user_status_handler.py
index f10871e8..7a28995d 100644
--- a/pyrogram/handlers/user_status_handler.py
+++ b/pyrofork/handlers/user_status_handler.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Callable
@@ -23,9 +24,9 @@ from .handler import Handler
class UserStatusHandler(Handler):
"""The UserStatus handler class. Used to handle user status updates (user going online or offline).
- It is intended to be used with :meth:`~pyrogram.Client.add_handler`.
+ It is intended to be used with :meth:`~pyrofork.Client.add_handler`.
- For a nicer way to register this handler, have a look at the :meth:`~pyrogram.Client.on_user_status` decorator.
+ For a nicer way to register this handler, have a look at the :meth:`~pyrofork.Client.on_user_status` decorator.
Parameters:
callback (``Callable``):
@@ -36,10 +37,10 @@ class UserStatusHandler(Handler):
Pass one or more filters to allow only a subset of users to be passed in your callback function.
Other parameters:
- client (:obj:`~pyrogram.Client`):
+ client (:obj:`~pyrofork.Client`):
The Client itself, useful when you want to call other API methods inside the user status handler.
- user (:obj:`~pyrogram.types.User`):
+ user (:obj:`~pyrofork.types.User`):
The user containing the updated status.
"""
diff --git a/pyrogram/helpers/__init__.py b/pyrofork/helpers/__init__.py
similarity index 94%
rename from pyrogram/helpers/__init__.py
rename to pyrofork/helpers/__init__.py
index 786d7e01..e8d1bc4f 100644
--- a/pyrogram/helpers/__init__.py
+++ b/pyrofork/helpers/__init__.py
@@ -1,5 +1,5 @@
"""
-pyromod - A monkeypatcher add-on for Pyrogram
+pyromod - A monkeypatcher add-on for Pyrofork
Copyright (C) 2020 Cezar H.
This file is part of pyromod.
pyromod is free software: you can redistribute it and/or modify
diff --git a/pyrogram/helpers/helpers.py b/pyrofork/helpers/helpers.py
similarity index 99%
rename from pyrogram/helpers/helpers.py
rename to pyrofork/helpers/helpers.py
index 8aecc170..fab8a577 100644
--- a/pyrogram/helpers/helpers.py
+++ b/pyrofork/helpers/helpers.py
@@ -1,4 +1,4 @@
-from pyrogram.types import (
+from pyrofork.types import (
InlineKeyboardButton,
InlineKeyboardMarkup,
KeyboardButton,
diff --git a/pyrogram/methods/__init__.py b/pyrofork/methods/__init__.py
similarity index 95%
rename from pyrogram/methods/__init__.py
rename to pyrofork/methods/__init__.py
index e788ab46..4be54900 100644
--- a/pyrogram/methods/__init__.py
+++ b/pyrofork/methods/__init__.py
@@ -1,4 +1,4 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
# Copyright (C) 2022-present Mayuri-Chan
#
diff --git a/pyrogram/methods/advanced/__init__.py b/pyrofork/methods/advanced/__init__.py
similarity index 66%
rename from pyrogram/methods/advanced/__init__.py
rename to pyrofork/methods/advanced/__init__.py
index bf19658a..77cce16b 100644
--- a/pyrogram/methods/advanced/__init__.py
+++ b/pyrofork/methods/advanced/__init__.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from .invoke import Invoke
from .resolve_peer import ResolvePeer
diff --git a/pyrogram/methods/advanced/invoke.py b/pyrofork/methods/advanced/invoke.py
similarity index 78%
rename from pyrogram/methods/advanced/invoke.py
rename to pyrofork/methods/advanced/invoke.py
index 0af771ad..5de857b9 100644
--- a/pyrogram/methods/advanced/invoke.py
+++ b/pyrofork/methods/advanced/invoke.py
@@ -1,34 +1,35 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
-from pyrogram.raw.core import TLObject
-from pyrogram.session import Session
+import pyrofork
+from pyrofork import raw
+from pyrofork.raw.core import TLObject
+from pyrofork.session import Session
log = logging.getLogger(__name__)
class Invoke:
async def invoke(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
query: TLObject,
retries: int = Session.MAX_RETRIES,
timeout: float = Session.WAIT_TIMEOUT,
@@ -37,13 +38,13 @@ class Invoke:
"""Invoke raw Telegram functions.
This method makes it possible to manually call every single Telegram API method in a low-level manner.
- Available functions are listed in the :obj:`functions ` package and may accept compound
- data types from :obj:`types ` as well as bare types such as ``int``, ``str``, etc...
+ Available functions are listed in the :obj:`functions ` package and may accept compound
+ data types from :obj:`types ` as well as bare types such as ``int``, ``str``, etc...
.. note::
This is a utility method intended to be used **only** when working with raw
- :obj:`functions ` (i.e: a Telegram API method you wish to use which is not
+ :obj:`functions ` (i.e: a Telegram API method you wish to use which is not
available yet in the Client class as an easy-to-use method).
.. include:: /_includes/usable-by/users-bots.rst
diff --git a/pyrogram/methods/advanced/resolve_peer.py b/pyrofork/methods/advanced/resolve_peer.py
similarity index 87%
rename from pyrogram/methods/advanced/resolve_peer.py
rename to pyrofork/methods/advanced/resolve_peer.py
index c92ec90d..44e41089 100644
--- a/pyrogram/methods/advanced/resolve_peer.py
+++ b/pyrofork/methods/advanced/resolve_peer.py
@@ -1,36 +1,37 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
import re
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import utils
-from pyrogram.errors import PeerIdInvalid
+import pyrofork
+from pyrofork import raw
+from pyrofork import utils
+from pyrofork.errors import PeerIdInvalid
log = logging.getLogger(__name__)
class ResolvePeer:
async def resolve_peer(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
peer_id: Union[int, str]
) -> Union[raw.base.InputPeer, raw.base.InputUser, raw.base.InputChannel]:
"""Get the InputPeer of a known peer id.
@@ -39,7 +40,7 @@ class ResolvePeer:
.. note::
This is a utility method intended to be used **only** when working with raw
- :obj:`functions ` (i.e: a Telegram API method you wish to use which is not
+ :obj:`functions ` (i.e: a Telegram API method you wish to use which is not
available yet in the Client class as an easy-to-use method).
.. include:: /_includes/usable-by/users-bots.rst
diff --git a/pyrogram/methods/advanced/save_file.py b/pyrofork/methods/advanced/save_file.py
similarity index 93%
rename from pyrogram/methods/advanced/save_file.py
rename to pyrofork/methods/advanced/save_file.py
index 453a62af..6ee97a50 100644
--- a/pyrogram/methods/advanced/save_file.py
+++ b/pyrofork/methods/advanced/save_file.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import asyncio
import functools
@@ -27,17 +28,17 @@ from hashlib import md5
from pathlib import PurePath
from typing import Union, BinaryIO, Callable
-import pyrogram
-from pyrogram import StopTransmission
-from pyrogram import raw
-from pyrogram.session import Session
+import pyrofork
+from pyrofork import StopTransmission
+from pyrofork import raw
+from pyrofork.session import Session
log = logging.getLogger(__name__)
class SaveFile:
async def save_file(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
path: Union[str, BinaryIO],
file_id: int = None,
file_part: int = 0,
@@ -50,7 +51,7 @@ class SaveFile:
.. note::
This is a utility method intended to be used **only** when working with raw
- :obj:`functions ` (i.e: a Telegram API method you wish to use which is not
+ :obj:`functions ` (i.e: a Telegram API method you wish to use which is not
available yet in the Client class as an easy-to-use method).
.. include:: /_includes/usable-by/users-bots.rst
diff --git a/pyrogram/methods/auth/__init__.py b/pyrofork/methods/auth/__init__.py
similarity index 79%
rename from pyrogram/methods/auth/__init__.py
rename to pyrofork/methods/auth/__init__.py
index ce585648..d2af43be 100644
--- a/pyrogram/methods/auth/__init__.py
+++ b/pyrofork/methods/auth/__init__.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from .accept_terms_of_service import AcceptTermsOfService
from .check_password import CheckPassword
diff --git a/pyrogram/methods/auth/accept_terms_of_service.py b/pyrofork/methods/auth/accept_terms_of_service.py
similarity index 71%
rename from pyrogram/methods/auth/accept_terms_of_service.py
rename to pyrofork/methods/auth/accept_terms_of_service.py
index cc1fcf54..29c161a2 100644
--- a/pyrogram/methods/auth/accept_terms_of_service.py
+++ b/pyrofork/methods/auth/accept_terms_of_service.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class AcceptTermsOfService:
async def accept_terms_of_service(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
terms_of_service_id: str
) -> bool:
"""Accept the given terms of service.
diff --git a/pyrogram/methods/auth/check_password.py b/pyrofork/methods/auth/check_password.py
similarity index 71%
rename from pyrogram/methods/auth/check_password.py
rename to pyrofork/methods/auth/check_password.py
index 39aa82fc..3f95a356 100644
--- a/pyrogram/methods/auth/check_password.py
+++ b/pyrofork/methods/auth/check_password.py
@@ -1,34 +1,35 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
-from pyrogram.utils import compute_password_check
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
+from pyrofork.utils import compute_password_check
log = logging.getLogger(__name__)
class CheckPassword:
async def check_password(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
password: str
) -> "types.User":
"""Check your Two-Step Verification password and log in.
@@ -40,7 +41,7 @@ class CheckPassword:
Your Two-Step Verification password.
Returns:
- :obj:`~pyrogram.types.User`: On success, the authorized user is returned.
+ :obj:`~pyrofork.types.User`: On success, the authorized user is returned.
Raises:
BadRequest: In case the password is invalid.
diff --git a/pyrogram/methods/auth/connect.py b/pyrofork/methods/auth/connect.py
similarity index 75%
rename from pyrogram/methods/auth/connect.py
rename to pyrofork/methods/auth/connect.py
index 612e064b..16b38708 100644
--- a/pyrogram/methods/auth/connect.py
+++ b/pyrofork/methods/auth/connect.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram.session import Session
+import pyrofork
+from pyrofork.session import Session
class Connect:
async def connect(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
) -> bool:
"""
Connect the client to Telegram servers.
diff --git a/pyrogram/methods/auth/disconnect.py b/pyrofork/methods/auth/disconnect.py
similarity index 74%
rename from pyrogram/methods/auth/disconnect.py
rename to pyrofork/methods/auth/disconnect.py
index daa07b83..354834c4 100644
--- a/pyrogram/methods/auth/disconnect.py
+++ b/pyrofork/methods/auth/disconnect.py
@@ -1,27 +1,28 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-import pyrogram
+import pyrofork
class Disconnect:
async def disconnect(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
):
"""Disconnect the client from Telegram servers.
diff --git a/pyrogram/methods/auth/get_password_hint.py b/pyrofork/methods/auth/get_password_hint.py
similarity index 68%
rename from pyrogram/methods/auth/get_password_hint.py
rename to pyrofork/methods/auth/get_password_hint.py
index a57f7c80..72fb44c4 100644
--- a/pyrogram/methods/auth/get_password_hint.py
+++ b/pyrofork/methods/auth/get_password_hint.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
log = logging.getLogger(__name__)
class GetPasswordHint:
async def get_password_hint(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
) -> str:
"""Get your Two-Step Verification password hint.
diff --git a/pyrogram/methods/auth/initialize.py b/pyrofork/methods/auth/initialize.py
similarity index 77%
rename from pyrogram/methods/auth/initialize.py
rename to pyrofork/methods/auth/initialize.py
index 7188b668..1f295839 100644
--- a/pyrogram/methods/auth/initialize.py
+++ b/pyrofork/methods/auth/initialize.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import asyncio
import logging
-import pyrogram
+import pyrofork
log = logging.getLogger(__name__)
class Initialize:
async def initialize(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
):
"""Initialize the client by starting up workers.
diff --git a/pyrogram/methods/auth/log_out.py b/pyrofork/methods/auth/log_out.py
similarity index 74%
rename from pyrogram/methods/auth/log_out.py
rename to pyrofork/methods/auth/log_out.py
index 84b7db64..255e415e 100644
--- a/pyrogram/methods/auth/log_out.py
+++ b/pyrofork/methods/auth/log_out.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
log = logging.getLogger(__name__)
class LogOut:
async def log_out(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
):
"""Log out from Telegram and delete the *\\*.session* file.
diff --git a/pyrogram/methods/auth/recover_password.py b/pyrofork/methods/auth/recover_password.py
similarity index 72%
rename from pyrogram/methods/auth/recover_password.py
rename to pyrofork/methods/auth/recover_password.py
index 0a347507..f0bdc606 100644
--- a/pyrogram/methods/auth/recover_password.py
+++ b/pyrofork/methods/auth/recover_password.py
@@ -1,33 +1,34 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
log = logging.getLogger(__name__)
class RecoverPassword:
async def recover_password(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
recovery_code: str
) -> "types.User":
"""Recover your password with a recovery code and log in.
@@ -39,7 +40,7 @@ class RecoverPassword:
The recovery code sent via email.
Returns:
- :obj:`~pyrogram.types.User`: On success, the authorized user is returned and the Two-Step Verification
+ :obj:`~pyrofork.types.User`: On success, the authorized user is returned and the Two-Step Verification
password reset.
Raises:
diff --git a/pyrogram/methods/auth/resend_code.py b/pyrofork/methods/auth/resend_code.py
similarity index 73%
rename from pyrogram/methods/auth/resend_code.py
rename to pyrofork/methods/auth/resend_code.py
index 9644ac4f..7818a99b 100644
--- a/pyrogram/methods/auth/resend_code.py
+++ b/pyrofork/methods/auth/resend_code.py
@@ -1,40 +1,41 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
log = logging.getLogger(__name__)
class ResendCode:
async def resend_code(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
phone_number: str,
phone_code_hash: str
) -> "types.SentCode":
"""Re-send the confirmation code using a different type.
The type of the code to be re-sent is specified in the *next_type* attribute of the
- :obj:`~pyrogram.types.SentCode` object returned by :meth:`send_code`.
+ :obj:`~pyrofork.types.SentCode` object returned by :meth:`send_code`.
.. include:: /_includes/usable-by/users.rst
@@ -46,7 +47,7 @@ class ResendCode:
Confirmation code identifier.
Returns:
- :obj:`~pyrogram.types.SentCode`: On success, an object containing information on the re-sent confirmation
+ :obj:`~pyrofork.types.SentCode`: On success, an object containing information on the re-sent confirmation
code is returned.
Raises:
diff --git a/pyrogram/methods/auth/send_code.py b/pyrofork/methods/auth/send_code.py
similarity index 78%
rename from pyrogram/methods/auth/send_code.py
rename to pyrofork/methods/auth/send_code.py
index 92ffc999..daff2629 100644
--- a/pyrogram/methods/auth/send_code.py
+++ b/pyrofork/methods/auth/send_code.py
@@ -1,35 +1,36 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
-from pyrogram.errors import PhoneMigrate, NetworkMigrate
-from pyrogram.session import Session, Auth
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
+from pyrofork.errors import PhoneMigrate, NetworkMigrate
+from pyrofork.session import Session, Auth
log = logging.getLogger(__name__)
class SendCode:
async def send_code(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
phone_number: str
) -> "types.SentCode":
"""Send the confirmation code to the given phone number.
@@ -41,7 +42,7 @@ class SendCode:
Phone number in international format (includes the country prefix).
Returns:
- :obj:`~pyrogram.types.SentCode`: On success, an object containing information on the sent confirmation code
+ :obj:`~pyrofork.types.SentCode`: On success, an object containing information on the sent confirmation code
is returned.
Raises:
diff --git a/pyrogram/methods/auth/send_recovery_code.py b/pyrofork/methods/auth/send_recovery_code.py
similarity index 71%
rename from pyrogram/methods/auth/send_recovery_code.py
rename to pyrofork/methods/auth/send_recovery_code.py
index 9a25f3c6..dac60f06 100644
--- a/pyrogram/methods/auth/send_recovery_code.py
+++ b/pyrofork/methods/auth/send_recovery_code.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
log = logging.getLogger(__name__)
class SendRecoveryCode:
async def send_recovery_code(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
) -> str:
"""Send a code to your email to recover your password.
diff --git a/pyrogram/methods/auth/sign_in.py b/pyrofork/methods/auth/sign_in.py
similarity index 80%
rename from pyrogram/methods/auth/sign_in.py
rename to pyrofork/methods/auth/sign_in.py
index 9d77f1cd..b96f0ba6 100644
--- a/pyrogram/methods/auth/sign_in.py
+++ b/pyrofork/methods/auth/sign_in.py
@@ -1,34 +1,35 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
log = logging.getLogger(__name__)
class SignIn:
async def sign_in(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
phone_number: str,
phone_code_hash: str,
phone_code: str
@@ -42,15 +43,15 @@ class SignIn:
Phone number in international format (includes the country prefix).
phone_code_hash (``str``):
- Code identifier taken from the result of :meth:`~pyrogram.Client.send_code`.
+ Code identifier taken from the result of :meth:`~pyrofork.Client.send_code`.
phone_code (``str``):
The valid confirmation code you received (either as Telegram message or as SMS in your phone number).
Returns:
- :obj:`~pyrogram.types.User` | :obj:`~pyrogram.types.TermsOfService` | bool: On success, in case the
+ :obj:`~pyrofork.types.User` | :obj:`~pyrofork.types.TermsOfService` | bool: On success, in case the
authorization completed, the user is returned. In case the phone number needs to be registered first AND the
- terms of services accepted (with :meth:`~pyrogram.Client.accept_terms_of_service`), an object containing
+ terms of services accepted (with :meth:`~pyrofork.Client.accept_terms_of_service`), an object containing
them is returned. In case the phone number needs to be registered, but the terms of services don't need to
be accepted, False is returned instead.
diff --git a/pyrogram/methods/auth/sign_in_bot.py b/pyrofork/methods/auth/sign_in_bot.py
similarity index 78%
rename from pyrogram/methods/auth/sign_in_bot.py
rename to pyrofork/methods/auth/sign_in_bot.py
index 09a2f283..4132e450 100644
--- a/pyrogram/methods/auth/sign_in_bot.py
+++ b/pyrofork/methods/auth/sign_in_bot.py
@@ -1,35 +1,36 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
-from pyrogram.errors import UserMigrate
-from pyrogram.session import Session, Auth
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
+from pyrofork.errors import UserMigrate
+from pyrofork.session import Session, Auth
log = logging.getLogger(__name__)
class SignInBot:
async def sign_in_bot(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
bot_token: str
) -> "types.User":
"""Authorize a bot using its bot token generated by BotFather.
@@ -41,7 +42,7 @@ class SignInBot:
The bot token generated by BotFather
Returns:
- :obj:`~pyrogram.types.User`: On success, the bot identity is return in form of a user object.
+ :obj:`~pyrofork.types.User`: On success, the bot identity is return in form of a user object.
Raises:
BadRequest: In case the bot token is invalid.
diff --git a/pyrogram/methods/auth/sign_up.py b/pyrofork/methods/auth/sign_up.py
similarity index 77%
rename from pyrogram/methods/auth/sign_up.py
rename to pyrofork/methods/auth/sign_up.py
index f09a779d..46bafd4a 100644
--- a/pyrogram/methods/auth/sign_up.py
+++ b/pyrofork/methods/auth/sign_up.py
@@ -1,33 +1,34 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
log = logging.getLogger(__name__)
class SignUp:
async def sign_up(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
phone_number: str,
phone_code_hash: str,
first_name: str,
@@ -42,7 +43,7 @@ class SignUp:
Phone number in international format (includes the country prefix).
phone_code_hash (``str``):
- Code identifier taken from the result of :meth:`~pyrogram.Client.send_code`.
+ Code identifier taken from the result of :meth:`~pyrofork.Client.send_code`.
first_name (``str``):
New user first name.
@@ -51,7 +52,7 @@ class SignUp:
New user last name. Defaults to "" (empty string, no last name).
Returns:
- :obj:`~pyrogram.types.User`: On success, the new registered user is returned.
+ :obj:`~pyrofork.types.User`: On success, the new registered user is returned.
Raises:
BadRequest: In case the arguments are invalid.
diff --git a/pyrogram/methods/auth/terminate.py b/pyrofork/methods/auth/terminate.py
similarity index 76%
rename from pyrogram/methods/auth/terminate.py
rename to pyrofork/methods/auth/terminate.py
index d5fd949c..70f0005c 100644
--- a/pyrogram/methods/auth/terminate.py
+++ b/pyrofork/methods/auth/terminate.py
@@ -1,36 +1,37 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
log = logging.getLogger(__name__)
class Terminate:
async def terminate(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
):
"""Terminate the client by shutting down workers.
- This method does the opposite of :meth:`~pyrogram.Client.initialize`.
+ This method does the opposite of :meth:`~pyrofork.Client.initialize`.
It will stop the dispatcher and shut down updates and download workers.
Raises:
diff --git a/pyrogram/methods/bots/__init__.py b/pyrofork/methods/bots/__init__.py
similarity index 83%
rename from pyrogram/methods/bots/__init__.py
rename to pyrofork/methods/bots/__init__.py
index 53612555..717d1d1e 100644
--- a/pyrogram/methods/bots/__init__.py
+++ b/pyrofork/methods/bots/__init__.py
@@ -1,20 +1,21 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from .answer_callback_query import AnswerCallbackQuery
from .answer_inline_query import AnswerInlineQuery
diff --git a/pyrogram/methods/bots/answer_callback_query.py b/pyrofork/methods/bots/answer_callback_query.py
similarity index 87%
rename from pyrogram/methods/bots/answer_callback_query.py
rename to pyrofork/methods/bots/answer_callback_query.py
index a6d8747c..d139fb46 100644
--- a/pyrogram/methods/bots/answer_callback_query.py
+++ b/pyrofork/methods/bots/answer_callback_query.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class AnswerCallbackQuery:
async def answer_callback_query(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
callback_query_id: str,
text: str = None,
show_alert: bool = None,
diff --git a/pyrogram/methods/bots/answer_inline_query.py b/pyrofork/methods/bots/answer_inline_query.py
similarity index 88%
rename from pyrogram/methods/bots/answer_inline_query.py
rename to pyrofork/methods/bots/answer_inline_query.py
index c3a450a0..86845b8c 100644
--- a/pyrogram/methods/bots/answer_inline_query.py
+++ b/pyrofork/methods/bots/answer_inline_query.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Iterable
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class AnswerInlineQuery:
async def answer_inline_query(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
inline_query_id: str,
results: Iterable["types.InlineQueryResult"],
cache_time: int = 300,
@@ -45,7 +46,7 @@ class AnswerInlineQuery:
inline_query_id (``str``):
Unique identifier for the answered query.
- results (List of :obj:`~pyrogram.types.InlineQueryResult`):
+ results (List of :obj:`~pyrofork.types.InlineQueryResult`):
A list of results for the inline query.
cache_time (``int``, *optional*):
@@ -86,7 +87,7 @@ class AnswerInlineQuery:
Example:
.. code-block:: python
- from pyrogram.types import InlineQueryResultArticle, InputTextMessageContent
+ from pyrofork.types import InlineQueryResultArticle, InputTextMessageContent
await app.answer_inline_query(
inline_query_id,
diff --git a/pyrogram/methods/bots/answer_web_app_query.py b/pyrofork/methods/bots/answer_web_app_query.py
similarity index 71%
rename from pyrogram/methods/bots/answer_web_app_query.py
rename to pyrofork/methods/bots/answer_web_app_query.py
index 74f56079..8b34f0dc 100644
--- a/pyrogram/methods/bots/answer_web_app_query.py
+++ b/pyrofork/methods/bots/answer_web_app_query.py
@@ -1,29 +1,30 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class AnswerWebAppQuery:
async def answer_web_app_query(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
web_app_query_id: str,
result: "types.InlineQueryResult"
) -> "types.SentWebAppMessage":
@@ -36,11 +37,11 @@ class AnswerWebAppQuery:
web_app_query_id (``str``):
Unique identifier for the answered query.
- result (:obj:`~pyrogram.types.InlineQueryResult`):
+ result (:obj:`~pyrofork.types.InlineQueryResult`):
A list of results for the inline query.
Returns:
- :obj:`~pyrogram.types.SentWebAppMessage`: On success the sent web app message is returned.
+ :obj:`~pyrofork.types.SentWebAppMessage`: On success the sent web app message is returned.
"""
r = await self.invoke(
diff --git a/pyrogram/methods/bots/delete_bot_commands.py b/pyrofork/methods/bots/delete_bot_commands.py
similarity index 76%
rename from pyrogram/methods/bots/delete_bot_commands.py
rename to pyrofork/methods/bots/delete_bot_commands.py
index e8173d32..fbdde7dc 100644
--- a/pyrogram/methods/bots/delete_bot_commands.py
+++ b/pyrofork/methods/bots/delete_bot_commands.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw, types
+import pyrofork
+from pyrofork import raw, types
class DeleteBotCommands:
async def delete_bot_commands(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
scope: "types.BotCommandScope" = types.BotCommandScopeDefault(),
language_code: str = "",
) -> bool:
@@ -35,9 +36,9 @@ class DeleteBotCommands:
.. include:: /_includes/usable-by/bots.rst
Parameters:
- scope (:obj:`~pyrogram.types.BotCommandScope`, *optional*):
+ scope (:obj:`~pyrofork.types.BotCommandScope`, *optional*):
An object describing the scope of users for which the commands are relevant.
- Defaults to :obj:`~pyrogram.types.BotCommandScopeDefault`.
+ Defaults to :obj:`~pyrofork.types.BotCommandScopeDefault`.
language_code (``str``, *optional*):
A two-letter ISO 639-1 language code.
diff --git a/pyrogram/methods/bots/get_bot_commands.py b/pyrofork/methods/bots/get_bot_commands.py
similarity index 76%
rename from pyrogram/methods/bots/get_bot_commands.py
rename to pyrofork/methods/bots/get_bot_commands.py
index 78deff30..f9460d1d 100644
--- a/pyrogram/methods/bots/get_bot_commands.py
+++ b/pyrofork/methods/bots/get_bot_commands.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import List
-import pyrogram
-from pyrogram import raw, types
+import pyrofork
+from pyrofork import raw, types
class GetBotCommands:
async def get_bot_commands(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
scope: "types.BotCommandScope" = types.BotCommandScopeDefault(),
language_code: str = "",
) -> List["types.BotCommand"]:
@@ -37,9 +38,9 @@ class GetBotCommands:
.. include:: /_includes/usable-by/bots.rst
Parameters:
- scope (:obj:`~pyrogram.types.BotCommandScope`, *optional*):
+ scope (:obj:`~pyrofork.types.BotCommandScope`, *optional*):
An object describing the scope of users for which the commands are relevant.
- Defaults to :obj:`~pyrogram.types.BotCommandScopeDefault`.
+ Defaults to :obj:`~pyrofork.types.BotCommandScopeDefault`.
language_code (``str``, *optional*):
A two-letter ISO 639-1 language code.
@@ -47,7 +48,7 @@ class GetBotCommands:
dedicated commands.
Returns:
- List of :obj:`~pyrogram.types.BotCommand`: On success, the list of bot commands is returned.
+ List of :obj:`~pyrofork.types.BotCommand`: On success, the list of bot commands is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/bots/get_bot_default_privileges.py b/pyrofork/methods/bots/get_bot_default_privileges.py
similarity index 78%
rename from pyrogram/methods/bots/get_bot_default_privileges.py
rename to pyrofork/methods/bots/get_bot_default_privileges.py
index 217d9b43..d3ef098d 100644
--- a/pyrogram/methods/bots/get_bot_default_privileges.py
+++ b/pyrofork/methods/bots/get_bot_default_privileges.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Optional
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class GetBotDefaultPrivileges:
async def get_bot_default_privileges(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
for_channels: bool = None
) -> Optional["types.ChatPrivileges"]:
"""Get the current default privileges of the bot.
diff --git a/pyrogram/methods/bots/get_bot_info.py b/pyrofork/methods/bots/get_bot_info.py
similarity index 91%
rename from pyrogram/methods/bots/get_bot_info.py
rename to pyrofork/methods/bots/get_bot_info.py
index dcb60de6..744ddd26 100644
--- a/pyrogram/methods/bots/get_bot_info.py
+++ b/pyrofork/methods/bots/get_bot_info.py
@@ -18,16 +18,16 @@
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class GetBotInfo:
async def get_bot_info(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
lang_code: str,
bot: Union[int, str] = None
- ) -> pyrogram.types.BotInfo:
+ ) -> pyrofork.types.BotInfo:
"""Get the bot info in given language.
.. include:: /_includes/usable-by/users-bots.rst
@@ -46,4 +46,4 @@ class GetBotInfo:
if bot:
peer = await self.resolve_peer(bot)
r = await self.invoke(raw.functions.bots.GetBotInfo(lang_code=lang_code, bot=peer))
- return pyrogram.types.BotInfo._parse(r)
+ return pyrofork.types.BotInfo._parse(r)
diff --git a/pyrogram/methods/bots/get_chat_menu_button.py b/pyrofork/methods/bots/get_chat_menu_button.py
similarity index 81%
rename from pyrogram/methods/bots/get_chat_menu_button.py
rename to pyrofork/methods/bots/get_chat_menu_button.py
index 4f55abe0..ea6673e2 100644
--- a/pyrogram/methods/bots/get_chat_menu_button.py
+++ b/pyrofork/methods/bots/get_chat_menu_button.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class GetChatMenuButton:
async def get_chat_menu_button(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str] = None,
) -> "types.MenuButton":
"""Get the current value of the bot's menu button in a private chat, or the default menu button.
diff --git a/pyrogram/methods/bots/get_game_high_scores.py b/pyrofork/methods/bots/get_game_high_scores.py
similarity index 82%
rename from pyrogram/methods/bots/get_game_high_scores.py
rename to pyrofork/methods/bots/get_game_high_scores.py
index d8e21af4..5ffedba3 100644
--- a/pyrogram/methods/bots/get_game_high_scores.py
+++ b/pyrofork/methods/bots/get_game_high_scores.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union, List
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class GetGameHighScores:
async def get_game_high_scores(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
user_id: Union[int, str],
chat_id: Union[int, str],
message_id: int = None
@@ -52,7 +53,7 @@ class GetGameHighScores:
Required if inline_message_id is not specified.
Returns:
- List of :obj:`~pyrogram.types.GameHighScore`: On success.
+ List of :obj:`~pyrofork.types.GameHighScore`: On success.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/bots/get_inline_bot_results.py b/pyrofork/methods/bots/get_inline_bot_results.py
similarity index 82%
rename from pyrogram/methods/bots/get_inline_bot_results.py
rename to pyrofork/methods/bots/get_inline_bot_results.py
index b6605bf9..2cc6b728 100644
--- a/pyrogram/methods/bots/get_inline_bot_results.py
+++ b/pyrofork/methods/bots/get_inline_bot_results.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram.errors import UnknownError
+import pyrofork
+from pyrofork import raw
+from pyrofork.errors import UnknownError
class GetInlineBotResults:
async def get_inline_bot_results(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
bot: Union[int, str],
query: str = "",
offset: str = "",
@@ -33,7 +34,7 @@ class GetInlineBotResults:
longitude: float = None
):
"""Get bot results via inline queries.
- You can then send a result using :meth:`~pyrogram.Client.send_inline_bot_result`
+ You can then send a result using :meth:`~pyrofork.Client.send_inline_bot_result`
.. include:: /_includes/usable-by/users.rst
@@ -59,7 +60,7 @@ class GetInlineBotResults:
Useful for location-based results only.
Returns:
- :obj:`BotResults `: On Success.
+ :obj:`BotResults `: On Success.
Raises:
TimeoutError: In case the bot fails to answer within 10 seconds.
@@ -67,7 +68,7 @@ class GetInlineBotResults:
Example:
.. code-block:: python
- results = await app.get_inline_bot_results("pyrogrambot")
+ results = await app.get_inline_bot_results("pyroforkbot")
print(results)
"""
# TODO: Don't return the raw type
diff --git a/pyrogram/methods/bots/request_callback_answer.py b/pyrofork/methods/bots/request_callback_answer.py
similarity index 85%
rename from pyrogram/methods/bots/request_callback_answer.py
rename to pyrofork/methods/bots/request_callback_answer.py
index f18f25af..ffdda2a5 100644
--- a/pyrogram/methods/bots/request_callback_answer.py
+++ b/pyrofork/methods/bots/request_callback_answer.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class RequestCallbackAnswer:
async def request_callback_answer(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
message_id: int,
callback_data: Union[str, bytes],
diff --git a/pyrogram/methods/bots/send_game.py b/pyrofork/methods/bots/send_game.py
similarity index 94%
rename from pyrogram/methods/bots/send_game.py
rename to pyrofork/methods/bots/send_game.py
index 98e28ed1..fd783db8 100644
--- a/pyrogram/methods/bots/send_game.py
+++ b/pyrofork/methods/bots/send_game.py
@@ -19,14 +19,14 @@
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types, utils
+import pyrofork
+from pyrofork import raw
+from pyrofork import types, utils
class SendGame:
async def send_game(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
game_short_name: str,
disable_notification: bool = None,
@@ -68,12 +68,12 @@ class SendGame:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
- reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*):
+ reply_markup (:obj:`~pyrofork.types.InlineKeyboardMarkup`, *optional*):
An object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown automatically.
If not empty, the first button must launch the game.
Returns:
- :obj:`~pyrogram.types.Message`: On success, the sent game message is returned.
+ :obj:`~pyrofork.types.Message`: On success, the sent game message is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/bots/send_inline_bot_result.py b/pyrofork/methods/bots/send_inline_bot_result.py
similarity index 91%
rename from pyrogram/methods/bots/send_inline_bot_result.py
rename to pyrofork/methods/bots/send_inline_bot_result.py
index 3a11a789..2d17f5dc 100644
--- a/pyrogram/methods/bots/send_inline_bot_result.py
+++ b/pyrofork/methods/bots/send_inline_bot_result.py
@@ -19,13 +19,13 @@
from typing import List, Union, Optional
-import pyrogram
-from pyrogram import enums, raw, types, utils
+import pyrofork
+from pyrofork import enums, raw, types, utils
class SendInlineBotResult:
async def send_inline_bot_result(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
query_id: int,
result_id: str,
@@ -37,7 +37,7 @@ class SendInlineBotResult:
parse_mode: Optional["enums.ParseMode"] = None
) -> "raw.base.Updates":
"""Send an inline bot result.
- Bot results can be retrieved using :meth:`~pyrogram.Client.get_inline_bot_results`
+ Bot results can be retrieved using :meth:`~pyrofork.Client.get_inline_bot_results`
.. include:: /_includes/usable-by/users.rst
@@ -69,17 +69,17 @@ class SendInlineBotResult:
Text to quote.
for reply_to_message only.
- quote_entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*):
+ quote_entities (List of :obj:`~pyrofork.types.MessageEntity`, *optional*):
List of special entities that appear in quote_text, which can be specified instead of *parse_mode*.
for reply_to_message only.
- parse_mode (:obj:`~pyrogram.enums.ParseMode`, *optional*):
+ parse_mode (:obj:`~pyrofork.enums.ParseMode`, *optional*):
By default, quote_text are parsed using both Markdown and HTML styles.
You can combine both syntaxes together.
For quote_text.
Returns:
- :obj:`~pyrogram.raw.base.Updates`: Currently, on success, a raw result is returned.
+ :obj:`~pyrofork.raw.base.Updates`: Currently, on success, a raw result is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/bots/set_bot_commands.py b/pyrofork/methods/bots/set_bot_commands.py
similarity index 74%
rename from pyrogram/methods/bots/set_bot_commands.py
rename to pyrofork/methods/bots/set_bot_commands.py
index f6f7e6c9..151d4682 100644
--- a/pyrogram/methods/bots/set_bot_commands.py
+++ b/pyrofork/methods/bots/set_bot_commands.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import List
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class SetBotCommands:
async def set_bot_commands(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
commands: List["types.BotCommand"],
scope: "types.BotCommandScope" = types.BotCommandScopeDefault(),
language_code: str = "",
@@ -37,13 +38,13 @@ class SetBotCommands:
.. include:: /_includes/usable-by/bots.rst
Parameters:
- commands (List of :obj:`~pyrogram.types.BotCommand`):
+ commands (List of :obj:`~pyrofork.types.BotCommand`):
A list of bot commands.
At most 100 commands can be specified.
- scope (:obj:`~pyrogram.types.BotCommandScope`, *optional*):
+ scope (:obj:`~pyrofork.types.BotCommandScope`, *optional*):
An object describing the scope of users for which the commands are relevant.
- Defaults to :obj:`~pyrogram.types.BotCommandScopeDefault`.
+ Defaults to :obj:`~pyrofork.types.BotCommandScopeDefault`.
language_code (``str``, *optional*):
A two-letter ISO 639-1 language code.
@@ -56,7 +57,7 @@ class SetBotCommands:
Example:
.. code-block:: python
- from pyrogram.types import BotCommand
+ from pyrofork.types import BotCommand
# Set new commands
await app.set_bot_commands([
diff --git a/pyrogram/methods/bots/set_bot_default_privileges.py b/pyrofork/methods/bots/set_bot_default_privileges.py
similarity index 82%
rename from pyrogram/methods/bots/set_bot_default_privileges.py
rename to pyrofork/methods/bots/set_bot_default_privileges.py
index 2890ee1a..58abd9c6 100644
--- a/pyrogram/methods/bots/set_bot_default_privileges.py
+++ b/pyrofork/methods/bots/set_bot_default_privileges.py
@@ -1,29 +1,30 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class SetBotDefaultPrivileges:
async def set_bot_default_privileges(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
privileges: "types.ChatPrivileges" = None,
for_channels: bool = None
) -> bool:
@@ -34,7 +35,7 @@ class SetBotDefaultPrivileges:
.. include:: /_includes/usable-by/bots.rst
Parameters:
- privileges (:obj:`~pyrogram.types.ChatPrivileges`):
+ privileges (:obj:`~pyrofork.types.ChatPrivileges`):
New default privileges. None to clear.
Defaults to None.
@@ -48,7 +49,7 @@ class SetBotDefaultPrivileges:
Example:
.. code-block:: python
- from pyrogram.types import ChatPrivileges
+ from pyrofork.types import ChatPrivileges
await app.set_bot_default_privileges(
ChatPrivileges(
diff --git a/pyrogram/methods/bots/set_bot_info.py b/pyrofork/methods/bots/set_bot_info.py
similarity index 96%
rename from pyrogram/methods/bots/set_bot_info.py
rename to pyrofork/methods/bots/set_bot_info.py
index 7559a6b4..6e60cb04 100644
--- a/pyrogram/methods/bots/set_bot_info.py
+++ b/pyrofork/methods/bots/set_bot_info.py
@@ -18,13 +18,13 @@
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class SetBotInfo:
async def set_bot_info(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
lang_code: str,
bot: Union[int, str] = None,
name: str = None,
diff --git a/pyrogram/methods/bots/set_chat_menu_button.py b/pyrofork/methods/bots/set_chat_menu_button.py
similarity index 72%
rename from pyrogram/methods/bots/set_chat_menu_button.py
rename to pyrofork/methods/bots/set_chat_menu_button.py
index fa5af85c..47ed61f5 100644
--- a/pyrogram/methods/bots/set_chat_menu_button.py
+++ b/pyrofork/methods/bots/set_chat_menu_button.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class SetChatMenuButton:
async def set_chat_menu_button(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str] = None,
menu_button: "types.MenuButton" = None
) -> bool:
@@ -38,9 +39,9 @@ class SetChatMenuButton:
Unique identifier (int) or username (str) of the target chat.
If not specified, default bot's menu button will be changed.
- menu_button (:obj:`~pyrogram.types.MenuButton`, *optional*):
+ menu_button (:obj:`~pyrofork.types.MenuButton`, *optional*):
The new bot's menu button.
- Defaults to :obj:`~pyrogram.types.MenuButtonDefault`.
+ Defaults to :obj:`~pyrofork.types.MenuButtonDefault`.
"""
await self.invoke(
diff --git a/pyrogram/methods/bots/set_game_score.py b/pyrofork/methods/bots/set_game_score.py
similarity index 87%
rename from pyrogram/methods/bots/set_game_score.py
rename to pyrofork/methods/bots/set_game_score.py
index 9703b3d1..51d9560b 100644
--- a/pyrogram/methods/bots/set_game_score.py
+++ b/pyrofork/methods/bots/set_game_score.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class SetGameScore:
async def set_game_score(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
user_id: Union[int, str],
score: int,
force: bool = None,
@@ -66,7 +67,7 @@ class SetGameScore:
Required if inline_message_id is not specified.
Returns:
- :obj:`~pyrogram.types.Message` | ``bool``: On success, if the message was sent by the bot, the edited
+ :obj:`~pyrofork.types.Message` | ``bool``: On success, if the message was sent by the bot, the edited
message is returned, True otherwise.
Example:
diff --git a/pyrogram/methods/chats/__init__.py b/pyrofork/methods/chats/__init__.py
similarity index 100%
rename from pyrogram/methods/chats/__init__.py
rename to pyrofork/methods/chats/__init__.py
diff --git a/pyrogram/methods/chats/add_chat_members.py b/pyrofork/methods/chats/add_chat_members.py
similarity index 87%
rename from pyrogram/methods/chats/add_chat_members.py
rename to pyrofork/methods/chats/add_chat_members.py
index af9af1df..ba26a4b5 100644
--- a/pyrogram/methods/chats/add_chat_members.py
+++ b/pyrofork/methods/chats/add_chat_members.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union, List
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class AddChatMembers:
async def add_chat_members(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
user_ids: Union[Union[int, str], List[Union[int, str]]],
forward_limit: int = 100
diff --git a/pyrogram/methods/chats/archive_chats.py b/pyrofork/methods/chats/archive_chats.py
similarity index 81%
rename from pyrogram/methods/chats/archive_chats.py
rename to pyrofork/methods/chats/archive_chats.py
index 010a65ac..84dc1f4a 100644
--- a/pyrogram/methods/chats/archive_chats.py
+++ b/pyrofork/methods/chats/archive_chats.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union, List
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class ArchiveChats:
async def archive_chats(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_ids: Union[int, str, List[Union[int, str]]],
) -> bool:
"""Archive one or more chats.
diff --git a/pyrogram/methods/chats/ban_chat_member.py b/pyrofork/methods/chats/ban_chat_member.py
similarity index 89%
rename from pyrogram/methods/chats/ban_chat_member.py
rename to pyrofork/methods/chats/ban_chat_member.py
index afb0d1a2..12a79ec1 100644
--- a/pyrogram/methods/chats/ban_chat_member.py
+++ b/pyrofork/methods/chats/ban_chat_member.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from datetime import datetime
from typing import Union
-import pyrogram
-from pyrogram import raw, utils
-from pyrogram import types
+import pyrofork
+from pyrofork import raw, utils
+from pyrofork import types
class BanChatMember:
async def ban_chat_member(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
user_id: Union[int, str],
until_date: datetime = utils.zero_datetime()
@@ -59,7 +60,7 @@ class BanChatMember:
considered to be banned forever. Defaults to epoch (ban forever).
Returns:
- :obj:`~pyrogram.types.Message` | ``bool``: On success, a service message will be returned (when applicable),
+ :obj:`~pyrofork.types.Message` | ``bool``: On success, a service message will be returned (when applicable),
otherwise, in case a message object couldn't be returned, True is returned.
Example:
diff --git a/pyrogram/methods/chats/close_forum_topic.py b/pyrofork/methods/chats/close_forum_topic.py
similarity index 94%
rename from pyrogram/methods/chats/close_forum_topic.py
rename to pyrofork/methods/chats/close_forum_topic.py
index fb4c537f..78fcee27 100644
--- a/pyrogram/methods/chats/close_forum_topic.py
+++ b/pyrofork/methods/chats/close_forum_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class CloseForumTopic:
async def close_forum_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
topic_id: int
) -> bool:
diff --git a/pyrogram/methods/chats/close_general_topic.py b/pyrofork/methods/chats/close_general_topic.py
similarity index 94%
rename from pyrogram/methods/chats/close_general_topic.py
rename to pyrofork/methods/chats/close_general_topic.py
index 2f915669..f1a3f879 100644
--- a/pyrogram/methods/chats/close_general_topic.py
+++ b/pyrofork/methods/chats/close_general_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class CloseGeneralTopic:
async def close_general_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> bool:
"""Close a forum topic.
diff --git a/pyrogram/methods/chats/create_channel.py b/pyrofork/methods/chats/create_channel.py
similarity index 72%
rename from pyrogram/methods/chats/create_channel.py
rename to pyrofork/methods/chats/create_channel.py
index 292fa97d..bed425c2 100644
--- a/pyrogram/methods/chats/create_channel.py
+++ b/pyrofork/methods/chats/create_channel.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+# along with Pyrofork. If not, see .
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class CreateChannel:
async def create_channel(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
title: str,
description: str = ""
) -> "types.Chat":
@@ -38,7 +39,7 @@ class CreateChannel:
The channel description.
Returns:
- :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.
+ :obj:`~pyrofork.types.Chat`: On success, a chat object is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/create_forum_topic.py b/pyrofork/methods/chats/create_forum_topic.py
similarity index 93%
rename from pyrogram/methods/chats/create_forum_topic.py
rename to pyrofork/methods/chats/create_forum_topic.py
index d6d23f30..247bae4d 100644
--- a/pyrogram/methods/chats/create_forum_topic.py
+++ b/pyrofork/methods/chats/create_forum_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class CreateForumTopic:
async def create_forum_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
title: str,
icon_color: int = None,
@@ -48,7 +48,7 @@ class CreateForumTopic:
Unique identifier of the custom emoji shown as the topic icon
Returns:
- :obj:`~pyrogram.types.ForumTopicCreated`: On success, a forum_topic_created object is returned.
+ :obj:`~pyrofork.types.ForumTopicCreated`: On success, a forum_topic_created object is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/create_group.py b/pyrofork/methods/chats/create_group.py
similarity index 75%
rename from pyrogram/methods/chats/create_group.py
rename to pyrofork/methods/chats/create_group.py
index 027315de..8f2679b0 100644
--- a/pyrogram/methods/chats/create_group.py
+++ b/pyrofork/methods/chats/create_group.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union, List
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class CreateGroup:
async def create_group(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
title: str,
users: Union[Union[int, str], List[Union[int, str]]]
) -> "types.Chat":
@@ -33,7 +34,7 @@ class CreateGroup:
.. note::
- If you want to create a new supergroup, use :meth:`~pyrogram.Client.create_supergroup` instead.
+ If you want to create a new supergroup, use :meth:`~pyrofork.Client.create_supergroup` instead.
.. include:: /_includes/usable-by/users.rst
@@ -47,7 +48,7 @@ class CreateGroup:
Multiple users can be invited by passing a list of IDs, usernames or phone numbers.
Returns:
- :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.
+ :obj:`~pyrofork.types.Chat`: On success, a chat object is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/create_supergroup.py b/pyrofork/methods/chats/create_supergroup.py
similarity index 72%
rename from pyrogram/methods/chats/create_supergroup.py
rename to pyrofork/methods/chats/create_supergroup.py
index d1cbbbd8..f2230736 100644
--- a/pyrogram/methods/chats/create_supergroup.py
+++ b/pyrofork/methods/chats/create_supergroup.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+# along with Pyrofork. If not, see .
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class CreateSupergroup:
async def create_supergroup(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
title: str,
description: str = ""
) -> "types.Chat":
@@ -30,7 +31,7 @@ class CreateSupergroup:
.. note::
- If you want to create a new basic group, use :meth:`~pyrogram.Client.create_group` instead.
+ If you want to create a new basic group, use :meth:`~pyrofork.Client.create_group` instead.
.. include:: /_includes/usable-by/users.rst
@@ -42,7 +43,7 @@ class CreateSupergroup:
The supergroup description.
Returns:
- :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.
+ :obj:`~pyrofork.types.Chat`: On success, a chat object is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/delete_channel.py b/pyrofork/methods/chats/delete_channel.py
similarity index 75%
rename from pyrogram/methods/chats/delete_channel.py
rename to pyrofork/methods/chats/delete_channel.py
index c1e4b953..9668f2b2 100644
--- a/pyrogram/methods/chats/delete_channel.py
+++ b/pyrofork/methods/chats/delete_channel.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class DeleteChannel:
async def delete_channel(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> bool:
"""Delete a channel.
diff --git a/pyrogram/methods/chats/delete_chat_photo.py b/pyrofork/methods/chats/delete_chat_photo.py
similarity index 82%
rename from pyrogram/methods/chats/delete_chat_photo.py
rename to pyrofork/methods/chats/delete_chat_photo.py
index a8ce7e63..fb476fe3 100644
--- a/pyrogram/methods/chats/delete_chat_photo.py
+++ b/pyrofork/methods/chats/delete_chat_photo.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class DeleteChatPhoto:
async def delete_chat_photo(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> bool:
"""Delete a chat photo.
diff --git a/pyrogram/methods/chats/delete_forum_topic.py b/pyrofork/methods/chats/delete_forum_topic.py
similarity index 95%
rename from pyrogram/methods/chats/delete_forum_topic.py
rename to pyrofork/methods/chats/delete_forum_topic.py
index 0fcc8da5..8b5d897e 100644
--- a/pyrogram/methods/chats/delete_forum_topic.py
+++ b/pyrofork/methods/chats/delete_forum_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class DeleteForumTopic:
async def delete_forum_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
topic_id: int
) -> bool:
diff --git a/pyrogram/methods/chats/delete_supergroup.py b/pyrofork/methods/chats/delete_supergroup.py
similarity index 75%
rename from pyrogram/methods/chats/delete_supergroup.py
rename to pyrofork/methods/chats/delete_supergroup.py
index 1c246613..085bbfd9 100644
--- a/pyrogram/methods/chats/delete_supergroup.py
+++ b/pyrofork/methods/chats/delete_supergroup.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class DeleteSupergroup:
async def delete_supergroup(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> bool:
"""Delete a supergroup.
diff --git a/pyrogram/methods/chats/delete_user_history.py b/pyrofork/methods/chats/delete_user_history.py
similarity index 80%
rename from pyrogram/methods/chats/delete_user_history.py
rename to pyrofork/methods/chats/delete_user_history.py
index 0f5c0bc8..e3c0d61a 100644
--- a/pyrogram/methods/chats/delete_user_history.py
+++ b/pyrofork/methods/chats/delete_user_history.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class DeleteUserHistory:
async def delete_user_history(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
user_id: Union[int, str],
) -> bool:
diff --git a/pyrogram/methods/chats/edit_forum_topic.py b/pyrofork/methods/chats/edit_forum_topic.py
similarity index 95%
rename from pyrogram/methods/chats/edit_forum_topic.py
rename to pyrofork/methods/chats/edit_forum_topic.py
index ceb0aa6d..8f0c5692 100644
--- a/pyrogram/methods/chats/edit_forum_topic.py
+++ b/pyrofork/methods/chats/edit_forum_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class EditForumTopic:
async def edit_forum_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
topic_id: int,
title: str = None,
diff --git a/pyrogram/methods/chats/edit_general_topic.py b/pyrofork/methods/chats/edit_general_topic.py
similarity index 94%
rename from pyrogram/methods/chats/edit_general_topic.py
rename to pyrofork/methods/chats/edit_general_topic.py
index 13459843..c66be360 100644
--- a/pyrogram/methods/chats/edit_general_topic.py
+++ b/pyrofork/methods/chats/edit_general_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class EditGeneralTopic:
async def edit_general_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
title: str
) -> bool:
diff --git a/pyrogram/methods/chats/get_chat.py b/pyrofork/methods/chats/get_chat.py
similarity index 82%
rename from pyrogram/methods/chats/get_chat.py
rename to pyrofork/methods/chats/get_chat.py
index 0dd0e531..b5efb29a 100644
--- a/pyrogram/methods/chats/get_chat.py
+++ b/pyrofork/methods/chats/get_chat.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
-from pyrogram import utils
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
+from pyrofork import utils
class GetChat:
async def get_chat(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> Union["types.Chat", "types.ChatPreview"]:
"""Get up to date information about a chat.
@@ -44,7 +45,7 @@ class GetChat:
You can also use chat public link in form of *t.me/* (str).
Returns:
- :obj:`~pyrogram.types.Chat` | :obj:`~pyrogram.types.ChatPreview`: On success, if you've already joined the chat, a chat object is returned,
+ :obj:`~pyrofork.types.Chat` | :obj:`~pyrofork.types.ChatPreview`: On success, if you've already joined the chat, a chat object is returned,
otherwise, a chat preview object is returned.
Raises:
@@ -53,7 +54,7 @@ class GetChat:
Example:
.. code-block:: python
- chat = await app.get_chat("pyrogram")
+ chat = await app.get_chat("pyrofork")
print(chat)
"""
match = self.INVITE_LINK_RE.match(str(chat_id))
diff --git a/pyrogram/methods/chats/get_chat_event_log.py b/pyrofork/methods/chats/get_chat_event_log.py
similarity index 86%
rename from pyrogram/methods/chats/get_chat_event_log.py
rename to pyrofork/methods/chats/get_chat_event_log.py
index 6ac0893a..0d872bb4 100644
--- a/pyrogram/methods/chats/get_chat_event_log.py
+++ b/pyrofork/methods/chats/get_chat_event_log.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union, List, AsyncGenerator, Optional
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class GetChatEventLog:
async def get_chat_event_log(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
query: str = "",
offset_id: int = 0,
@@ -57,7 +58,7 @@ class GetChatEventLog:
Maximum amount of events to be returned.
By default, all events will be returned.
- filters (:obj:`~pyrogram.types.ChatEventFilter`, *optional*):
+ filters (:obj:`~pyrofork.types.ChatEventFilter`, *optional*):
The types of events to return.
By default, all types will be returned.
@@ -66,7 +67,7 @@ class GetChatEventLog:
By default, events relating to all users will be returned.
Yields:
- :obj:`~pyrogram.types.ChatEvent` objects.
+ :obj:`~pyrofork.types.ChatEvent` objects.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/get_chat_member.py b/pyrofork/methods/chats/get_chat_member.py
similarity index 84%
rename from pyrogram/methods/chats/get_chat_member.py
rename to pyrofork/methods/chats/get_chat_member.py
index 015c1785..ffbca306 100644
--- a/pyrogram/methods/chats/get_chat_member.py
+++ b/pyrofork/methods/chats/get_chat_member.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
-from pyrogram.errors import UserNotParticipant
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
+from pyrofork.errors import UserNotParticipant
class GetChatMember:
async def get_chat_member(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
user_id: Union[int, str]
) -> "types.ChatMember":
@@ -46,7 +47,7 @@ class GetChatMember:
You can also use user profile link in form of *t.me/* (str).
Returns:
- :obj:`~pyrogram.types.ChatMember`: On success, a chat member is returned.
+ :obj:`~pyrofork.types.ChatMember`: On success, a chat member is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/get_chat_members.py b/pyrofork/methods/chats/get_chat_members.py
similarity index 85%
rename from pyrogram/methods/chats/get_chat_members.py
rename to pyrofork/methods/chats/get_chat_members.py
index 3700a1a0..8a5ebf77 100644
--- a/pyrogram/methods/chats/get_chat_members.py
+++ b/pyrofork/methods/chats/get_chat_members.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
import logging
from typing import Union, Optional, AsyncGenerator
-import pyrogram
-from pyrogram import raw, types, enums
+import pyrofork
+from pyrofork import raw, types, enums
log = logging.getLogger(__name__)
async def get_chunk(
- client: "pyrogram.Client",
+ client: "pyrofork.Client",
chat_id: Union[int, str],
offset: int,
filter: "enums.ChatMembersFilter",
@@ -59,7 +60,7 @@ async def get_chunk(
class GetChatMembers:
async def get_chat_members(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
query: str = "",
limit: int = 0,
@@ -80,24 +81,24 @@ class GetChatMembers:
query (``str``, *optional*):
Query string to filter members based on their display names and usernames.
Only applicable to supergroups and channels. Defaults to "" (empty string).
- A query string is applicable only for :obj:`~pyrogram.enums.ChatMembersFilter.SEARCH`,
- :obj:`~pyrogram.enums.ChatMembersFilter.BANNED` and :obj:`~pyrogram.enums.ChatMembersFilter.RESTRICTED`
+ A query string is applicable only for :obj:`~pyrofork.enums.ChatMembersFilter.SEARCH`,
+ :obj:`~pyrofork.enums.ChatMembersFilter.BANNED` and :obj:`~pyrofork.enums.ChatMembersFilter.RESTRICTED`
filters only.
limit (``int``, *optional*):
Limits the number of members to be retrieved.
- filter (:obj:`~pyrogram.enums.ChatMembersFilter`, *optional*):
+ filter (:obj:`~pyrofork.enums.ChatMembersFilter`, *optional*):
Filter used to select the kind of members you want to retrieve. Only applicable for supergroups
and channels.
Returns:
- ``Generator``: On success, a generator yielding :obj:`~pyrogram.types.ChatMember` objects is returned.
+ ``Generator``: On success, a generator yielding :obj:`~pyrofork.types.ChatMember` objects is returned.
Example:
.. code-block:: python
- from pyrogram import enums
+ from pyrofork import enums
# Get members
async for member in app.get_chat_members(chat_id):
diff --git a/pyrogram/methods/chats/get_chat_members_count.py b/pyrofork/methods/chats/get_chat_members_count.py
similarity index 82%
rename from pyrogram/methods/chats/get_chat_members_count.py
rename to pyrofork/methods/chats/get_chat_members_count.py
index 71a8c0ef..e4ccac11 100644
--- a/pyrogram/methods/chats/get_chat_members_count.py
+++ b/pyrofork/methods/chats/get_chat_members_count.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class GetChatMembersCount:
async def get_chat_members_count(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> int:
"""Get the number of members in a chat.
diff --git a/pyrogram/methods/chats/get_chat_online_count.py b/pyrofork/methods/chats/get_chat_online_count.py
similarity index 76%
rename from pyrogram/methods/chats/get_chat_online_count.py
rename to pyrofork/methods/chats/get_chat_online_count.py
index fe6ab59a..335e317d 100644
--- a/pyrogram/methods/chats/get_chat_online_count.py
+++ b/pyrofork/methods/chats/get_chat_online_count.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class GetChatOnlineCount:
async def get_chat_online_count(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> int:
"""Get the number of members that are currently online in a chat.
diff --git a/pyrogram/methods/chats/get_dialogs.py b/pyrofork/methods/chats/get_dialogs.py
similarity index 84%
rename from pyrogram/methods/chats/get_dialogs.py
rename to pyrofork/methods/chats/get_dialogs.py
index ccca6381..d357087a 100644
--- a/pyrogram/methods/chats/get_dialogs.py
+++ b/pyrofork/methods/chats/get_dialogs.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import AsyncGenerator, Optional
-import pyrogram
-from pyrogram import types, raw, utils
-from pyrogram.errors import ChannelPrivate
+import pyrofork
+from pyrofork import types, raw, utils
+from pyrofork.errors import ChannelPrivate
class GetDialogs:
async def get_dialogs(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
limit: int = 0
) -> Optional[AsyncGenerator["types.Dialog", None]]:
"""Get a user's dialogs sequentially.
@@ -38,7 +39,7 @@ class GetDialogs:
By default, no limit is applied and all dialogs are returned.
Returns:
- ``Generator``: A generator yielding :obj:`~pyrogram.types.Dialog` objects.
+ ``Generator``: A generator yielding :obj:`~pyrofork.types.Dialog` objects.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/get_dialogs_count.py b/pyrofork/methods/chats/get_dialogs_count.py
similarity index 79%
rename from pyrogram/methods/chats/get_dialogs_count.py
rename to pyrofork/methods/chats/get_dialogs_count.py
index ae22eb5c..4cf991ab 100644
--- a/pyrogram/methods/chats/get_dialogs_count.py
+++ b/pyrofork/methods/chats/get_dialogs_count.py
@@ -1,28 +1,29 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class GetDialogsCount:
async def get_dialogs_count(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
pinned_only: bool = False
) -> int:
"""Get the total count of your dialogs.
diff --git a/pyrogram/methods/chats/get_forum_topics.py b/pyrofork/methods/chats/get_forum_topics.py
similarity index 92%
rename from pyrogram/methods/chats/get_forum_topics.py
rename to pyrofork/methods/chats/get_forum_topics.py
index 1620bc4b..c57f192d 100644
--- a/pyrogram/methods/chats/get_forum_topics.py
+++ b/pyrofork/methods/chats/get_forum_topics.py
@@ -20,17 +20,17 @@
import logging
from typing import Union, Optional, AsyncGenerator
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
-from pyrogram import utils
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
+from pyrofork import utils
log = logging.getLogger(__name__)
class GetForumTopics:
async def get_forum_topics(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
limit: int = 0
) -> Optional[AsyncGenerator["types.ForumTopic", None]]:
@@ -47,7 +47,7 @@ class GetForumTopics:
Limits the number of topics to be retrieved.
Returns:
- ``Generator``: On success, a generator yielding :obj:`~pyrogram.types.ForumTopic` objects is returned.
+ ``Generator``: On success, a generator yielding :obj:`~pyrofork.types.ForumTopic` objects is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/get_forum_topics_by_id.py b/pyrofork/methods/chats/get_forum_topics_by_id.py
similarity index 92%
rename from pyrogram/methods/chats/get_forum_topics_by_id.py
rename to pyrofork/methods/chats/get_forum_topics_by_id.py
index ea2114aa..b4fab58c 100644
--- a/pyrogram/methods/chats/get_forum_topics_by_id.py
+++ b/pyrofork/methods/chats/get_forum_topics_by_id.py
@@ -20,17 +20,17 @@
import logging
from typing import Union, List, Iterable
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
-from pyrogram import utils
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
+from pyrofork import utils
log = logging.getLogger(__name__)
class GetForumTopicsByID:
async def get_forum_topics_by_id(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
topic_ids: Union[int, Iterable[int]]
) -> Union["types.ForumTopic", List["types.ForumTopic"]]:
@@ -48,7 +48,7 @@ class GetForumTopicsByID:
topic themselves.
Returns:
- :obj:`~pyrogram.types.ForumTopic` | List of :obj:`~pyrogram.types.ForumTopic`: In case *topic_ids* was not
+ :obj:`~pyrofork.types.ForumTopic` | List of :obj:`~pyrofork.types.ForumTopic`: In case *topic_ids* was not
a list, a single topic is returned, otherwise a list of topics is returned.
Example:
diff --git a/pyrogram/methods/chats/get_nearby_chats.py b/pyrofork/methods/chats/get_nearby_chats.py
similarity index 77%
rename from pyrogram/methods/chats/get_nearby_chats.py
rename to pyrofork/methods/chats/get_nearby_chats.py
index 8d1163ac..fba08c8f 100644
--- a/pyrogram/methods/chats/get_nearby_chats.py
+++ b/pyrofork/methods/chats/get_nearby_chats.py
@@ -1,32 +1,33 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import List
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
-from pyrogram import utils
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
+from pyrofork import utils
class GetNearbyChats:
async def get_nearby_chats(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
latitude: float,
longitude: float
) -> List["types.Chat"]:
@@ -42,7 +43,7 @@ class GetNearbyChats:
Longitude of the location.
Returns:
- List of :obj:`~pyrogram.types.Chat`: On success, a list of nearby chats is returned.
+ List of :obj:`~pyrofork.types.Chat`: On success, a list of nearby chats is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/get_send_as_chats.py b/pyrofork/methods/chats/get_send_as_chats.py
similarity index 77%
rename from pyrogram/methods/chats/get_send_as_chats.py
rename to pyrofork/methods/chats/get_send_as_chats.py
index b530fe48..f7fe2b93 100644
--- a/pyrogram/methods/chats/get_send_as_chats.py
+++ b/pyrofork/methods/chats/get_send_as_chats.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import List, Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class GetSendAsChats:
async def get_send_as_chats(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> List["types.Chat"]:
"""Get the list of "send_as" chats available.
@@ -38,7 +39,7 @@ class GetSendAsChats:
You can also use chat public link in form of *t.me/* (str).
Returns:
- List[:obj:`~pyrogram.types.Chat`]: The list of chats.
+ List[:obj:`~pyrofork.types.Chat`]: The list of chats.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/hide_general_topic.py b/pyrofork/methods/chats/hide_general_topic.py
similarity index 94%
rename from pyrogram/methods/chats/hide_general_topic.py
rename to pyrofork/methods/chats/hide_general_topic.py
index 901758ca..14601bf3 100644
--- a/pyrogram/methods/chats/hide_general_topic.py
+++ b/pyrofork/methods/chats/hide_general_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class HideGeneralTopic:
async def hide_general_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> bool:
"""hide a general forum topic.
diff --git a/pyrogram/methods/chats/join_chat.py b/pyrofork/methods/chats/join_chat.py
similarity index 77%
rename from pyrogram/methods/chats/join_chat.py
rename to pyrofork/methods/chats/join_chat.py
index def52db4..a5038925 100644
--- a/pyrogram/methods/chats/join_chat.py
+++ b/pyrofork/methods/chats/join_chat.py
@@ -1,31 +1,32 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
class JoinChat:
async def join_chat(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> "types.Chat":
"""Join a group chat or channel.
@@ -38,7 +39,7 @@ class JoinChat:
a username of the target channel/supergroup (in the format @username) or a chat id of a linked chat (channel or supergroup).
Returns:
- :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.
+ :obj:`~pyrofork.types.Chat`: On success, a chat object is returned.
Example:
.. code-block:: python
@@ -47,10 +48,10 @@ class JoinChat:
await app.join_chat("https://t.me/+AbCdEf0123456789")
# Join chat via username
- await app.join_chat("pyrogram")
+ await app.join_chat("pyrofork")
# Join a linked chat
- await app.join_chat(app.get_chat("pyrogram").linked_chat.id)
+ await app.join_chat(app.get_chat("pyrofork").linked_chat.id)
"""
match = self.INVITE_LINK_RE.match(str(chat_id))
diff --git a/pyrogram/methods/chats/leave_chat.py b/pyrofork/methods/chats/leave_chat.py
similarity index 84%
rename from pyrogram/methods/chats/leave_chat.py
rename to pyrofork/methods/chats/leave_chat.py
index 0e307897..cdd06e31 100644
--- a/pyrogram/methods/chats/leave_chat.py
+++ b/pyrofork/methods/chats/leave_chat.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class LeaveChat:
async def leave_chat(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
delete: bool = False
):
diff --git a/pyrogram/methods/chats/mark_chat_unread.py b/pyrofork/methods/chats/mark_chat_unread.py
similarity index 74%
rename from pyrogram/methods/chats/mark_chat_unread.py
rename to pyrofork/methods/chats/mark_chat_unread.py
index b5426597..f78606d2 100644
--- a/pyrogram/methods/chats/mark_chat_unread.py
+++ b/pyrofork/methods/chats/mark_chat_unread.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class MarkChatUnread:
async def mark_chat_unread(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
) -> bool:
"""Mark a chat as unread.
diff --git a/pyrogram/methods/chats/pin_chat_message.py b/pyrofork/methods/chats/pin_chat_message.py
similarity index 84%
rename from pyrogram/methods/chats/pin_chat_message.py
rename to pyrofork/methods/chats/pin_chat_message.py
index 73b373ff..df8fbd0b 100644
--- a/pyrogram/methods/chats/pin_chat_message.py
+++ b/pyrofork/methods/chats/pin_chat_message.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw, types
+import pyrofork
+from pyrofork import raw, types
class PinChatMessage:
async def pin_chat_message(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
message_id: int,
disable_notification: bool = False,
@@ -53,7 +54,7 @@ class PinChatMessage:
Applicable to private chats only. Defaults to False.
Returns:
- :obj:`~pyrogram.types.Message`: On success, the service message is returned.
+ :obj:`~pyrofork.types.Message`: On success, the service message is returned.
Example:
.. code-block:: python
diff --git a/pyrogram/methods/chats/promote_chat_member.py b/pyrofork/methods/chats/promote_chat_member.py
similarity index 96%
rename from pyrogram/methods/chats/promote_chat_member.py
rename to pyrofork/methods/chats/promote_chat_member.py
index 9fe37180..ce0a1ba6 100644
--- a/pyrogram/methods/chats/promote_chat_member.py
+++ b/pyrofork/methods/chats/promote_chat_member.py
@@ -19,13 +19,13 @@
from typing import Union
-import pyrogram
-from pyrogram import raw, types, errors
+import pyrofork
+from pyrofork import raw, types, errors
class PromoteChatMember:
async def promote_chat_member(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
user_id: Union[int, str],
privileges: "types.ChatPrivileges" = None,
@@ -47,7 +47,7 @@ class PromoteChatMember:
For a contact that exists in your Telegram address book you can use his phone number (str).
You can also use user profile link in form of *t.me/* (str).
- privileges (:obj:`~pyrogram.types.ChatPrivileges`, *optional*):
+ privileges (:obj:`~pyrofork.types.ChatPrivileges`, *optional*):
New user privileges.
Returns:
diff --git a/pyrogram/methods/chats/reopen_forum_topic.py b/pyrofork/methods/chats/reopen_forum_topic.py
similarity index 94%
rename from pyrogram/methods/chats/reopen_forum_topic.py
rename to pyrofork/methods/chats/reopen_forum_topic.py
index 1b5e6a63..4001e951 100644
--- a/pyrogram/methods/chats/reopen_forum_topic.py
+++ b/pyrofork/methods/chats/reopen_forum_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class ReopenForumTopic:
async def reopen_forum_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
topic_id: int
) -> bool:
diff --git a/pyrogram/methods/chats/reopen_general_topic.py b/pyrofork/methods/chats/reopen_general_topic.py
similarity index 94%
rename from pyrogram/methods/chats/reopen_general_topic.py
rename to pyrofork/methods/chats/reopen_general_topic.py
index a1ba65da..e4fef253 100644
--- a/pyrogram/methods/chats/reopen_general_topic.py
+++ b/pyrofork/methods/chats/reopen_general_topic.py
@@ -15,15 +15,15 @@
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrofork. If not, see .
-import pyrogram
-from pyrogram import raw
-from pyrogram import types
+import pyrofork
+from pyrofork import raw
+from pyrofork import types
from typing import Union
class ReopenGeneralTopic:
async def reopen_general_topic(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str]
) -> bool:
"""Reopen a general forum topic.
diff --git a/pyrogram/methods/chats/restrict_chat_member.py b/pyrofork/methods/chats/restrict_chat_member.py
similarity index 96%
rename from pyrogram/methods/chats/restrict_chat_member.py
rename to pyrofork/methods/chats/restrict_chat_member.py
index d537f961..24b93873 100644
--- a/pyrogram/methods/chats/restrict_chat_member.py
+++ b/pyrofork/methods/chats/restrict_chat_member.py
@@ -20,14 +20,14 @@
from datetime import datetime
from typing import Union
-import pyrogram
-from pyrogram import raw, utils
-from pyrogram import types
+import pyrofork
+from pyrofork import raw, utils
+from pyrofork import types
class RestrictChatMember:
async def restrict_chat_member(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
user_id: Union[int, str],
permissions: "types.ChatPermissions",
@@ -50,7 +50,7 @@ class RestrictChatMember:
For a contact that exists in your Telegram address book you can use his phone number (str).
You can also use user profile link in form of *t.me/* (str).
- permissions (:obj:`~pyrogram.types.ChatPermissions`):
+ permissions (:obj:`~pyrofork.types.ChatPermissions`):
New user permissions.
until_date (:py:obj:`~datetime.datetime`, *optional*):
@@ -59,13 +59,13 @@ class RestrictChatMember:
considered to be banned forever. Defaults to epoch (ban forever).
Returns:
- :obj:`~pyrogram.types.Chat`: On success, a chat object is returned.
+ :obj:`~pyrofork.types.Chat`: On success, a chat object is returned.
Example:
.. code-block:: python
from datetime import datetime, timedelta
- from pyrogram.types import ChatPermissions
+ from pyrofork.types import ChatPermissions
# Completely restrict chat member (mute) forever
await app.restrict_chat_member(chat_id, user_id, ChatPermissions())
diff --git a/pyrogram/methods/chats/set_administrator_title.py b/pyrofork/methods/chats/set_administrator_title.py
similarity index 87%
rename from pyrogram/methods/chats/set_administrator_title.py
rename to pyrofork/methods/chats/set_administrator_title.py
index 9e042408..f6206895 100644
--- a/pyrogram/methods/chats/set_administrator_title.py
+++ b/pyrofork/methods/chats/set_administrator_title.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan
#
-# This file is part of Pyrogram.
+# This file is part of Pyrofork.
#
-# Pyrogram is free software: you can redistribute it and/or modify
+# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# Pyrogram is distributed in the hope that it will be useful,
+# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
-# along with Pyrogram. If not, see .
+# along with Pyrofork. If not, see .
from typing import Union
-import pyrogram
-from pyrogram import raw
+import pyrofork
+from pyrofork import raw
class SetAdministratorTitle:
async def set_administrator_title(
- self: "pyrogram.Client",
+ self: "pyrofork.Client",
chat_id: Union[int, str],
user_id: Union[int, str],
title: str,
diff --git a/pyrogram/methods/chats/set_chat_description.py b/pyrofork/methods/chats/set_chat_description.py
similarity index 81%
rename from pyrogram/methods/chats/set_chat_description.py
rename to pyrofork/methods/chats/set_chat_description.py
index c9cd14da..b9393429 100644
--- a/pyrogram/methods/chats/set_chat_description.py
+++ b/pyrofork/methods/chats/set_chat_description.py
@@ -1,30 +1,31 @@
-# Pyrogram - Telegram MTProto API Client Library for Python
+# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan
+# Copyright (C) 2022-present Mayuri-Chan