diff --git a/mautrix_telegram/portal_util/message_convert.py b/mautrix_telegram/portal_util/message_convert.py index 16aa96e8..88e9b48b 100644 --- a/mautrix_telegram/portal_util/message_convert.py +++ b/mautrix_telegram/portal_util/message_convert.py @@ -736,7 +736,7 @@ class TelegramMessageConverter: def _parse_document_attributes(attributes: list[TypeDocumentAttribute]) -> DocAttrs: 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() - sticker_pack_ref = {} + sticker_pack_ref = None for attr in attributes: if isinstance(attr, DocumentAttributeFilename): name = name or attr.file_name @@ -746,8 +746,8 @@ def _parse_document_attributes(attributes: list[TypeDocumentAttribute]) -> DocAt sticker_alt = attr.alt if isinstance(attr.stickerset, InputStickerSetID): sticker_pack_ref = { - "id": attr.stickerset.id, - "access_hash": attr.stickerset.access_hash, + "id": str(attr.stickerset.id), + "access_hash": str(attr.stickerset.access_hash), } elif isinstance(attr.stickerset, InputStickerSetShortName): sticker_pack_ref = {"short_name": attr.stickerset.short_name} @@ -804,6 +804,7 @@ def _parse_document_meta( if attrs.is_sticker: info["fi.mau.telegram.sticker"] = { "alt": attrs.sticker_alt, + "id": str(document.id), "pack": attrs.sticker_pack_ref, }