~cytrogen/evi-run

ref: 2126525f0d329b7dc1d677fa1c5115335e668ad8 evi-run/bot/keyboards/inline.py -rw-r--r-- 923 bytes
2126525f — Bendy Fix undefined name error in config.py 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton

from config import AVAILABLE_LANGUAGES


def select_language(text: list[str]):
    return InlineKeyboardMarkup(
        inline_keyboard=[
            [InlineKeyboardButton(text=i, callback_data=f'select_language_{AVAILABLE_LANGUAGES[index]}') for index, i in enumerate(text)]
    ])


def close_text(text: str):
    return InlineKeyboardMarkup(
        inline_keyboard=[
            [InlineKeyboardButton(text=text, callback_data='close')]
    ])


def keyboard_md(row_id: int, text: str):
    return InlineKeyboardMarkup(
        inline_keyboard=[
            [InlineKeyboardButton(text=text, callback_data=f'markdown_{row_id}')]
    ])


def check_payment(text: str, payment_id: int):
    return InlineKeyboardMarkup(
        inline_keyboard=[
            [InlineKeyboardButton(text=text, callback_data=f'check_payment_{payment_id}')]
        ]
    )