discordtext

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package discordtext bridges Discord guild text messages into rocketclaw.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

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

Connector bridges Discord text events into the shared rocketclaw bus.

func New

func New(cfg config.DiscordTextConfig, bus *events.Bus, threadAgents config.ThreadAgents, threadRouter ThreadRouter, oneOffCronjobs oneOffCronjobRunner, logger *slog.Logger) *Connector

New constructs a Discord text connector.

func (*Connector) SendCronjobChannelThread

func (c *Connector) SendCronjobChannelThread(_ context.Context, channelID, relativePath, agent, ranAt, text string, attachments []events.OutboundAttachment) error

SendCronjobChannelThread posts one scheduled cronjob result in a new Discord thread.

func (*Connector) SendRelay

func (c *Connector) SendRelay(_ context.Context, text string, attachments []events.OutboundAttachment) (*events.DiscordReplyTarget, error)

SendRelay mirrors a non-Discord input into the configured Discord text channel.

func (*Connector) SendResponse

func (c *Connector) SendResponse(ctx context.Context, msg *events.OutboundMessage) error

SendResponse posts a streamed response message in Discord.

func (*Connector) Start

func (c *Connector) Start(ctx context.Context) error

Start connects to Discord and begins consuming text events.

func (*Connector) Stop

func (c *Connector) Stop(context.Context) error

Stop disconnects the connector from Discord.

type ThreadRouter

type ThreadRouter interface {
	StartDiscordThread(context.Context, string, bool, *events.InboundMessage) error
	PrepareDiscordThreadReply(context.Context, string) (bool, error)
	PrepareDiscordResponseThreadReply(context.Context, string, string) (bool, error)
	SubmitDiscordThreadReply(context.Context, string, *events.InboundMessage) (bool, error)
	SubmitDiscordResponseThreadReply(context.Context, string, string, string, *events.InboundMessage) (bool, error)
	SummarizeDiscordThread(context.Context, string) (bool, error)
	RecordDiscordResponseCheckpoint(context.Context, string, string, events.ResponseCheckpoint) error
}

ThreadRouter routes Discord thread messages directly to app-owned thread bridges.

Jump to

Keyboard shortcuts

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