O
O
Oli2021-05-28 20:20:40
Python
Oli, 2021-05-28 20:20:40

How to send a sticker from the list?

Hello! There is a list of id stickers

list_stickers = ['CAACAgIAAxkBAAEBWpJgsSIpXAIvIQ1CRSNdNcw73gPQ-gACZgADmL-ADdSD2FV_WKB2HwQ ',
                 'CAACAgIAAxkBAAEBWpVgsSJFvd---tTBzWmC2fjmgSRNtgAClgsAAi8P8AY2nz1gNs-uyx8E ',
                 'CAACAgIAAxkBAAEBWphgsSJfrd16hAxNoZTEAAFT1lQCQrsAAqYBAAIQIQIQpBELJ8cKny0fBA ',
                 'CAACAgIAAxkBAAEBWp1gsSJ2iXL3-RAsrA3Xk9wDXMM-QgACEwADwDZPE6qzh_d_OMqlHwQ ',
                 'CAACAgIAAxkBAAEBWqBgsSKKuQ5UgQhjBOVzpoboBIzXjQAClwEAAhAhAhA2QYBP_aWNUR8E']


I want to send the first sticker from the list

@bot.message_handler(commands=["sticker"])
def first_send_sticker(message):
    bot.send_sticker(message.chat.id, list_stickers[0])


But I get an error. Please tell me what am I doing wrong?

Error: Bad Request: wrong remote file identifier specified: Wrong character in the string

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andriy426, 2021-05-29
@Andriy426

Give each sticker its own id="name" and then search for the sticker by its id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question