Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
83dca1ab39
|
10
keyboard.go
10
keyboard.go
@@ -7,10 +7,16 @@ import (
|
||||
"git.nix13.pw/scuroneko/extypes"
|
||||
)
|
||||
|
||||
const (
|
||||
ButtonStyleDanger KeyboardButtonStyle = "danger"
|
||||
ButtonStyleSuccess KeyboardButtonStyle = "success"
|
||||
ButtonStylePrimary KeyboardButtonStyle = "primary"
|
||||
)
|
||||
|
||||
type InlineKbButtonBuilder struct {
|
||||
text string
|
||||
iconCustomEmojiID string
|
||||
style InlineKeyboardButtonStyle
|
||||
style KeyboardButtonStyle
|
||||
url string
|
||||
callbackData string
|
||||
}
|
||||
@@ -22,7 +28,7 @@ func (b InlineKbButtonBuilder) SetIconCustomEmojiId(id string) InlineKbButtonBui
|
||||
b.iconCustomEmojiID = id
|
||||
return b
|
||||
}
|
||||
func (b InlineKbButtonBuilder) SetStyle(style InlineKeyboardButtonStyle) InlineKbButtonBuilder {
|
||||
func (b InlineKbButtonBuilder) SetStyle(style KeyboardButtonStyle) InlineKbButtonBuilder {
|
||||
b.style = style
|
||||
return b
|
||||
}
|
||||
|
||||
4
types.go
4
types.go
@@ -128,12 +128,12 @@ type InlineKeyboardMarkup struct {
|
||||
InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard,omitempty"`
|
||||
}
|
||||
|
||||
type InlineKeyboardButtonStyle string
|
||||
type KeyboardButtonStyle string
|
||||
type InlineKeyboardButton struct {
|
||||
Text string `json:"text"`
|
||||
URL string `json:"url,omitempty"`
|
||||
CallbackData string `json:"callback_data,omitempty"`
|
||||
Style InlineKeyboardButtonStyle `json:"style,omitempty"`
|
||||
Style KeyboardButtonStyle `json:"style,omitempty"`
|
||||
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user