-
Notifications
You must be signed in to change notification settings - Fork 0
/
keyboard-buttons.js
81 lines (80 loc) · 1.99 KB
/
keyboard-buttons.js
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
module.exports = {
chooseDate(service) {
return {
text: '📅 Выбор даты',
callback_data: JSON.stringify({
t: 'date',
s: service
})
}
},
chooseMaster(service) {
return {
text: '✂️ Выбор мастера',
callback_data: JSON.stringify({
t: 'mast',
s: service
})
}
},
back(text, point) {
return {
text: text,
callback_data: point
}
},
chooseService(title, id) {
return {
text: title,
callback_data: JSON.stringify({
t: 'order',
s: id
})
}
},
timeButton(serv, date, time, master) {
// console.log(master)
master = (master === undefined || master === '') ? '' : master;
var out = {
text: time[0] + time[1] + ":" + time[2] + time[3],
callback_data: JSON.stringify({
t: 'ask',
s: serv,
d: date + ' ' + time,
m: master
})
}
if (master !== '') {
out.callback_data.m = master
}
return out
},
toDay(text, serv, date,master) {
master = (master === undefined || master === '') ? '' : master;
var out = {
text: text,
callback_data: JSON.stringify({
t: 'nextDay',
s: serv,
d: date,
m:master
})
}
// if (master !== '') {
// out.callback_data.m = master
// }
// console.log(out)
return out
},
submit(query) {
return {
text: 'Подтвердить ✅',
callback_data: JSON.stringify({
t: 'rec',
s: query.s,
d: query.d,
m: query.m
})
}
}
}