texpr

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(program *vm.Program, env any) (any, error)

Types

type EnvMessage added in v0.13.0

type EnvMessage struct {
	Mentioned     bool            `comment:"Whether we were mentioned in this message"`
	Silent        bool            `comment:"Whether this is a silent message (no notification triggered)"`
	FromScheduled bool            `comment:"Whether this is a scheduled message"`
	Pinned        bool            `comment:"Whether this message is pinned"`
	ID            int             `comment:"ID of the message"`
	FromID        int64           `comment:"ID of the sender of the message"`
	Date          int             `comment:"Date of the message"`
	Message       string          `comment:"The message"`
	Media         EnvMessageMedia `comment:"Media attachment"`
	Views         int             `comment:"View count"`
	Forwards      int             `comment:"Forward count"`
}

func ConvertEnvMessage added in v0.13.0

func ConvertEnvMessage(msg *tg.Message) EnvMessage

type EnvMessageMedia added in v0.13.0

type EnvMessageMedia struct {
	Name string `comment:"File name"`
	Size int64  `comment:"File size. Unit: Byte"`
	DC   int    `comment:"DC ID"`
}

type Field

type Field struct {
	Path    []string
	Type    reflect.Type
	Comment string
}

type FieldsGetter

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

func NewFieldsGetter

func NewFieldsGetter(opts *Options) *FieldsGetter

func (*FieldsGetter) Sprint

func (f *FieldsGetter) Sprint(fields []*Field, colorable bool) string

func (*FieldsGetter) Walk

func (f *FieldsGetter) Walk(v any) ([]*Field, error)

type Option

type Option func(opts *Options)

type Options

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

Jump to

Keyboard shortcuts

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