chatreplica

package
v0.0.0-...-34dde38 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(payload Payload) ([]byte, error)

Types

type Badge

type Badge string
const (
	BadgeBot Badge = "bot"
)

type Channel

type Channel struct {
	Name string `json:"name"`
}

type Entities

type Entities struct {
	Users    map[string]User    `json:"users"`
	Channels map[string]Channel `json:"channels"`
	Roles    map[string]Role    `json:"roles"`
}

Entities Snowflake -> Entity map

func EntitiesFromTranscript

func EntitiesFromTranscript(entities v2.Entities) Entities

type Message

type Message struct {
	Id          uint64                `json:"id,string"`
	Type        message.MessageType   `json:"type"`
	Author      uint64                `json:"author,string"`
	Time        int64                 `json:"time"` // Unix seconds
	Content     string                `json:"content"`
	Embeds      []embed.Embed         `json:"embeds,omitempty"`
	Components  []component.Component `json:"components,omitempty"`
	Attachments []channel.Attachment  `json:"attachments,omitempty"`
}

func MessagesFromTranscript

func MessagesFromTranscript(messages []v2.Message) []Message

type Payload

type Payload struct {
	Entities    Entities  `json:"entities"`
	Messages    []Message `json:"messages"`
	ChannelName string    `json:"channel_name"`
}

func FromArchiveMessages

func FromArchiveMessages(messages []message.Message, ticketId int) Payload

func FromTranscript

func FromTranscript(transcript v2.Transcript, ticketId int) Payload

type Role

type Role struct {
	Name  string `json:"name"`
	Color int    `json:"color"`
}

type User

type User struct {
	Avatar   string `json:"avatar"`
	Username string `json:"username"`
	Badge    *Badge `json:"badge,omitempty"`
}

Jump to

Keyboard shortcuts

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