Example #1
0
def guess_number(update, context):
    if context.args:
        try:
            user_number = int(context.args[0])
            message = play_random_number(user_number)
        except (TypeError, ValueError):
            message = 'Введите целое число'
    else:
        message = 'Введите число'
    update.message.reply_text(message, reply_markup=create_main_keyboard())
Example #2
0
def guess_number(update, context):
    """Get user number."""
    if context.args:
        try:
            user_number = int(context.args[0])
            message = play_random_number(user_number)
        except (TypeError, ValueError):
            message = 'Enter an integer!'
    else:
        message = 'Enter a number..'
    update.message.reply_text(message, reply_markup=main_keyboard())
Example #3
0
def guess_number(update, context):
    print(context.args)
    if context.args:
        try:
            user_number = int(context.args[0])
            message = play_random_number(user_number)
        except (TypeError, ValueError):
            message = 'Введите целое число'
    else:
        message = "Введите число"
    update.message.reply_text(message)