response

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// for close
	InlineBtnCloseUniq = "close"
	InlineBtnCloseText = "× Close"

	// for back
	InlineBtnBackUniq = "back"
	InlineBtnBackText = "‹ Back"
)
View Source
const (
	PhotoDirPath = "./static/tg/"
)

Variables

View Source
var (
	ErrFileIdNotFound = errors.New("file id not found")
)

Errors

Functions

func SendError

func SendError(c telebot.Context, err error) error

Send error by telebot context and error.

func SendOrEdit

func SendOrEdit(c telebot.Context, t string, opts ...*Options) error

Send or edit message, supported text, image and other. If message maybe editable (callback) it make edit message, other will be deleted sended message and send new message response

Types

type InlineButton

type InlineButton struct {
	telebot.InlineButton
}

func NewBackInlineButton

func NewBackInlineButton(c telebot.Context) *InlineButton

Create new back inline button.

func NewCloseInlineButton

func NewCloseInlineButton(c telebot.Context) *InlineButton

Create new close inline button.

func NewInlineButton

func NewInlineButton() *InlineButton

Create new inline button.

func NewNavInlineButton

func NewNavInlineButton(c telebot.Context) *InlineButton

Create default navigation inline button.

func (*InlineButton) Extract

func (ib *InlineButton) Extract() telebot.InlineButton

Extract inline button

func (*InlineButton) SetData

func (ib *InlineButton) SetData(data string) *InlineButton

Set data of inline button.

func (*InlineButton) SetText

func (ib *InlineButton) SetText(text string) *InlineButton

Set text of inline button.

func (*InlineButton) SetUnique

func (ib *InlineButton) SetUnique(unique string) *InlineButton

Set unique of inline button.

type Options

type Options struct {
	SendOptions       *telebot.SendOptions
	EnableCloseButton bool
	DisableDeleteMsg  bool
	DisableNavButton  bool
	AttachPhoto       string
}

Jump to

Keyboard shortcuts

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