botkb

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button interface {
	GetText() string
	ButtonType() ButtonType
}

type ButtonType

type ButtonType int
const (
	ButtonTypeText ButtonType = iota
	ButtonTypeData
	ButtonTypeURL
	ButtonTypeSwitchInlineQuery
	ButtonTypeSwitchInlineQueryCurrentChat
)

type DataButton

type DataButton struct {
	Text string `json:"text"`
	Data string `json:"data"`
}

func NewDataButton added in v0.2.1

func NewDataButton(text, data string) *DataButton

func (DataButton) ButtonType

func (DataButton) ButtonType() ButtonType

func (DataButton) GetText added in v0.2.0

func (b DataButton) GetText() string

type Keyboard

type Keyboard interface {
	// KeyboardType defines MessageKeyboard type
	KeyboardType() KeyboardType
}

Keyboard defines MessageKeyboard

type KeyboardType

type KeyboardType int

KeyboardType defines MessageKeyboard type

const (
	// KeyboardTypeNone for no MessageKeyboard
	// Used by: Telegram
	KeyboardTypeNone KeyboardType = iota

	// KeyboardTypeHide commands to hide MessageKeyboard
	// Used by: Telegram
	KeyboardTypeHide

	// KeyboardTypeInline for inline MessageKeyboard
	// Used by: Telegram
	KeyboardTypeInline

	// KeyboardTypeBottom for bottom MessageKeyboard
	// Used by: Telegram
	KeyboardTypeBottom

	// KeyboardTypeForceReply to force reply from a user
	// Used by: Telegram
	KeyboardTypeForceReply
)

type MessageKeyboard

type MessageKeyboard struct {
	Buttons [][]Button
	// contains filtered or unexported fields
}

func NewMessageKeyboard

func NewMessageKeyboard(kbType KeyboardType, buttons ...[]Button) *MessageKeyboard

func NewOnetimeKeyboard added in v0.2.3

func NewOnetimeKeyboard(buttons ...[]Button) *MessageKeyboard

func (MessageKeyboard) IsOneTime added in v0.2.3

func (k MessageKeyboard) IsOneTime() bool

func (MessageKeyboard) KeyboardType

func (k MessageKeyboard) KeyboardType() KeyboardType

type SwitchInlineQueryButton added in v0.2.0

type SwitchInlineQueryButton struct {
	Text  string `json:"text"`
	Query string `json:"query"`
}

func NewSwitchInlineQueryButton added in v0.2.1

func NewSwitchInlineQueryButton(text, query string) *SwitchInlineQueryButton

func (SwitchInlineQueryButton) ButtonType added in v0.2.0

func (SwitchInlineQueryButton) ButtonType() ButtonType

func (SwitchInlineQueryButton) GetText added in v0.2.0

func (b SwitchInlineQueryButton) GetText() string

type SwitchInlineQueryCurrentChatButton added in v0.2.0

type SwitchInlineQueryCurrentChatButton struct {
	Text  string `json:"text"`
	Query string `json:"query"`
}

func NewSwitchInlineQueryCurrentChatButton added in v0.2.1

func NewSwitchInlineQueryCurrentChatButton(text, query string) *SwitchInlineQueryCurrentChatButton

func (SwitchInlineQueryCurrentChatButton) ButtonType added in v0.2.0

func (SwitchInlineQueryCurrentChatButton) GetText added in v0.2.0

type TextButton added in v0.2.2

type TextButton struct {
	Text string `json:"text"`
}

func NewTextButton added in v0.2.2

func NewTextButton(text string) *TextButton

func (TextButton) ButtonType added in v0.2.2

func (t TextButton) ButtonType() ButtonType

func (TextButton) GetText added in v0.2.2

func (t TextButton) GetText() string

type UrlButton

type UrlButton struct {
	Text string `json:"text"`
	URL  string `json:"url"`
}

func NewUrlButton added in v0.2.1

func NewUrlButton(text, url string) *UrlButton

func (UrlButton) ButtonType

func (UrlButton) ButtonType() ButtonType

func (UrlButton) GetText added in v0.2.0

func (b UrlButton) GetText() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL