Telegram Bot API .The "accept" button under the message does not respond

33 Views Asked by At

I have 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.” However, the "accept" button does not react in any way. It seems like there is something similar happening to an endless download, as there are no problems with the connection and checking Run&Debug produces no errors.

This is my 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())

0

There are 0 best solutions below