views

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DiscordMsgLimit = 2000 - 150
View Source
const (
	MsgViewHeader = "#darkbot-announcement"
)

Variables

This section is empty.

Functions

func RenderAlertTemplate

func RenderAlertTemplate(ChannelID types.DiscordChannelID, Msg string, api *apis.API, opts ...AlertOpt) types.ViewHeader

func TagContains

func TagContains(name string, tags []types.Tag) bool

Types

type Alert added in v1.17.0

type Alert struct {
	PingMessage types.PingMessage
}

type AlertOpt added in v1.17.0

type AlertOpt func(a *Alert)

func WithAlertOverride added in v1.17.0

func WithAlertOverride(PingMessage string) AlertOpt

type OriginalRenderer

type OriginalRenderer interface {
	GenerateRecords() error
}

type SharedViewTableSplitter

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

func NewSharedViewSplitter

func NewSharedViewSplitter(
	api *apis.API,
	channelID types.DiscordChannelID,
	original_view OriginalRenderer,
	sh_templates ...*ViewTable,
) *SharedViewTableSplitter

func (*SharedViewTableSplitter) DiscoverMessageID

func (t *SharedViewTableSplitter) DiscoverMessageID(content string, msgID types.DiscordMessageID, RequiresRecreate bool)

Time comlexity: Must be called only after Generate()

func (*SharedViewTableSplitter) GetAPI

func (s *SharedViewTableSplitter) GetAPI() *apis.API

func (*SharedViewTableSplitter) MatchMessageID

func (t *SharedViewTableSplitter) MatchMessageID(messageID types.DiscordMessageID) bool

Time Complexity: Must be called only after DiscoverMessageID

func (*SharedViewTableSplitter) RenderView

func (t *SharedViewTableSplitter) RenderView() error

func (*SharedViewTableSplitter) Send

func (t *SharedViewTableSplitter) Send()

type TemplateAlertInput

type TemplateAlertInput struct {
	PingMessage types.PingMessage
	Msg         string
}

type View

type View interface {
	DiscoverMessageID(content string, msgID types.DiscordMessageID, RequiresRecreate bool)
	RenderView() error
	Send()
	MatchMessageID(messageID types.DiscordMessageID) bool
}

type ViewHeader

type ViewHeader string

type ViewTable

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

func NewViewTable

func NewViewTable(msgShared *viewer_msg.MsgShared) *ViewTable

func (*ViewTable) AppendRecord

func (v *ViewTable) AppendRecord(record types.ViewRecord)

func (*ViewTable) GetMsgs

func (v *ViewTable) GetMsgs() []*viewer_msg.Msg

func (*ViewTable) HasRecords

func (v *ViewTable) HasRecords() bool

func (*ViewTable) RecordCount

func (m *ViewTable) RecordCount() int

func (*ViewTable) SetHeader

func (v *ViewTable) SetHeader(header types.ViewHeader)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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