Relative Content

Tag Archive for pythontelebot

Handler in telebot in webhook does not work, how to fix it?

I need to make my server to respond immediately and equally to a large number of bots and at the same time and not become heavily loaded as happens with polling. Requests that users will make in @qwerty1_bot and @qwerty2_bot will be processed in the same way, all the functionality and the database are all the same, it’s some kind of mirrors. The bot’s code is very large and originally worked on an asynchronous telebot and contained code that was responsible for answering users like this:

How I can create as much buttons as I want in Telebot?

Im trying to make bot send messages and buttons for each message. But bot can create from 2 to 4 buttons when when more buttons required. After third button, it gives me error Error code: 400. Description: Bad Request: BUTTON_DATA_INVALID.

How to receive IDs of all grouped photos in Telegram?

I’m writing a bot that saves user’s notes. I’m facing a problem with adding the ability to receive attached grouped photos (files, videos, etc.). How can I get the IDs of all photos in a single message? I know about media_group_id, but I don’t know how to get the photo IDs from it 🙁 I’m writing in Python, using the pyTelegramBotAPI library.

Use callback_data in chained function in telebot

In the send_service_names function, I get information from the api, I start looping, and using InlineKeyboardMarkup, I set the information obtained from the api into callback_data, and using the arg in the next function, i.e. send_service_information, I use the obtained information and According to that information, I will send the next request to the server, and finally, with the obtained answer, I will create a menu like the previous function. But the main question here is that I want to send this using callaback_data to the next function (in a chain), but When I run the code and the user clicks on the menu, the next function code is not executed and the same function, send_service_information, is executed again.