有没有使用event.file的id属性发送贴纸的方法?文档指出要使用特定贴纸集合的id和access_hash发送它,最后使用带有sticker_set的索引来发送贴纸。由于电报服务器中存储的特定贴纸有唯一的id,我想知道是否有任何方法可以用它来发送贴纸?
发布于 2021-08-01 13:43:42
from telethon.tl.functions.messages import GetAllStickersRequest
sticker_sets = await client(GetAllStickersRequest(0))
# Choose a sticker set
from telethon.tl.functions.messages import GetStickerSetRequest
from telethon.tl.types import InputStickerSetID
sticker_set = sticker_sets.sets[0]
# Get the stickers for this sticker set
stickers = await client(GetStickerSetRequest(
stickerset=InputStickerSetID(
id=sticker_set.id, access_hash=sticker_set.access_hash
)
))
# Stickers are nothing more than files, so send that
await client.send_file('me', stickers.documents[0])https://stackoverflow.com/questions/65052059
复制相似问题