-
Notifications
You must be signed in to change notification settings - Fork 0
/
keyboard.go
51 lines (44 loc) · 1.82 KB
/
keyboard.go
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
package main
import (
"strconv"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api/v5"
)
var mainMenuKeyboard = tgbotapi.NewInlineKeyboardMarkup(
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("میخوام تست بدم", "quiz"),
),
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("میخوام تلههام رو ببینم", "myLifeTraps"),
),
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("راهنما", "guide"),
),
)
var backToMainMenuKeyboard = tgbotapi.NewInlineKeyboardMarkup(
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("برگشت به منوی اصلی", "backToMainMenu"),
),
)
//This functions creates an inline keyboard based on question.
func scoreButtons(questionID int, categoryID int) tgbotapi.InlineKeyboardMarkup {
qID := strconv.Itoa(questionID)
cid := strconv.Itoa(categoryID)
sbKeyboard := tgbotapi.NewInlineKeyboardMarkup(
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("کاملا نادرسته", "score=1-qid="+qID+"-cid="+cid),
tgbotapi.NewInlineKeyboardButtonData("تقریبا نادرسته", "score=2-qid="+qID+"-cid="+cid),
),
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("بیشتر درسته تا غلط", "score=3-qid="+qID+"-cid="+cid),
tgbotapi.NewInlineKeyboardButtonData("نسبتا درسته", "score=4-qid="+qID+"-cid="+cid),
),
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("تقریبا درسته", "score=5-qid="+qID+"-cid="+cid),
tgbotapi.NewInlineKeyboardButtonData("کاملا درسته", "score=6-qid="+qID+"-cid="+cid),
),
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonData("برگشت به منوی اصلی", "backToMainMenu"),
),
)
return sbKeyboard
}