register_bot

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Token string
	// contains filtered or unexported fields
}

func NewBot

func NewBot(gWorkers int, token string, onRegisterUser func(username string) bool) (*Bot, error)

func (*Bot) AllowUser

func (b *Bot) AllowUser(username string)

func (*Bot) BasicAuth

func (b *Bot) BasicAuth(command string)

func (*Bot) PrintRegisteredCommands

func (b *Bot) PrintRegisteredCommands()

func (*Bot) RegisterButton

func (b *Bot) RegisterButton(buttonText string, command string, handler ...func() string)

func (*Bot) RegisterButtonImageBytesCommand

func (b *Bot) RegisterButtonImageBytesCommand(buttonText string, command string, handler ...func() []byte)

func (*Bot) RegisterButtonImagePathCommand

func (b *Bot) RegisterButtonImagePathCommand(buttonText string, command string, handler ...func() string)

func (*Bot) RegisterImageBytesCommand

func (b *Bot) RegisterImageBytesCommand(command string, imageHandlers ...func() []byte)

Регистрация команды для обработки изображения в виде байтов

func (*Bot) RegisterImagePathCommand

func (b *Bot) RegisterImagePathCommand(command string, imageHandlers ...func() string)

Регистрация команды для обработки изображения по пути файла

func (*Bot) RegisterRegisterCommand

func (b *Bot) RegisterRegisterCommand(command string)

func (*Bot) RegisterTextCommand

func (b *Bot) RegisterTextCommand(command string, textHandlers ...func() string)

func (*Bot) SendImage

func (b *Bot) SendImage(chatID int64, imageFilePath string, caption string) error

func (*Bot) SendImageFromBytes

func (b *Bot) SendImageFromBytes(chatID int64, imageData []byte, caption string) error

func (*Bot) SetPrivateCommand

func (b *Bot) SetPrivateCommand(command string)

func (*Bot) Start

func (b *Bot) Start()

type CommandHandlers

type CommandHandlers struct {
	TextHandlers []func() string
	ImagePath    []func() string // Для путей к изображениям
	ImageBytes   []func() []byte // Для байтов изображений
}

Jump to

Keyboard shortcuts

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