mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 03:54:51 +00:00
Update upgraded gift regex
Signed-off-by: wulan17 <wulan17@komodos.id>
This commit is contained in:
parent
9ff40dc90b
commit
b65279046e
3 changed files with 4 additions and 3 deletions
|
|
@ -231,6 +231,7 @@ class Client(Methods):
|
|||
PARENT_DIR = Path(sys.argv[0]).parent
|
||||
|
||||
INVITE_LINK_RE = re.compile(r"^(?:https?://)?(?:www\.)?(?:t(?:elegram)?\.(?:org|me|dog)/(?:joinchat/|\+))([\w-]+)$")
|
||||
UPGRADED_GIFT_RE = re.compile(r"^(?:https?://)?(?:www\.)?(?:t(?:elegram)?\.(?:org|me|dog)/(?:nft/|\+))([\w-]+)$")
|
||||
WORKERS = min(32, (os.cpu_count() or 0) + 4) # os.cpu_count() can be None
|
||||
WORKDIR = PARENT_DIR
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class GetUpgradedGift:
|
|||
# Get information about upgraded gift by slug
|
||||
gift = await client.get_upgraded_gift("SignetRing-903")
|
||||
"""
|
||||
match = re.match(r"^(?:https?://)?(?:www\.)?(?:t(?:elegram)?\.(?:org|me|dog)/(?:nft/|\+))([\w-]+)$", link)
|
||||
match = self.UPGRADED_GIFT_RE.match(link)
|
||||
|
||||
if match:
|
||||
slug = match.group(1)
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ class SetPinnedGifts:
|
|||
if not isinstance(gift, str):
|
||||
raise ValueError(f"gift id has to be str, but {type(gift)} was provided")
|
||||
|
||||
saved_gift_match = re.match(r"^(-\d+)_(\d+)$", gift)
|
||||
slug_match = self.UPGRADED_GIFT_RE.match(gift)
|
||||
saved_gift_match = re.match(r"^(\d+)_(\d+)$", str(gift))
|
||||
slug_match = self.UPGRADED_GIFT_RE.match(str(gift))
|
||||
|
||||
if saved_gift_match:
|
||||
stargifts.append(
|
||||
|
|
|
|||
Loading…
Reference in a new issue