Working with messages


These examples assume you have read The Full API.

Sending stickers

Stickers are nothing else than files, and when you successfully retrieve the stickers for a certain sticker set, all you will have are handles to these files. Remember, the files Telegram holds on their servers can be referenced through this pair of ID/hash (unique per user), and you need to use this handle when sending a “document” message. This working example will send yourself the very first sticker you have:

# Get all the sticker sets this user has
from import GetAllStickersRequest
sticker_sets = await client(GetAllStickersRequest(0))

# Choose a sticker set
from import GetStickerSetRequest
from import InputStickerSetID
sticker_set = sticker_sets.sets[0]

# Get the stickers for this sticker set
stickers = await client(GetStickerSetRequest(
    stickerset=InputStickerSetID(, access_hash=sticker_set.access_hash

# Stickers are nothing more than files, so send that
await client.send_file('me', stickers.documents[0])