core

package
v0.0.0-...-0f7311a Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: GPL-3.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CB_DN_WHOLE           = "dall"
	CB_DN_SINGLE          = "dsingle"
	CB_OK_IMPORT          = "yesimport"
	CB_OK_IMPORT_EMOJI    = "yesimportemoji"
	CB_OK_DN              = "yesd"
	CB_BYE                = "bye"
	CB_MANAGE             = "manage"
	CB_DONE_ADDING        = "done"
	CB_YES                = "yes"
	CB_NO                 = "no"
	CB_DEFAULT_TITLE      = "titledefault"
	CB_EXPORT_WA          = "exportwa"
	CB_ADD_STICKER        = "adds"
	CB_DELETE_STICKER     = "dels"
	CB_DELETE_STICKER_SET = "delss"
	CB_CHANGE_TITLE       = "changetitle"

	ST_WAIT_WEBAPP = "waitWebApp"
	ST_PROCESSING  = "process"

	FID_KAKAO_SHARE_LINK = "AgACAgEAAxkBAAEjezVj3_YXwaQ8DM-107IzlLSaXyG6yAACfKsxG3z7wEadGGF_gJrcnAEAAwIAA3kAAy4E"

	LINK_TG     = "t.me"
	LINK_LINE   = "line.me"
	LINK_KAKAO  = "kakao.com"
	LINK_IMPORT = "IMPORT"
)
View Source
const DB_VER = "2"

Variables

View Source
var BOT_VERSION = "2.4.0-RC4"

Functions

func Init

func Init(conf ConfigTemplate)

func InitWebAppServer

func InitWebAppServer()

func Recover

func Recover(onError ...func(error)) tele.MiddlewareFunc

Recover returns a middleware that recovers a panic happened in the handler.

Types

type ConfigTemplate

type ConfigTemplate struct {
	AdminUid int64
	DataDir  string
	LogLevel string
	// UseDB            bool
	BotToken string
	// WebApp    bool
	WebappUrl           string
	WebappApiListenAddr string
	WebappDataDir       string
	DbAddr              string
	DbUser              string
	DbPass              string
}

type LineStickerQ

type LineStickerQ struct {
	Line_id   string
	Line_link string
	Tg_id     string
	Tg_title  string
	Ae        bool
}

Object for quering database for Line Sticker.

type StickerData

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

General sticker data for internal use.

type StickerDownloadObject

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

type StickerFile

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

Object for ants worker function. wg must be initialized with wg.Add(1)

type StickerMoveObject

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

Object for ants worker function. wg must be initiated with wg.Add(1)

type UserData

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

Unique user data for one user and one session.

func GetUd

func GetUd(uidS string) (*UserData, error)

type UserStickerQ

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

Object for quering database for User Sticker.

type Users

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

Map for users, identified by user id. All temporal user data are stored in this struct.

type WebAppUser

type WebAppUser struct {
	Id            int
	Is_bot        bool
	First_name    string
	Last_name     string
	Username      string
	Language_code string
	Is_premium    bool
	Photo_url     string
}

Telegram API JSON.

Jump to

Keyboard shortcuts

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