Compare commits

...

3 commits

Author SHA1 Message Date
wulan17
24d1300731
pyrofork: Update domain
Some checks failed
Build-docs / build (push) Has been cancelled
Pyrofork / build (macos-latest, 3.10) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.11) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.12) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.13) (push) Has been cancelled
Pyrofork / build (macos-latest, 3.14) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.10) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.11) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.12) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.13) (push) Has been cancelled
Pyrofork / build (ubuntu-latest, 3.14) (push) Has been cancelled
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-12-08 03:24:43 +07:00
wulan17
03c57accfd
pyrofork: access class __annotations__ instead of instance
Python 3.14 removed implicit fallback to class-level __annotations__,
causing AttributeError when accessing self.__annotations__. Updated
matches() to use self.__class__.__annotations__ for compatibility
across Python 3.10+.

Signed-off-by: wulan17 <wulan17@komodos.id>
2025-12-08 03:05:24 +07:00
wulan17
3910c4ef93
pyrofork: Adapt uvloop changes
Signed-off-by: wulan17 <wulan17@komodos.id>
2025-12-08 02:47:12 +07:00
14 changed files with 30 additions and 21 deletions

View file

@ -9,7 +9,7 @@
Homepage Homepage
</a> </a>
<a href="https://pyrofork.wulan17.top"> <a href="https://pyrofork.wulan17.dev">
Documentation Documentation
</a> </a>
@ -44,7 +44,7 @@ async def hello(client, message):
app.run() app.run()
``` ```
**Pyrofork** is a modern, elegant and asynchronous [MTProto API](https://pyrofork.wulan17.top/main/topics/mtproto-vs-botapi) **Pyrofork** is a modern, elegant and asynchronous [MTProto API](https://pyrofork.wulan17.dev/main/topics/mtproto-vs-botapi)
framework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot framework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot
identity (bot API alternative) using Python. identity (bot API alternative) using Python.
@ -72,6 +72,6 @@ pip3 install pyrofork
### Resources ### Resources
- Check out the docs at https://pyrofork.wulan17.top to learn more about Pyrofork, get started right - Check out the docs at https://pyrofork.wulan17.dev to learn more about Pyrofork, get started right
away and discover more in-depth material for building your client applications. away and discover more in-depth material for building your client applications.
- Join the official group at https://t.me/MayuriChan_Chat and stay tuned for news, updates and announcements. - Join the official group at https://t.me/MayuriChan_Chat and stay tuned for news, updates and announcements.

View file

@ -20,4 +20,4 @@ class {name}: # type: ignore
raise TypeError("Base types can only be used for type checking purposes: " raise TypeError("Base types can only be used for type checking purposes: "
"you tried to use a base type instance as argument, " "you tried to use a base type instance as argument, "
"but you need to instantiate one of its constructors instead. " "but you need to instantiate one of its constructors instead. "
"More info: https://pyrofork.wulan17.top/telegram/base/{doc_name}") "More info: https://pyrofork.wulan17.dev/telegram/base/{doc_name}")

View file

@ -73,7 +73,7 @@ html_theme_options = {
"repo": "fontawesome/brands/github", "repo": "fontawesome/brands/github",
"edit": "material/file-edit-outline", "edit": "material/file-edit-outline",
}, },
"site_url": "https://pyrofork.wulan17.top/", "site_url": "https://pyrofork.wulan17.dev/",
"repo_url": "https://github.com/Mayuri-Chan/pyrofork/", "repo_url": "https://github.com/Mayuri-Chan/pyrofork/",
"repo_name": "pyrofork", "repo_name": "pyrofork",
"globaltoc_collapse": True, "globaltoc_collapse": True,

View file

