utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TelegramClient *telegram.Client

	BotFatherId int64 = 93372553
)
View Source
var CurrentUpdate = &Update{}
View Source
var TOKEN_REGEXP = regexp.MustCompile(`(\d+:[a-zA-Z0-9_\-]+)`)

Functions

func CompareVersion

func CompareVersion(version string) bool

CompareVersion returns true if input version is greater than current one.

func DoUpdate

func DoUpdate(version string, chatId int64, msgId int) error

func DownloadFile added in v0.0.3

func DownloadFile(file, url string) error

func ExtractUser

func ExtractUser(ctx *ext.Context, msg *tg.Message, chat types.EffectiveChat) (target int64, err error)

func GetBotToken

func GetBotToken(l *logger.Logger) func(ctx *ext.Context, u *ext.Update) error

func GetSupportedARCH added in v0.0.3

func GetSupportedARCH() (string, error)

func GetSupportedOS added in v0.0.3

func GetSupportedOS() (string, error)

func InitUpdate

func InitUpdate(l *logger.Logger)

func Restart

func Restart(delay int, chatId int64, msgId int, msgText string) error

func StartupAutomations

func StartupAutomations(l *logger.Logger, ctx *ext.Context, client *telegram.Client)

StartupAutomations includes the stuff to be done on each startup

Types

type Update

type Update struct {
	Version string
	Changes []string
}

func CheckChanges

func CheckChanges() (*Update, bool)

Jump to

Keyboard shortcuts

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