Beispiel #1
0
def apply_request_handler(call: types.CallbackQuery):
    user_id = call.message.chat.id
    bot.edit_message_text(RQ_SEARCH_START,
                          user_id,
                          call.message.message_id,
                          reply_markup=None)
    Request.update_request({'registration_flag': True}, user_id)
    donor_exist = Donor.try_exist(user_id)
    bot.send_message(user_id,
                     MAIN_MSG,
                     reply_markup=main_keyboard(not donor_exist))
Beispiel #2
0
def main_handler(msg_call):
    user_id = None
    if isinstance(msg_call, types.CallbackQuery):
        bot.edit_message_text(BACK_TO_MAIN_DECISION, msg_call.message.chat.id,
                              msg_call.message.message_id)
        user_id = msg_call.message.chat.id
    else:
        user_id = msg_call.chat.id
    # chat_id совпадает с TelegramID
    donor_exist = Donor.try_exist(user_id)
    keyboard = main_keyboard(not donor_exist)
    bot.send_message(user_id, MAIN_MSG, reply_markup=keyboard)