
    h&                    t    d dl mZ d dlmZmZmZmZmZ dddZdddZ	d dZ
d!dZdd"dZeZ	 d#d$dZd%dZdS )&    )annotations)
ForceReplyInlineKeyboardButtonInlineKeyboardMarkupKeyboardButtonReplyKeyboardMarkupNrows(list[list[str | tuple[str, str]]] | Nonereturnr   c                    | g } g }| D ]a}g }|D ]E}t          |t                    rt          ||          nt          | }|                    |           F|                    |           bt	          |          S )a4  
    Create an InlineKeyboardMarkup from a list of lists of buttons.

    Parameters:
        rows (List[List[Union[str, Tuple[str, str]]]]):
            List of lists of buttons. Defaults to empty list.

    Returns:
        :obj:`~hydrogram.types.InlineKeyboardMarkup`: An InlineKeyboardMarkup object.
    N)inline_keyboard)
isinstancestrbtnappendr   )r	   linesrowlinebuttons        Y/var/www/html/auto_sub_bot/venv/lib/python3.11/site-packages/hydrogram/helpers/helpers.pyikbr      s     |E   	  	 F,6vs,C,CUS(((fFKKT6666    callback_datatextr   valuer   c                     t          | fi ||iS )a[  
    Create an InlineKeyboardButton.

    Parameters:
        text (str):
            Text of the button.

        value (str):
            Value of the button.

        type (str):
            Type of the button. Defaults to "callback_data".

    Returns:
        :obj:`~hydrogram.types.InlineKeyboardButton`: An InlineKeyboardButton object.
    )r   )r   r   types      r   r   r   7   s    "  66u666r   keyboard!list[list[str | tuple[str, str]]]c                    g }| j         D ]B}g }|D ]&}t          |          }|                    |           '|                    |           C|S )z
    Create a list of lists of buttons from an InlineKeyboardMarkup.

    Parameters:
        keyboard (:obj:`~hydrogram.types.InlineKeyboardMarkup`):
            An InlineKeyboardMarkup object.

    Returns:
        List of lists of buttons.
    )r   ntbr   )r   r   r   r   r   s        r   bkir"   L   si     E'   	  	 F[[FKKTLr   r   listc                    dD ]}t          | |          }|r n| j        |g} |dk    r|                     |           | S )z
    Create a button list from an InlineKeyboardButton.

    Parameters:
        button (:obj:`~hydrogram.types.InlineKeyboardButton`):
            An InlineKeyboardButton object.

    Returns:
        ``list``: A button list.
    )r   urlswitch_inline_query switch_inline_query_current_chatcallback_gamer   )getattrr   r   )r   btn_typer   s      r   r!   r!   a   sd     	 	 )) 	E	k5!F?""hMr   r   c                @   | g } g }| D ]}g }|D ]l}t          |          }t          |t                    rt          |          }n!t          |t                    rt          di |}|                    |           m|                    |           t          dd|i|S )ag  
    Create a ReplyKeyboardMarkup from a list of lists of buttons.

    Parameters:
        rows (List[List[str]]):
            List of lists of buttons. Defaults to an empty list.

        kwargs:
            Other arguments to pass to ReplyKeyboardMarkup.

    Returns:
        :obj:`~hydrogram.types.ReplyKeyboardMarkup`: A ReplyKeyboardMarkup object.
    Nr    )r   r   r   r   dictr   r   )r	   kwargsr   r   r   r   button_types          r   kbr0   |   s     |E 
 
 	  	 Fv,,K+s++ 2'//K.. 2'11&11KKT888888r   Tr   c                "    t          |           S )z
    Create a ForceReply.

    Parameters:
        selective (bool):
            Whether the reply should be selective. Defaults to True.

    Returns:
        :obj:`~hydrogram.types.ForceReply`: A ForceReply object.
    	selective)r   r2   s    r   force_replyr4      s     	****r   
list[list]c                \      fdt          dt                               D             S )z
    Split an array into chunks.

    Parameters:
        input_array (list):
            The array to split.

        size (int):
            The size of each chunk.

    Returns:
        list: A list of chunks.
    c                *    g | ]}||z            S r,   r,   ).0iinput_arraysizes     r   
<listcomp>zarray_chunk.<locals>.<listcomp>   s&    PPP!KAH%PPPr   r   )rangelen)r:   r;   s   ``r   array_chunkr?      s8     QPPPPuQK8H8H$/O/OPPPPr   )N)r	   r
   r   r   )r   )r   r   r   r   r   r   )r   r   r   r   )r   r   r   r#   )r   r   )T)r   r   )r   r5   )
__future__r   hydrogram.typesr   r   r   r   r   r   r   r"   r!   r0   kbtnr4   r?   r,   r   r   <module>rC      s  ( # " " " " "             7 7 7 7 707 7 7 7 7*   *   69 9 9 9 9@ 
+ + + + +Q Q Q Q Q Qr   