mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
fix type import error
This commit is contained in:
+1
-1
@@ -3,4 +3,4 @@ __pycache__/
|
|||||||
cert/
|
cert/
|
||||||
data/
|
data/
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
x.py
|
utils/x.py
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from telegram.ext import (ApplicationBuilder, CallbackQueryHandler, CommandHandl
|
|||||||
InlineQueryHandler, MessageHandler, PicklePersistence, filters)
|
InlineQueryHandler, MessageHandler, PicklePersistence, filters)
|
||||||
|
|
||||||
import common
|
import common
|
||||||
from tweet import Telegram
|
from utils.tweet import Telegram
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from telegram import Chat, Message, Update
|
from telegram import Chat, Message, Update
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
from typing import Type, TypedDict
|
|
||||||
|
|
||||||
from telegram import InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVideo, InputMediaPhoto, \
|
|
||||||
InputMediaVideo
|
|
||||||
|
|
||||||
TypeInlineQueryResult: Type[
|
|
||||||
InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVideo] = InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVideo
|
|
||||||
InputMediaAnimation = tuple[str, bool]
|
|
||||||
TypeMessageMediaResult: Type[
|
|
||||||
InputMediaPhoto | InputMediaVideo | InputMediaAnimation] = InputMediaPhoto | InputMediaVideo | InputMediaAnimation
|
|
||||||
|
|
||||||
|
|
||||||
class TweetInfo(TypedDict):
|
|
||||||
tweetID: str
|
|
||||||
user_name: str
|
|
||||||
user_screen_name: str
|
|
||||||
text: str
|
|
||||||
media_extended: list[dict]
|
|
||||||
possibly_sensitive: bool
|
|
||||||
@@ -12,7 +12,7 @@ from telegram import (InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQ
|
|||||||
from common import get_logger, x_media_regex, x_tco_regex, x_url_regex
|
from common import get_logger, x_media_regex, x_tco_regex, x_url_regex
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from types import TweetInfo, TypeInlineQueryResult, TypeMessageMediaResult
|
from .types import TweetInfo, TypeInlineQueryResult, TypeMessageMediaResult
|
||||||
|
|
||||||
logger = get_logger(__name__)
|
logger = get_logger(__name__)
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
from typing import TypedDict
|
||||||
|
|
||||||
|
from telegram import InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVideo, InputMediaPhoto, \
|
||||||
|
InputMediaVideo
|
||||||
|
|
||||||
|
TypeInlineQueryResult = InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVideo
|
||||||
|
InputMediaAnimation = tuple[str, bool]
|
||||||
|
TypeMessageMediaResult = InputMediaPhoto | InputMediaVideo | InputMediaAnimation
|
||||||
|
|
||||||
|
|
||||||
|
class TweetInfo(TypedDict):
|
||||||
|
tweetID: str
|
||||||
|
user_name: str
|
||||||
|
user_screen_name: str
|
||||||
|
text: str
|
||||||
|
media_extended: list[dict]
|
||||||
|
possibly_sensitive: bool
|
||||||
Reference in New Issue
Block a user