@ -47,7 +47,7 @@ like send_audio(), send_document(), send_location(), etc...
), ),
InlineKeyboardButton( # Opens a web URL InlineKeyboardButton( # Opens a web URL
"URL", "URL",
url="https://pyrofork.wulan17.top" url="https://pyrofork.wulan17.dev"
), ),
], ],
[ # Second row [ # Second row

View file

@ -24,13 +24,13 @@ It uses the @on_inline_query decorator to register an InlineQueryHandler.
input_message_content=InputTextMessageContent( input_message_content=InputTextMessageContent(
"Here's how to install **Pyrofork**" "Here's how to install **Pyrofork**"
), ),
url="https://pyrofork.wulan17.top/intro/install", url="https://pyrofork.wulan17.dev/intro/install",
description="How to install Pyrofork", description="How to install Pyrofork",
reply_markup=InlineKeyboardMarkup( reply_markup=InlineKeyboardMarkup(
[ [
[InlineKeyboardButton( [InlineKeyboardButton(
"Open website", "Open website",
url="https://pyrofork.wulan17.top/intro/install" url="https://pyrofork.wulan17.dev/intro/install"
)] )]
] ]
) )
@ -40,13 +40,13 @@ It uses the @on_inline_query decorator to register an InlineQueryHandler.
input_message_content=InputTextMessageContent( input_message_content=InputTextMessageContent(
"Here's how to use **Pyrofork**" "Here's how to use **Pyrofork**"
), ),
url="https://pyrofork.wulan17.top/start/invoking", url="https://pyrofork.wulan17.dev/start/invoking",
description="How to use Pyrofork", description="How to use Pyrofork",
reply_markup=InlineKeyboardMarkup( reply_markup=InlineKeyboardMarkup(
[ [
[InlineKeyboardButton( [InlineKeyboardButton(
"Open website", "Open website",
url="https://pyrofork.wulan17.top/start/invoking" url="https://pyrofork.wulan17.dev/start/invoking"
)] )]
] ]
) )

View file

@ -11,7 +11,7 @@ to make it only work for specific messages in a specific chat.
# Target chat. Can also be a list of multiple chat ids/usernames # Target chat. Can also be a list of multiple chat ids/usernames
TARGET = -100123456789 TARGET = -100123456789
# Welcome message template # Welcome message template
MESSAGE = "{} Welcome to [Pyrofork](https://pyrofork.wulan17.top/)'s group chat {}!" MESSAGE = "{} Welcome to [Pyrofork](https://pyrofork.wulan17.dev/)'s group chat {}!"
app = Client("my_account") app = Client("my_account")

View file

@ -43,7 +43,7 @@ Homepage = "https://github.com/Mayuri-Chan"
Tracker = "https://github.com/Mayuri-Chan/pyrofork/issues" Tracker = "https://github.com/Mayuri-Chan/pyrofork/issues"
Community = "https://t.me/MayuriChan_Chat" Community = "https://t.me/MayuriChan_Chat"
Source = "https://github.com/Mayuri-Chan/pyrofork" Source = "https://github.com/Mayuri-Chan/pyrofork"
Documentation = "https://pyrofork.wulan17.top" Documentation = "https://pyrofork.wulan17.dev"
[build-system] [build-system]
requires = ["hatchling"] requires = ["hatchling"]

View file

@ -825,7 +825,7 @@ class Client(Methods):
if session_empty: if session_empty:
if not self.api_id or not self.api_hash: if not self.api_id or not self.api_hash:
raise AttributeError("The API key is required for new authorizations. " raise AttributeError("The API key is required for new authorizations. "
"More info: https://pyrofork.wulan17.top/main/start/auth") "More info: https://pyrofork.wulan17.dev/main/start/auth")
await self.storage.api_id(self.api_id) await self.storage.api_id(self.api_id)

View file

@ -55,7 +55,7 @@ except ImportError:
log.warning( log.warning(
"TgCrypto is missing! " "TgCrypto is missing! "
"Pyrogram will work the same, but at a much slower speed. " "Pyrogram will work the same, but at a much slower speed. "
"More info: https://pyrofork.wulan17.top/main/topics/speedups" "More info: https://pyrofork.wulan17.dev/main/topics/speedups"
) )

View file

@ -95,7 +95,12 @@ class Dispatcher:
def __init__(self, client: "pyrogram.Client"): def __init__(self, client: "pyrogram.Client"):
self.client = client self.client = client
self.loop = asyncio.get_event_loop() try:
loop = asyncio.get_event_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
self.loop = loop
self.handler_worker_tasks = [] self.handler_worker_tasks = []
self.locks_list = [] self.locks_list = []

View file

@ -143,7 +143,7 @@ class SendMessage:
await app.send_message("me", "Message sent with **Pyrogram**!") await app.send_message("me", "Message sent with **Pyrogram**!")
# Disable web page previews # Disable web page previews
await app.send_message("me", "https://pyrofork.wulan17.top", await app.send_message("me", "https://pyrofork.wulan17.dev",
disable_web_page_preview=True) disable_web_page_preview=True)
# Reply to a message using its id # Reply to a message using its id
@ -167,7 +167,7 @@ class SendMessage:
reply_markup=InlineKeyboardMarkup( reply_markup=InlineKeyboardMarkup(
[ [
[InlineKeyboardButton("Data", callback_data="callback_data")], [InlineKeyboardButton("Data", callback_data="callback_data")],
[InlineKeyboardButton("Docs", url="https://pyrofork.wulan17.top")] [InlineKeyboardButton("Docs", url="https://pyrofork.wulan17.dev")]
])) ]))
""" """

View file

@ -56,7 +56,7 @@ class UpdateProfile:
await app.update_profile(first_name="Pyrofork") await app.update_profile(first_name="Pyrofork")
# Update first name and bio # Update first name and bio
await app.update_profile(first_name="Pyrofork", bio="https://pyrofork.wulan17.top/") await app.update_profile(first_name="Pyrofork", bio="https://pyrofork.wulan17.dev/")
# Remove the last name # Remove the last name
await app.update_profile(last_name="") await app.update_profile(last_name="")

View file

@ -29,7 +29,11 @@ from pyrogram.methods.utilities import idle as idle_module, compose as compose_m
def async_to_sync(obj, name): def async_to_sync(obj, name):
function = getattr(obj, name) function = getattr(obj, name)
try:
main_loop = asyncio.get_event_loop() main_loop = asyncio.get_event_loop()
except RuntimeError:
main_loop = asyncio.new_event_loop()
asyncio.set_event_loop(main_loop)
def async_to_sync_gen(agen, loop, is_main_thread): def async_to_sync_gen(agen, loop, is_main_thread):
async def anext(agen): async def anext(agen):

View file

@ -46,7 +46,7 @@ class Identifier:
# Compare each property of other with the corresponding property in self # Compare each property of other with the corresponding property in self
# If the property in self is None, the property in other can be anything # If the property in self is None, the property in other can be anything
# If the property in self is not None, the property in other must be the same # If the property in self is not None, the property in other must be the same
for field in self.__annotations__: for field in self.__class__.__annotations__:
pattern_value = getattr(self, field) pattern_value = getattr(self, field)
update_value = getattr(update, field) update_value = getattr(update, field)
@ -67,7 +67,7 @@ class Identifier:
def count_populated(self): def count_populated(self):
non_null_count = 0 non_null_count = 0
for attr in self.__annotations__: for attr in self.__class__.__annotations__:
if getattr(self, attr) is not None: if getattr(self, attr) is not None:
non_null_count += 1 non_null_count += 1