This commit is contained in:
2024-06-23 21:52:12 +08:00
parent a6325d5bc8
commit cade370538
4 changed files with 74 additions and 50 deletions
+18
View File
@@ -0,0 +1,18 @@
from __future__ import annotations
from common import x_url_regex
from .net import NetClient
from .tweet import TelegramTweet
class Telegram(NetClient):
def __init__(self, url: str):
self._url = url
async def __aenter__(self):
if x_url_regex.match(self._url):
async with TelegramTweet(self._url) as tweet:
return tweet
async def __aexit__(self, exc_type, exc_val, exc_tb):
pass