mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
19 lines
447 B
Python
19 lines
447 B
Python
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
|