types

package
v2.5.8 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortMessages

func SortMessages(msgs []Message)

Types

type Channels

type Channels []slack.Channel

Channels keeps slice of channels.

func (Channels) ToText

func (cs Channels) ToText(w io.Writer, ui structures.UserIndex) (err error)

ToText outputs Channels to w in text format.

type Conversation

type Conversation struct {
	Name     string    `json:"name"`
	Messages []Message `json:"messages"`
	// ID is the channel ID.
	ID string `json:"channel_id"`
	// ThreadTS is a thread timestamp.  If it's not empty, it means that it's a
	// dump of a thread, not a channel.
	ThreadTS string `json:"thread_ts,omitempty"`
}

Conversation keeps the slice of messages.

func (Conversation) IsThread

func (c Conversation) IsThread() bool

func (Conversation) String

func (c Conversation) String() string

func (Conversation) ToText

func (c Conversation) ToText(w io.Writer, userIdx structures.UserIndex) (err error)

ToText outputs Messages m to io.Writer w in text format.

type Message

type Message struct {
	slack.Message
	ThreadReplies []Message `json:"slackdump_thread_replies,omitempty"`
}

Message is the internal representation of message with thread.

func ConvertMsgs

func ConvertMsgs(sm []slack.Message) []Message

ConvertMsgs converts a slice of slack.Message to []types.Message.

func (Message) Datetime

func (m Message) Datetime() (time.Time, error)

func (Message) IsBotMessage

func (m Message) IsBotMessage() bool

IsBotMessage returns true if the message is from a bot.

func (Message) IsThread

func (m Message) IsThread() bool

func (Message) IsThreadChild

func (m Message) IsThreadChild() bool

IsThreadChild will return true if the message is the child message of a conversation.

func (Message) IsThreadParent

func (m Message) IsThreadParent() bool

IsThreadChild will return true if the message is the parent message of a conversation (has more than 0 replies)

type Users

type Users []slack.User

Users is a slice of users.

func (Users) IndexByID

func (us Users) IndexByID() structures.UserIndex

IndexByID returns the userID map to relevant *slack.User

func (Users) ToText

func (us Users) ToText(w io.Writer, _ structures.UserIndex) error

ToText outputs Users us to io.Writer w in Text format

Jump to

Keyboard shortcuts

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