bot

package
v0.0.0-...-d9e7967 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemplateMessageStart  = "" /* 128-byte string literal not displayed */
	TemplateMessageHelp   = "// FIXME - команда help"
	TemplateMessageLogout = "Вы успешно отключили Spotify"
	TemplateMessageLogin  = "Вы успешно авторизовались через Spotify\n" +
		"для работы бота введите имя бота %s и выбирите трек из списка."
)

Variables

View Source
var NotValidUser = errors.New("user not found in telegram")
View Source
var WarningMessageNotCommand = errors.New("message not command")

Functions

func GetOrCreateUser

func GetOrCreateUser(tgUser *telegram.User, h *handler.Handler) (*model.User, error)

func RandStringBytes

func RandStringBytes(n int) string

TODO move to libs

func Router

func Router(update *telegram.Update, handler *handler.Handler)

Types

type Bot

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

func (*Bot) CallbackQueryHandler

func (b *Bot) CallbackQueryHandler()

func (*Bot) CommandHandler

func (b *Bot) CommandHandler()

func (*Bot) InlineQueryHandler

func (b *Bot) InlineQueryHandler()

TODO refactoring !!!

type Command

type Command struct {
	Name string
	Args []string
}

type CommandContext

type CommandContext struct {
	DB *mongo.Database
	// contains filtered or unexported fields
}

func (*CommandContext) Help

func (c *CommandContext) Help()

func (*CommandContext) StartCommand

func (c *CommandContext) StartCommand()

type FakeUser

type FakeUser struct {
	Uuid         string
	TelegramId   int64
	Token        string
	RefreshToken string

	Active bool
	Block  bool
}

Jump to

Keyboard shortcuts

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