internal

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceSlack messageSource = iota
	SourceBackfill
)

Variables

View Source
var (
	ErrMessageNotFound = errors.New("message not found")
)

Functions

func TimeToTs

func TimeToTs(t time.Time) string

func TsToTime

func TsToTime(ts string) (time.Time, error)

Types

type Bot

type Bot struct {
	DB *pgxpool.Pool
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, db *pgxpool.Pool) (*Bot, error)

func (*Bot) AddMessage

func (b *Bot) AddMessage(ctx context.Context, tx pgx.Tx, params []schema.AddMessageParams, source messageSource) error

func (*Bot) AddThreadMessages

func (b *Bot) AddThreadMessages(ctx context.Context, tx pgx.Tx, params []schema.AddThreadMessageParams) error

func (*Bot) GetMessage

func (b *Bot) GetMessage(
	ctx context.Context,
	channelID string,
	slackTs string,
) (schema.GetMessageRow, error)

func (*Bot) Init

func (b *Bot) Init(riverClient *river.Client[pgx.Tx]) error

func (*Bot) NotifyMessage added in v0.0.6

func (b *Bot) NotifyMessage(ctx context.Context, ev *slackevents.MessageEvent) error

func (*Bot) NotifyReactionAdded added in v0.0.6

func (b *Bot) NotifyReactionAdded(ctx context.Context, ev *slackevents.ReactionAddedEvent) error

func (*Bot) NotifyReactionRemoved added in v0.0.6

func (b *Bot) NotifyReactionRemoved(ctx context.Context, ev *slackevents.ReactionRemovedEvent) error

func (*Bot) UpdateChannel

func (b *Bot) UpdateChannel(ctx context.Context, tx pgx.Tx, params schema.UpdateChannelAttrsParams) error

Directories

Path Synopsis
channel_monitor/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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