H
H
Herman Coffman2021-03-17 13:13:51
Python
Herman Coffman, 2021-03-17 13:13:51

Why does it give an error when you write start to the bot?

For some reason, when you write the /start command to the bot, it does not write anything and gives an error to the console. How to fix it?
Mistake:

2021-03-17 12:10:24,055 (__init__.py:515 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: wrong remote file identifier specified: Wrong character in the string"

The code:
@bot.message_handler(commands=['start'])
def welcome(message):
    bot.send_sticker(message.chat.id, 'Привет!')
    markup = types.ReplyKeyboardMarkup(resize_keyboard=True)
    item1 = types.KeyboardButton(" Рандомное число")
    item2 = types.KeyboardButton(" Как дела?")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
o5a, 2021-03-17
@Gera01

https://core.telegram.org/bots/api#sendsticker
The second parameter of the method should be the sticker itself (file_d or url)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question