internal

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: AGPL-3.0 Imports: 16 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.MessagesV2, error)

func (*Bot) Init

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

func (*Bot) Notify

func (b *Bot) Notify(ctx context.Context, ev *slackevents.MessageEvent) 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