-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeyboard.py
More file actions
106 lines (95 loc) · 2.84 KB
/
keyboard.py
File metadata and controls
106 lines (95 loc) · 2.84 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
from aiogram.types import (
InlineKeyboardButton,
InlineKeyboardMarkup,
KeyboardButton,
ReplyKeyboardMarkup,
)
main_menu = ReplyKeyboardMarkup(
keyboard=[
[
KeyboardButton(text="📊 Statistics"),
KeyboardButton(text="📝 Subscriptions"),
KeyboardButton(text="📉 Saved"),
],
[
KeyboardButton(text="🍔 Fast Food"),
KeyboardButton(text="🍎 Groceries"),
KeyboardButton(text="🎉 Nightlife"),
],
[
KeyboardButton(text="🚬 Smoking"),
KeyboardButton(text="👕 Apparel"),
KeyboardButton(text="🖥 Electronics"),
],
[
KeyboardButton(text="💅 Beauty & Care"),
KeyboardButton(text="🚗 Transport"),
KeyboardButton(text="🏠 Housing"),
],
[
KeyboardButton(text="🎁 Gifts"),
KeyboardButton(text="💸 Debts"),
KeyboardButton(text="📦 Miscellaneous"),
],
],
resize_keyboard=True,
input_field_placeholder="Choose an action or category",
)
category_subscriptions_keyboard = InlineKeyboardMarkup(
inline_keyboard=[
[
InlineKeyboardButton(
text="➕ Add Subscription", callback_data="add_subscription"
)
],
[
InlineKeyboardButton(
text="➖ Remove Subscription",
callback_data="disable_subscriptions_list",
)
],
]
)
async def subscriptions_keyboard(
subscriptions_names: list[str], is_active: bool
) -> InlineKeyboardMarkup:
callback = "sub_select:" if is_active else "sub_enable:"
keyboard = InlineKeyboardMarkup(inline_keyboard=[])
row = []
for i, subscriptions_name in enumerate(subscriptions_names, start=1):
row.append(
InlineKeyboardButton(
text=subscriptions_name,
callback_data=f"{callback}{subscriptions_name}",
)
)
if i % 3 == 0:
keyboard.inline_keyboard.append(row)
row = []
if row:
keyboard.inline_keyboard.append(row)
row = []
row.append(
InlineKeyboardButton(text="⬅️ Back", callback_data="back_to:subscriptions")
)
keyboard.inline_keyboard.append(row)
return keyboard
reports_keyboard = InlineKeyboardMarkup(
inline_keyboard=[
[
InlineKeyboardButton(
text="Download monthly report", callback_data="report:month"
)
],
[
InlineKeyboardButton(
text="Download all-time report", callback_data="report:all_time"
),
],
]
)
saving_options = InlineKeyboardMarkup(
inline_keyboard=[
[InlineKeyboardButton(text="➕ Add savings", callback_data="add_saving")]
]
)