macro

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package macro provides functionality for managing templated text responses and actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager is the macro manager.

func New

func New(opts Opts) (*Manager, error)

New initializes a macro manager.

func (*Manager) Create

func (m *Manager) Create(name, messageContent string, userID, teamID *int, visibility string, visibleWhen []string, actions json.RawMessage) (models.Macro, error)

Create adds a new macro.

func (*Manager) Delete

func (m *Manager) Delete(id int) error

Delete deletes a macro by ID.

func (*Manager) Get

func (m *Manager) Get(id int) (models.Macro, error)

Get returns a macro by ID.

func (*Manager) GetAll

func (m *Manager) GetAll() ([]models.Macro, error)

GetAll returns all macros.

func (*Manager) IncrementUsageCount

func (m *Manager) IncrementUsageCount(id int) error

IncrementUsageCount increments the usage count of a macro.

func (*Manager) Update

func (m *Manager) Update(id int, name, messageContent string, userID, teamID *int, visibility string, visibleWhen []string, actions json.RawMessage) (models.Macro, error)

Update modifies an existing macro.

type Opts

type Opts struct {
	DB   *sqlx.DB
	Lo   *logf.Logger
	I18n *i18n.I18n
}

Opts contains the dependencies for the macro manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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