mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
new bsky support
This commit is contained in:
+54
-1
@@ -1,4 +1,6 @@
|
||||
from typing import TypedDict
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Literal, TypedDict
|
||||
|
||||
from telegram import InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVideo, InputMediaPhoto, \
|
||||
InputMediaVideo
|
||||
@@ -15,3 +17,54 @@ class TweetInfo(TypedDict):
|
||||
text: str
|
||||
media_extended: list[dict]
|
||||
possibly_sensitive: bool
|
||||
|
||||
|
||||
class BskyInfo(TypedDict):
|
||||
thread: BskyThread
|
||||
|
||||
|
||||
class BskyThread(TypedDict):
|
||||
post: BskyPost
|
||||
|
||||
|
||||
class BskyPost(TypedDict):
|
||||
author: BskyAuthor
|
||||
record: BskyPostRecord
|
||||
embed: BskyEmbedImages | BskyEmbedVideo | BskyEmbedExternal
|
||||
|
||||
|
||||
class BskyAuthor(TypedDict):
|
||||
handle: str
|
||||
displayName: str
|
||||
|
||||
|
||||
class BskyPostRecord(TypedDict):
|
||||
text: str
|
||||
|
||||
|
||||
class BskyEmbedImage(TypedDict):
|
||||
thumb: str
|
||||
fullsize: str
|
||||
|
||||
|
||||
BskyEmbedImages = TypedDict('BskyEmbedImages', {
|
||||
'$type': Literal['app.bsky.embed.images#view'],
|
||||
'images': list[BskyEmbedImage]
|
||||
})
|
||||
|
||||
BskyEmbedVideo = TypedDict('BskyEmbedVideo', {
|
||||
'$type': Literal['app.bsky.embed.video#view'],
|
||||
'playlist': str,
|
||||
'thumbnail': str
|
||||
})
|
||||
|
||||
|
||||
class BskyEmbedExternalItem(TypedDict):
|
||||
uri: str
|
||||
thumb: str
|
||||
|
||||
|
||||
BskyEmbedExternal = TypedDict('BskyEmbedExternal', {
|
||||
'$type': Literal['app.bsky.embed.external#view'],
|
||||
'external': BskyEmbedExternalItem
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user