Telegram Bot API. Кнопка «принять» под сообщением не реагирует.Python

Программы на Python
Anonymous
Telegram Bot API. Кнопка «принять» под сообщением не реагирует.

Сообщение Anonymous »


Please help me with the code.The bottom line is this: there are two bots. one bot writes a welcome message and requests experience from the worker. The employee leaves his request, and this request is sent by a second bot in the chat. Under this application there is an accept button, after clicking on it, the first bot should send the worker a message like “you have been hired.” But the "accept" button does not want to react in any way. There is something like an endless download, there are no problems with the connection, checking run&debug - there are no errors. I'm tearing out the last hairs from my head, please help..

Here is the code:

def process_application(message): user_profile_link = f"https://t.me/{message.from_user.username}" application_text = f"Worker profile: {user_profile_link}\nApplication text: {message.text}\nWorker ID: {message.from_user.id}" bot_first.send_message(message.chat.id, "Your application is under consideration, please wait for the Administration's decision") bot_second.send_message(ADMIN_CHAT_ID, f"New application!✅️:\n{application_text}", reply_markup=create_accept_button()) def create_accept_button(): keyboard = types.InlineKeyboardMarkup() accept_button = types.InlineKeyboardButton(text="Accept", callback_data="accept") keyboard.add(accept_button) return keyboard def create_action_buttons(): keyboard = types.InlineKeyboardMarkup() keyboard.add(types.InlineKeyboardButton("Channels", callback_data="channels")) keyboard.add(types.InlineKeyboardButton("Invite", callback_data="invite")) keyboard.add(types.InlineKeyboardButton("Chat&Manuals", callback_data="chat_manuals")) return keyboard @bot_second.callback_query_handler def accept_application(call): if call.data == "accept": bot_second.send_message(call.message.chat.id, "Your application has been approved by the Administration!✅️", reply_markup=create_action_buttons()) P.S. The mistake may be stupid or insignificant. I apologize, I recently entered into the development of bots in TG.

RUN&DEBUG in VISUALSTUDIO. Restatring the script. In the chat, several people pressed the accept button - powerlessly


Источник: https://stackoverflow.com/questions/781 ... ot-respond

Вернуться в «Python»