~cytrogen/evi-run

ref: 65b2381312073fe4c40221536975cb4d3707a3b2 evi-run/bot/keyboards/inline.py -rw-r--r-- 923 bytes
65b23813 — Bendy chore(gitignore): ignore tests/, pytest artifacts and local pytest.ini 5 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}')]
        ]
    )