улучшение ui
This commit is contained in:
@@ -12,33 +12,6 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func Button(text, data string) echotron.InlineKeyboardButton {
|
||||
return echotron.InlineKeyboardButton{
|
||||
Text: text,
|
||||
CallbackData: data,
|
||||
}
|
||||
}
|
||||
|
||||
func URLButton(text, url string) echotron.InlineKeyboardButton {
|
||||
return echotron.InlineKeyboardButton{
|
||||
Text: text,
|
||||
URL: url,
|
||||
}
|
||||
}
|
||||
|
||||
func Row(buttons ...echotron.InlineKeyboardButton) []echotron.InlineKeyboardButton { return buttons }
|
||||
|
||||
func Keyboard(rows ...[]echotron.InlineKeyboardButton) echotron.InlineKeyboardMarkup {
|
||||
if len(rows) == 0 {
|
||||
return echotron.InlineKeyboardMarkup{
|
||||
InlineKeyboard: [][]echotron.InlineKeyboardButton{},
|
||||
}
|
||||
}
|
||||
return echotron.InlineKeyboardMarkup{
|
||||
InlineKeyboard: rows,
|
||||
}
|
||||
}
|
||||
|
||||
type Exec struct {
|
||||
handled bool
|
||||
transitioned bool
|
||||
@@ -363,7 +336,10 @@ func (b *Bot) Update(u *echotron.Update) {
|
||||
}
|
||||
|
||||
func (b *Bot) cleanupKeyboard(messageID int) {
|
||||
emptyKeyboard := Keyboard()
|
||||
emptyKeyboard := echotron.InlineKeyboardMarkup{
|
||||
InlineKeyboard: [][]echotron.InlineKeyboardButton{},
|
||||
}
|
||||
|
||||
_, err := b.EditMessageReplyMarkup(
|
||||
echotron.NewMessageID(b.ChatID, messageID),
|
||||
&echotron.MessageReplyMarkupOptions{ReplyMarkup: emptyKeyboard},
|
||||
|
||||
Reference in New Issue
Block a user