bot.py
def save_image(update: Update, context: CallbackContext) -> None:
    """
    Saves the received image and according to the amount of the previously
    sent images suggests the user next options.

    :param update: represents an incoming update
    :param context: context of the processed message
    :return: None
    """
    image_id = get_image_id(update, context)
    try:
        if image_id:
            image = context.bot.get_file(image_id)
            user_id = update.message.chat.id
            image_name = f"{user_id}-{image_id}.jpg"
            image.download(image_name)
            if count_user_images(user_id) >= 1:
                keyboard = choose_GIF_type_keyboard
                reply_markup = InlineKeyboardMarkup(keyboard)
                message = (
                    "Отправьте еще одно изображение или выберите, как сохранить GIF"
                )
                context.bot.send_message(
                    chat_id=user_id, text=message, reply_markup=reply_markup
                )
            elif count_user_images(user_id) == 0:
                USERS_INFO[user_id] = {"sent_images": 0}
                keyboard = select_font_and_size_keyboard
                reply_markup = InlineKeyboardMarkup(keyboard)
                message = (
                    "Отправьте следующее изображение или отправьте текст (при "
                    "необходимости возможно предварительно выбрать шрифт и "
                    "размер шрифта):"
                )
                context.bot.send_message(
                    chat_id=user_id, text=message, reply_markup=reply_markup
                )
            USERS_INFO[user_id]["sent_images"] += 1
    except Exception as e:
        logger.exception(e)

    Saves the received image and according to the amount of the previously
    sent images suggests the user next options.

    :param update: represents an incoming update
    :param context: context of the processed message
    :return: None
    
Saves the received image and according to the amount of the previously
sent images suggests the user next options.
Saves the received image and according to the amount of the previously sent images suggests the user next options .
def save_image(update: Update, context: CallbackContext) -> None:
    image_id = get_image_id(update, context)
    try:
        if image_id:
            image = context.bot.get_file(image_id)
            user_id = update.message.chat.id
            image_name = f"{user_id}-{image_id}.jpg"
            image.download(image_name)
            if count_user_images(user_id) >= 1:
                keyboard = choose_GIF_type_keyboard
                reply_markup = InlineKeyboardMarkup(keyboard)
                message = (
                    "Отправьте еще одно изображение или выберите, как сохранить GIF"
                )
                context.bot.send_message(
                    chat_id=user_id, text=message, reply_markup=reply_markup
                )
            elif count_user_images(user_id) == 0:
                USERS_INFO[user_id] = {"sent_images": 0}
                keyboard = select_font_and_size_keyboard
                reply_markup = InlineKeyboardMarkup(keyboard)
                message = (
                    "Отправьте следующее изображение или отправьте текст (при "
                    "необходимости возможно предварительно выбрать шрифт и "
                    "размер шрифта):"
                )
                context.bot.send_message(
                    chat_id=user_id, text=message, reply_markup=reply_markup
                )
            USERS_INFO[user_id]["sent_images"] += 1
    except Exception as e:
        logger.exception(e)
def save_image ( update : Update , context : CallbackContext ) -> None : image_id = get_image_id ( update , context ) try : if image_id : image = context . bot . get_file ( image_id ) user_id = update . message . chat . id image_name = f"{user_id}-{image_id}.jpg" image . download ( image_name ) if count_user_images ( user_id ) >= 1 : keyboard = choose_GIF_type_keyboard reply_markup = InlineKeyboardMarkup ( keyboard ) message = ( "Отправьте еще одно изображение или выберите, как сохранить GIF" ) context . bot . send_message ( chat_id = user_id , text = message , reply_markup = reply_markup ) elif count_user_images ( user_id ) == 0 : USERS_INFO [ user_id ] = { "sent_images" : 0 } keyboard = select_font_and_size_keyboard reply_markup = InlineKeyboardMarkup ( keyboard ) message = ( "Отправьте следующее изображение или отправьте текст (при " "необходимости возможно предварительно выбрать шрифт и " "размер шрифта):" ) context . bot . send_message ( chat_id = user_id , text = message , reply_markup = reply_markup ) USERS_INFO [ user_id ] [ "sent_images" ] += 1 except Exception as e : logger . exception ( e )
Saves the received image and according to the amount of the previously
sent images suggests the user next options.
Saves the received image and according to the amount of the previously sent images suggests the user next options .
"""
    Saves the received image and according to the amount of the previously
    sent images suggests the user next options.

    :param update: represents an incoming update
    :param context: context of the processed message
    :return: None
    """
None
update
Update
represents an incoming update
represents an incoming update
context
CallbackContext
context of the processed message
context of the processed message