Stringify sticker pack IDs and include sticker ID
This commit is contained in:
@@ -736,7 +736,7 @@ class TelegramMessageConverter:
|
|||||||
def _parse_document_attributes(attributes: list[TypeDocumentAttribute]) -> DocAttrs:
|
def _parse_document_attributes(attributes: list[TypeDocumentAttribute]) -> DocAttrs:
|
||||||
name, mime_type, is_sticker, sticker_alt, width, height = None, None, False, None, 0, 0
|
name, mime_type, is_sticker, sticker_alt, width, height = None, None, False, None, 0, 0
|
||||||
is_gif, is_audio, is_voice, duration, waveform = False, False, False, 0, bytes()
|
is_gif, is_audio, is_voice, duration, waveform = False, False, False, 0, bytes()
|
||||||
sticker_pack_ref = {}
|
sticker_pack_ref = None
|
||||||
for attr in attributes:
|
for attr in attributes:
|
||||||
if isinstance(attr, DocumentAttributeFilename):
|
if isinstance(attr, DocumentAttributeFilename):
|
||||||
name = name or attr.file_name
|
name = name or attr.file_name
|
||||||
@@ -746,8 +746,8 @@ def _parse_document_attributes(attributes: list[TypeDocumentAttribute]) -> DocAt
|
|||||||
sticker_alt = attr.alt
|
sticker_alt = attr.alt
|
||||||
if isinstance(attr.stickerset, InputStickerSetID):
|
if isinstance(attr.stickerset, InputStickerSetID):
|
||||||
sticker_pack_ref = {
|
sticker_pack_ref = {
|
||||||
"id": attr.stickerset.id,
|
"id": str(attr.stickerset.id),
|
||||||
"access_hash": attr.stickerset.access_hash,
|
"access_hash": str(attr.stickerset.access_hash),
|
||||||
}
|
}
|
||||||
elif isinstance(attr.stickerset, InputStickerSetShortName):
|
elif isinstance(attr.stickerset, InputStickerSetShortName):
|
||||||
sticker_pack_ref = {"short_name": attr.stickerset.short_name}
|
sticker_pack_ref = {"short_name": attr.stickerset.short_name}
|
||||||
@@ -804,6 +804,7 @@ def _parse_document_meta(
|
|||||||
if attrs.is_sticker:
|
if attrs.is_sticker:
|
||||||
info["fi.mau.telegram.sticker"] = {
|
info["fi.mau.telegram.sticker"] = {
|
||||||
"alt": attrs.sticker_alt,
|
"alt": attrs.sticker_alt,
|
||||||
|
"id": str(document.id),
|
||||||
"pack": attrs.sticker_pack_ref,
|
"pack": attrs.sticker_pack_ref,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user