Beispiel #1
0
def review_quit(bot, update):
    try:
        states.pop(user(update))
    except KeyError:
        pass
    # send(update, "Quitting...")
    menu.head_menu(bot, update)
    return ConversationHandler.END
Beispiel #2
0
def notify_stats_handle(bot, update):
    res = update.message.text
    if res not in enums.NotificationType.values():
        send(update,
             say.incorrect_input + say.choose_general_goal,
             markup=enums.NotificationType.values())
        return NOTIFY_STATS
    states[user(update)].append(res)
    send(update, say.registration_completed)
    menu.head_menu(bot, update)
    queries.add_user(states.pop(user(update)))
    return ConversationHandler.END
Beispiel #3
0
def start(bot, update):
    user_id = user(update)
    name = update.message.from_user.username
    states[user_id] = [user_id, name]

    if queries.if_registered(user_id):
        send(update, say.hello)
        menu.head_menu(bot, update)
        return ConversationHandler.END

    send(update, say.welcome)
    return general_goal(update)
Beispiel #4
0
def end(bot, update):
    send(update, say.pack_added)
    head_menu(bot, update)
    return END
Beispiel #5
0
def end(bot, update):
    _states[user(update)] = None
    head_menu(bot, update)
    return END