cmd

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exclude

func Exclude(ctx context.Context, e *Event) error

Exclude adds users to ignore list or returns them

func GPT added in v0.7.0

func GPT(ctx context.Context, e *Event) error

GPT generates text using ChatGPT.

func Go

func Go(_ context.Context, e *Event) error

Go returns a list of chat members in random order.

func Include

func Include(ctx context.Context, e *Event) error

Include removes users from ignore list or shows all included ones.

func Link(ctx context.Context, e *Event) error

Link sets a link to call or returns current one.

func NoDays added in v1.2.0

func NoDays(ctx context.Context, e *Event) error
func ResetLink(ctx context.Context, e *Event) error

ResetLink removes link from chat.

func Skip added in v1.1.0

func Skip(ctx context.Context, e *Event) error

Skip adds or removes users from skipped list.

func Start

func Start(ctx context.Context, e *Event) error

Start starts bot.

func Stop

func Stop(ctx context.Context, e *Event) error

Stop stops bot.

func Vacation added in v0.6.0

func Vacation(ctx context.Context, e *Event) error

Vacation adds or removes users from ignored list.

func Version

func Version(_ context.Context, e *Event) error

Version returns bot version.

func YandexGPT added in v1.0.0

func YandexGPT(ctx context.Context, e *Event) error

YandexGPT generates text using Yandex GPT.

Types

type Event

type Event struct {
	Cfg       *config.Config
	ChatEvent *botgolang.Event
	Chat      *db.Chat
	OnlyChat  bool
	Arguments string
	// contains filtered or unexported fields
}

Event is implementation of Connector interface.

func (*Event) ArgsUserIDs

func (e *Event) ArgsUserIDs() map[string]struct{}

ArgsUserIDs returns all UserIDs from arguments.

func (*Event) IsChat

func (e *Event) IsChat() bool

IsChat returns true if event is chat event.

func (*Event) SendMessage

func (e *Event) SendMessage(msg string) error

SendMessage sends message to chat.

func (*Event) SendURLMessage

func (e *Event) SendURLMessage(msg, txt, url string) error

SendURLMessage sends message to chat with URL link.

func (*Event) Unavailable

func (e *Event) Unavailable() bool

Unavailable returns true if event is unavailable.

Jump to

Keyboard shortcuts

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