Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
c1bdc2fdf6
|
13
keyboard.go
13
keyboard.go
@@ -72,20 +72,27 @@ func (in *InlineKeyboard) append(button InlineKeyboardButton) *InlineKeyboard {
|
||||
in.CurrentLine = in.CurrentLine.Push(button)
|
||||
return in
|
||||
}
|
||||
|
||||
func (in *InlineKeyboard) AddUrlButton(text, url string) *InlineKeyboard {
|
||||
return in.append(InlineKeyboardButton{Text: text, URL: url})
|
||||
}
|
||||
func (in *InlineKeyboard) AddUrlButtonStyle(text string, style KeyboardButtonStyle, url string) *InlineKeyboard {
|
||||
return in.append(InlineKeyboardButton{Text: text, Style: style, URL: url})
|
||||
}
|
||||
func (in *InlineKeyboard) AddCallbackButton(text string, cmd string, args ...any) *InlineKeyboard {
|
||||
return in.append(InlineKeyboardButton{
|
||||
Text: text, CallbackData: NewCallbackData(cmd, args...).ToJson(),
|
||||
})
|
||||
}
|
||||
func (in *InlineKeyboard) AddCallbackButtonStyle(text string, style KeyboardButtonStyle, cmd string, args ...any) *InlineKeyboard {
|
||||
return in.append(InlineKeyboardButton{
|
||||
Text: text, Style: style,
|
||||
CallbackData: NewCallbackData(cmd, args...).ToJson(),
|
||||
})
|
||||
}
|
||||
func (in *InlineKeyboard) AddButton(b InlineKbButtonBuilder) *InlineKeyboard {
|
||||
return in.append(b.build())
|
||||
}
|
||||
func (in *InlineKeyboard) AddCustomButton(button InlineKeyboardButton) *InlineKeyboard {
|
||||
return in.append(button)
|
||||
}
|
||||
|
||||
func (in *InlineKeyboard) AddLine() *InlineKeyboard {
|
||||
if in.CurrentLine.Len() == 0 {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package laniakea
|
||||
|
||||
const (
|
||||
VersionString = "0.4.2"
|
||||
VersionString = "0.4.3"
|
||||
VersionMajor = 0
|
||||
VersionMinor = 4
|
||||
VersionPatch = 2
|
||||
VersionPatch = 3
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user