Update chatbot/plugins/keyboards.py
Browse files- chatbot/plugins/keyboards.py +27 -26
chatbot/plugins/keyboards.py
CHANGED
@@ -1,33 +1,34 @@
|
|
1 |
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
2 |
from chatbot.plugins.languages import LANGUAGES
|
3 |
|
4 |
-
def get_language_keyboard(
|
5 |
-
"""
|
6 |
-
Generates an InlineKeyboardMarkup for language selection.
|
7 |
-
|
8 |
-
:param buttons_per_row: Number of language buttons per row.
|
9 |
-
:return: InlineKeyboardMarkup object.
|
10 |
-
"""
|
11 |
keyboard = []
|
12 |
-
buttons = []
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
return InlineKeyboardMarkup(keyboard)
|
|
|
1 |
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
2 |
from chatbot.plugins.languages import LANGUAGES
|
3 |
|
4 |
+
def get_language_keyboard():
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
keyboard = []
|
|
|
6 |
|
7 |
+
# Row 1: English, Indonesian
|
8 |
+
keyboard.append([
|
9 |
+
InlineKeyboardButton("English", callback_data="lang_en"),
|
10 |
+
InlineKeyboardButton("Indonesian", callback_data="lang_id")
|
11 |
+
])
|
12 |
+
|
13 |
+
# Row 2: Spanish
|
14 |
+
keyboard.append([
|
15 |
+
InlineKeyboardButton("Spanish", callback_data="lang_es")
|
16 |
+
])
|
17 |
+
|
18 |
+
# Row 3: French, German, Japanese
|
19 |
+
keyboard.append([
|
20 |
+
InlineKeyboardButton("French", callback_data="lang_fr"),
|
21 |
+
InlineKeyboardButton("German", callback_data="lang_de"),
|
22 |
+
InlineKeyboardButton("Japanese", callback_data="lang_jp")
|
23 |
+
])
|
24 |
+
|
25 |
+
keyboard.append([
|
26 |
+
InlineKeyboardButton("Malagasy", callback_data="lang_mg"),
|
27 |
+
InlineKeyboardButton("Russian", callback_data="lang_ru"),
|
28 |
+
InlineKeyboardButton("Hindi", callback_data="lang_hi"),
|
29 |
+
])
|
30 |
+
keyboard.append([
|
31 |
+
InlineKeyboardButton("Cancel", callback_data="cancel")
|
32 |
+
])
|
33 |
|
34 |
return InlineKeyboardMarkup(keyboard)
|