Пример #1
0
def callback_query(call):
    bot.answer_callback_query(call.id)
    bot.delete_message(call.message.chat.id, call.message.id)
    if is_reg(call.message):
        analytics_manager(call.data, users_dict[call.message.chat.id])
    else:
        bot.send_message(call.message.chat.id, "Please /start again")
Пример #2
0
def callback_query(call):
    bot.answer_callback_query(call.id)
    if is_reg(call.message):
        bot.delete_message(call.message.chat.id, call.message.id)
        bot.send_message(call.message.chat.id, "Please click /hi again")
    else:
        bot.send_message(call.message.chat.id, "Please /start again")
Пример #3
0
def callback_query(call):
    bot.answer_callback_query(call.id)
    if is_reg(call.message):
        session = call.data[9:]
        get_marks(call.message, users_dict[call.message.chat.id], session)
    else:
        bot.send_message(call.message.chat.id, "Please /start again")
Пример #4
0
def message_handler(message):
    if (is_reg(message)):
        front_page(users_dict[message.chat.id], message)
    else:
        bot.send_message(message.chat.id,
                         "ohhh! you are not logged in!",
                         reply_markup=gen_markup_login())
Пример #5
0
def login_callback(call):
    if not is_reg(call.message):
        bot.answer_callback_query(call.id)
        bot.send_message(call.message.chat.id,
                         "Please enter you Roll number like mitXXXXXXXXX")
        bot.register_next_step_handler(call.message, get_username)
    else:
        bot.answer_callback_query(call.id)
        bot.send_message(call.message.chat.id,
                         "You are already logged in just click /start")
Пример #6
0
def message_handler(message):
    hello_msg = (
        "Hey, I am ZeNo. I was created to save your time so you can do your assignments with one hand!\n"
        "Please wait while i check your status.....")
    bot.send_message(message.chat.id, hello_msg)
    if (is_reg(message)):
        bot.send_message(message.chat.id, "you are registered with us!")
        front_page(users_dict[message.chat.id], message)
    else:
        bot.send_message(message.chat.id,
                         "ohhh! you are not logged in!",
                         reply_markup=gen_markup_login())
Пример #7
0
def login_callback(call):
    bot.answer_callback_query(call.id)
    if not is_reg(call.message):
        bot.answer_callback_query(call.id)
        bot.send_message(
            call.message.chat.id,
            "you are not even logged in dada.\n Please click /start")
    else:
        bot.answer_callback_query(call.id)
        if call.message.chat.id in users_dict:
            logout(users_dict[call.message.chat.id])
        else:
            bot.send_message(call.message.chat.id,
                             "Sorry!! we messed up .. :(\n just click /start")
Пример #8
0
def callback_query(call):
    bot.answer_callback_query(call.id)
    if is_reg(call.message):
        enable_analytics(call.message, users_dict[call.message.chat.id])
    else:
        bot.send_message(call.message.chat.id, "Please /start again")
Пример #9
0
def callback_query(call):
    bot.answer_callback_query(call.id)
    if is_reg(call.message):
        get_session(call.message, users_dict[call.message.chat.id])
    else:
        bot.send_message(call.message.chat.id, "Please /start again")
Пример #10
0
def marks_call_handler(message):
    if is_reg(message):
        get_session(message, users_dict[message.chat.id])
    else:
        bot.send_message(message.chat.id, "Please /start again")