keyboards

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NormalType   = ButtonType("text")
	LinkType     = ButtonType("open_link")
	CallbackType = ButtonType("callback")
)
View Source
const (
	GreenColor = Color("positive")
	BlueColor  = Color("primary")
	RedColor   = Color("negative")
	WhiteColor = Color("secondary")

	PositiveColor  = Color("positive")
	PrimaryColor   = Color("primary")
	NegativeColor  = Color("negative")
	SecondaryColor = Color("secondary")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button interface {
	GetType() ButtonType
	GetRow() int
	GetColumn() int
	GetPayload() Payload
	GetText() string
	GetLink() requests.URL
	GetColor() Color
}

type ButtonType

type ButtonType string

type CallbackButton

type CallbackButton struct {
	Row     int
	Column  int
	Text    string
	Payload Payload
}

func (CallbackButton) GetColor added in v1.1.0

func (button CallbackButton) GetColor() Color

func (CallbackButton) GetColumn added in v1.1.0

func (button CallbackButton) GetColumn() int
func (button CallbackButton) GetLink() requests.URL

func (CallbackButton) GetPayload added in v1.1.0

func (button CallbackButton) GetPayload() Payload

func (CallbackButton) GetRow added in v1.1.0

func (button CallbackButton) GetRow() int

func (CallbackButton) GetText added in v1.1.0

func (button CallbackButton) GetText() string

func (CallbackButton) GetType added in v1.1.0

func (button CallbackButton) GetType() ButtonType

type Color

type Color string

type InlineKeyboard

type InlineKeyboard struct {
	// contains filtered or unexported fields
}

func (*InlineKeyboard) AddButton

func (keyboard *InlineKeyboard) AddButton(button Button) *InlineKeyboard

func (*InlineKeyboard) GetJson

func (keyboard *InlineKeyboard) GetJson() json.Json

func (*InlineKeyboard) Init

func (keyboard *InlineKeyboard) Init()

type Keyboard

type Keyboard interface {
	Init()

	GetJson() json.Json
	// contains filtered or unexported methods
}

type LinkButton

type LinkButton struct {
	Row    int
	Column int
	Text   string
	Link   requests.URL
}

func (LinkButton) GetColor added in v1.1.0

func (button LinkButton) GetColor() Color

func (LinkButton) GetColumn added in v1.1.0

func (button LinkButton) GetColumn() int
func (button LinkButton) GetLink() requests.URL

func (LinkButton) GetPayload added in v1.1.0

func (button LinkButton) GetPayload() Payload

func (LinkButton) GetRow added in v1.1.0

func (button LinkButton) GetRow() int

func (LinkButton) GetText added in v1.1.0

func (button LinkButton) GetText() string

func (LinkButton) GetType added in v1.1.0

func (button LinkButton) GetType() ButtonType

type NormalButton

type NormalButton struct {
	Row     int
	Column  int
	Text    string
	Payload Payload
	Color   Color
}

func (NormalButton) GetColor added in v1.1.0

func (button NormalButton) GetColor() Color

func (NormalButton) GetColumn added in v1.1.0

func (button NormalButton) GetColumn() int
func (button NormalButton) GetLink() requests.URL

func (NormalButton) GetPayload added in v1.1.0

func (button NormalButton) GetPayload() Payload

func (NormalButton) GetRow added in v1.1.0

func (button NormalButton) GetRow() int

func (NormalButton) GetText added in v1.1.0

func (button NormalButton) GetText() string

func (NormalButton) GetType added in v1.1.0

func (button NormalButton) GetType() ButtonType

type OneTimeKeyboard

type OneTimeKeyboard struct {
	// contains filtered or unexported fields
}

func (*OneTimeKeyboard) AddButton

func (keyboard *OneTimeKeyboard) AddButton(button Button) *OneTimeKeyboard

func (*OneTimeKeyboard) GetJson

func (keyboard *OneTimeKeyboard) GetJson() json.Json

func (*OneTimeKeyboard) Init

func (keyboard *OneTimeKeyboard) Init()

type Payload

type Payload map[string]any

func (Payload) Sign added in v1.1.0

func (payload Payload) Sign() json.Json

func (Payload) Verify

func (payload Payload) Verify() bool

type RemoveKeyboard

type RemoveKeyboard struct {
	// contains filtered or unexported fields
}

func (*RemoveKeyboard) GetJson

func (keyboard *RemoveKeyboard) GetJson() json.Json

func (*RemoveKeyboard) Init

func (keyboard *RemoveKeyboard) Init()

type StaticKeyboard

type StaticKeyboard struct {
	// contains filtered or unexported fields
}

func (*StaticKeyboard) AddButton

func (keyboard *StaticKeyboard) AddButton(button Button) *StaticKeyboard

func (*StaticKeyboard) GetJson

func (keyboard *StaticKeyboard) GetJson() json.Json

func (*StaticKeyboard) Init

func (keyboard *StaticKeyboard) Init()

Jump to

Keyboard shortcuts

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