mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Bump version to 2.3.54
Signed-off-by: Yasir Aris <git@yasir.id>
This commit is contained in:
parent
6c538f026d
commit
8ceec293ba
5 changed files with 29 additions and 14 deletions
|
|
@ -588,7 +588,7 @@ def pyrogram_api():
|
|||
GiftCode
|
||||
GiftedPremium
|
||||
Gift
|
||||
UserGift
|
||||
StarGift
|
||||
InputStarsTransaction
|
||||
Invoice
|
||||
LabeledPrice
|
||||
|
|
@ -600,7 +600,6 @@ def pyrogram_api():
|
|||
StarsStatus
|
||||
StarsTransaction
|
||||
SuccessfulPayment
|
||||
UserStarGift
|
||||
""",
|
||||
pyromod="""
|
||||
Pyromod
|
||||
|
|
@ -928,4 +927,4 @@ if "__main__" == __name__:
|
|||
DESTINATION = "../../docs/source/telegram"
|
||||
PYROGRAM_API_DEST = "../../docs/source/api"
|
||||
|
||||
start()
|
||||
start()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
__fork_name__ = "PyroFork"
|
||||
__version__ = "2.3.53"
|
||||
__version__ = "2.3.54"
|
||||
__license__ = "GNU Lesser General Public License v3.0 (LGPL-3.0)"
|
||||
__copyright__ = "Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>"
|
||||
|
||||
|
|
|
|||
|
|
@ -358,11 +358,11 @@ gift_code = create(gift_code_filter)
|
|||
"""Filter messages that contain :obj:`~pyrogram.types.GiftCode` objects."""
|
||||
# endregion
|
||||
|
||||
# region user_gift
|
||||
async def user_gift_filter(_, __, m: Message):
|
||||
return bool(m.user_gift)
|
||||
user_gift = create(user_gift_filter)
|
||||
"""Filter messages that contain :obj:`~pyrogram.types.UserGift` objects."""
|
||||
# region star_gift_filter
|
||||
async def star_gift_filter(_, __, m: Message):
|
||||
return bool(m.star_gift)
|
||||
star_gift = create(star_gift_filter)
|
||||
"""Filter messages that contain :obj:`~pyrogram.types.StarGift` objects."""
|
||||
# endregion
|
||||
|
||||
# region video_filter
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class GetUserGifts:
|
|||
user_id: Union[int, str],
|
||||
offset: str = "",
|
||||
limit: int = 0,
|
||||
) -> Optional[AsyncGenerator["types.UserGift", None]]:
|
||||
) -> Optional[AsyncGenerator["types.StarGift", None]]:
|
||||
"""Get gifts saved to profile by the given user.
|
||||
|
||||
.. include:: /_includes/usable-by/users.rst
|
||||
|
|
@ -70,13 +70,13 @@ class GetUserGifts:
|
|||
offset=offset,
|
||||
limit=limit
|
||||
),
|
||||
sleep_threshold=max(60, self.sleep_threshold)
|
||||
sleep_threshold=60
|
||||
)
|
||||
|
||||
users = {u.id: u for u in r.users}
|
||||
|
||||
user_gifts = [
|
||||
await types.UserGift._parse(self, gift, users)
|
||||
await types.StarGift._parse_user_star_gift(self, gift, users)
|
||||
for gift in r.gifts
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ from typing import Union, List, Dict, Optional, Any, Callable, TypeVar
|
|||
from types import SimpleNamespace
|
||||
|
||||
import pyrogram
|
||||
from pyrogram import raw, enums
|
||||
from pyrogram import types
|
||||
from pyrogram import raw, enums, types
|
||||
from pyrogram.types.messages_and_media.message import Str
|
||||
from pyrogram.file_id import FileId, FileType, PHOTO_TYPES, DOCUMENT_TYPES
|
||||
|
||||
|
||||
|
|
@ -477,6 +477,22 @@ async def run_sync(func: Callable[..., TypeVar("Result")], *args: Any, **kwargs:
|
|||
loop = asyncio.get_event_loop()
|
||||
return await loop.run_in_executor(None, functools.partial(func, *args, **kwargs))
|
||||
|
||||
def parse_text_with_entities(client, message: "raw.types.TextWithEntities", users):
|
||||
entities = types.List(
|
||||
filter(
|
||||
lambda x: x is not None,
|
||||
[
|
||||
types.MessageEntity._parse(client, entity, users)
|
||||
for entity in getattr(message, "entities", [])
|
||||
]
|
||||
)
|
||||
)
|
||||
|
||||
return {
|
||||
"text": Str(getattr(message, "text", "")).init(entities) or None,
|
||||
"entities": entities or None
|
||||
}
|
||||
|
||||
async def get_reply_to(
|
||||
client: "pyrogram.Client",
|
||||
chat_id: Union[int,str] = None,
|
||||
|
|
|
|||
Loading…
Reference in a new issue