keyboard

package
v0.0.0-...-a1d4fde Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	Text        string                  // text shown on the button
	Description string                  // description of the button function
	Button      tgbotapi.KeyboardButton // button itself
}

Button represents a button on a keyboard.

func NewButton

func NewButton(text, description string) Button

type ButtonRow

type ButtonRow struct {
	Keyboard []Button
}

ButtonRow represents a row of buttons on a keyboard.

func NewButtonRow

func NewButtonRow(buttons ...Button) ButtonRow

func (*ButtonRow) GetButton

func (k *ButtonRow) GetButton(index int) Button

func (*ButtonRow) NewButton

func (k *ButtonRow) NewButton(button Button) *ButtonRow

type InlineButton

type InlineButton struct {
	Action      interface{}
	Button      tgbotapi.InlineKeyboardButton
	Description string
	Text        string
}

InlineButton represents a button on a inline keyboard.

func NewInlineButton

func NewInlineButton(text, description string, url ...string) InlineButton

NewInlineButton returns a new InlineButton.

type InlineButtonRow

type InlineButtonRow struct {
	InlineKeyboard []InlineButton
}

InlineButtonRow represents a row of buttons on a inline keyboard.

func NewInlineButtonRow

func NewInlineButtonRow(inlineButtons ...InlineButton) InlineButtonRow

NewInlineButtonRow returns a new InlineButtonRow.

func (*InlineButtonRow) GetInlineButton

func (k *InlineButtonRow) GetInlineButton(index int) InlineButton

GetInlineButton adds a new InlineButtonRow.

func (*InlineButtonRow) NewInlineButton

func (k *InlineButtonRow) NewInlineButton(inlineButton InlineButton) *InlineButtonRow

NewInlineButton returns a new InlineButton.

type InlineKeyboard

type InlineKeyboard struct {
	InlineButtonRows []InlineButtonRow
}

InlineKeyboard represents a custom inline keyboard with reply options.

func NewInlineKeyboard

func NewInlineKeyboard(inlineButtonRows ...InlineButtonRow) *InlineKeyboard

NewInlineKeyboard returns a new InlineKeyboard.

func (*InlineKeyboard) GetInlineKeyboard

func (k *InlineKeyboard) GetInlineKeyboard() tgbotapi.InlineKeyboardMarkup

GetInlineKeyboard adds a new InlineButtonRow.

func (*InlineKeyboard) NewInlineButton

func (k *InlineKeyboard) NewInlineButton(inlineButton InlineButton) *InlineKeyboard

NewInlineButton returns a new InlineButton.

func (*InlineKeyboard) NewInlineButtonRow

func (k *InlineKeyboard) NewInlineButtonRow(inlineButtons ...InlineButton) *InlineKeyboard

NewInlineButtonRow returns a new InlineButton with switch inline query.

type Keyboard

type Keyboard struct {
	ButtonRows []ButtonRow
}

Keyboard represents a custom keyboard with reply options.

func NewKeyboard

func NewKeyboard(buttonRows ...ButtonRow) *Keyboard

func (*Keyboard) AddButton

func (k *Keyboard) AddButton(button Button)

func (*Keyboard) AddButtonRow

func (k *Keyboard) AddButtonRow(buttonRow ButtonRow)

func (*Keyboard) AddButtonToLastRow

func (k *Keyboard) AddButtonToLastRow(button Button)

func (*Keyboard) AddButtonToRow

func (k *Keyboard) AddButtonToRow(button Button, row int)

func (*Keyboard) GetButtonRow

func (k *Keyboard) GetButtonRow(row int) ButtonRow

func (*Keyboard) GetKeyboard

func (k *Keyboard) GetKeyboard() interface{}

func (*Keyboard) NewButton

func (k *Keyboard) NewButton(button Button) *Keyboard

func (*Keyboard) NewButtonRow

func (k *Keyboard) NewButtonRow() *ButtonRow

Jump to

Keyboard shortcuts

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