-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarkups.go
51 lines (44 loc) · 1.19 KB
/
markups.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 (
"fmt"
tele "gopkg.in/telebot.v3"
"strings"
)
var (
r = &tele.ReplyMarkup{}
// Reply buttons.
btnHelp = r.Text("ℹ Help")
btnContact = r.Contact("⚙ Contact")
btnLocation = r.Location("Location")
btnPollAny = r.Poll("PollAny", tele.PollAny)
btnPollRegular = r.Poll("PollRegular", tele.PollRegular)
btnPollQuiz = r.Poll("PollQuiz", tele.PollQuiz)
// Inline buttons.
iBtnDataBase = r.Data("⬅", "prev", "default_data")
iBtnURL = r.URL("Visit", "https://google.com")
iBtnQuery = r.Query("Search", "query")
iBtnQueryChat = r.QueryChat("Share", "query")
//iBtnLogin = r.Login("Login", &tele.Login{
// URL: "https://google.com",
// Text: "",
// Username: "",
// WriteAccess: true})
simpleMarkup = &tele.ReplyMarkup{}
)
func iBtnData(data ...string) tele.Btn {
btn := iBtnDataBase
btn.Data = strings.Join(data, "|")
return btn
}
func mainMenu(c tele.Context) *tele.ReplyMarkup {
fmt.Println(c) // just to use context for now
markup := *simpleMarkup
markup.Inline(
markup.Row(iBtnData()),
markup.Row(iBtnURL),
markup.Row(iBtnQuery),
markup.Row(iBtnQueryChat),
//markup.Row(iBtnLogin),
)
return &markup
}