types

package
v3.0.0-...-fed599b Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: GPL-3.0 Imports: 4 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) UserIDs

func (c Channels) UserIDs() []string

UserIDs returns a slice of user IDs.

type Conversation

type Conversation struct {
	// 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"`
	// Name is the channel name.
	Name string `json:"name"`
	// Messages is a slice of messages.
	Messages []Message `json:"messages"`
}

Conversation keeps the slice of messages.

func (Conversation) IsThread

func (c Conversation) IsThread() bool

IsThread returns true if the conversation is a thread.

func (Conversation) String

func (c Conversation) String() string

func (Conversation) UserIDs

func (c Conversation) UserIDs() []string

UserIDs returns a slice of user IDs.

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) UserIDs

func (us Users) UserIDs() []string

UserIDs returns a slice of user IDs.

Jump to

Keyboard shortcuts

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