Tstickers Index / Tstickers / Manager
Auto-generated documentation for tstickers.manager module.
Sticker instance attributes.
class Sticker: ...
Get Sticker representation in the form Sticker:name.
Type: str representation
def __repr__(self) -> str: ...
Get the emoji as a string.
def emojiName(self) -> str: ...
The StickerManager sets up the api and makes requests.
class StickerManager:
def __init__(
self, token: str, session: caching.CachedSession | None = None, threads: int = 4
) -> None: ...
Convert a downloaded sticker pack given by packName to other formats specified.
packName
str - name of the pack to convertfps
int - framerate of animated stickers, affecting optimization and quality (default: 20)scale
float - Scale factor of animated stickers, for up/downscaling images, affecting optimization and quality (default: 1).noCache
bool - set to true to disable cache. Defaults to False.backend
Backend - select the backend to use to convert animated stickers :param set[str]|None formats: Set of formats to convert telegram tgs stickers to (default: {"gif", "webp", "apng"})
def convertPack(
self,
packName: str,
fps: int = 20,
scale: float = 1,
noCache: bool = False,
backend: Backend = Backend.UNDEFINED,
formats: set[str] | None = None,
) -> None: ...
Use the telegram api.
function
str - function to execute params (dict[Any, Any]): function parameters
RuntimeError
- In the event of a failure
Optional[dict[Any,
Any]] - api response
def doAPIReq(self, function: str, params: dict[Any, Any]) -> dict[Any, Any] | None: ...
Download a sticker pack.
packName
str - name of the pack
Type: bool success
def downloadPack(self, packName: str) -> bool: ...
Download a sticker from the server.
path
Path - the path to write tolink
str - the url to the file on the server
Type: int path.write_bytes(res.content)
def downloadSticker(self, path: Path, link: str) -> int: ...
Get a list of File objects.
packName
str - name of the pack
dict[str,
Any] - dictionary containing sticker data
def getPack(self, packName: str) -> dict[str, Any] | None: ...
Get sticker info from the server.
fileData (dict[str, Any]): sticker id
- Sticker - Sticker instance
def getSticker(self, fileData: dict[str, Any]) -> Sticker: ...
Similar to the emoji.demojize function.
However, returns a string of unique keywords in alphabetical order seperated by "_"
emoji
str - emoji unicode char
Type: str returns a string of unique keywords in alphabetical order seperated by "_"
def demojize(emoji: str) -> str: ...