msg

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	MessageRef
	Text string `json:"text,omitempty"`
}

Message is a wrapper which holds all important fields from slack.MessageEvent

func FromSlackEvent

func FromSlackEvent(event *slack.MessageEvent) Message

func (*Message) GetMessageRef

func (msg *Message) GetMessageRef() slack.ItemRef

GetMessageRef create a msg.ItemRef, an unique identifier to a message

func (Message) GetText

func (msg Message) GetText() string

type MessageRef

type MessageRef struct {
	Channel         string `json:"channel,omitempty"`
	User            string `json:"user,omitempty"`
	Timestamp       string `json:"ts,omitempty"`
	Thread          string `json:"thread_ts,omitempty"`
	InternalMessage bool
}

MessageRef is holds meta information for an message, like author, creation date or channel

func (MessageRef) GetChannel

func (msg MessageRef) GetChannel() string

func (MessageRef) GetThread

func (msg MessageRef) GetThread() string

func (MessageRef) GetTime

func (msg MessageRef) GetTime() time.Time

func (MessageRef) GetTimestamp

func (msg MessageRef) GetTimestamp() string

func (MessageRef) GetUniqueKey

func (msg MessageRef) GetUniqueKey() string

func (MessageRef) GetUser

func (msg MessageRef) GetUser() string

func (MessageRef) IsInternalMessage

func (msg MessageRef) IsInternalMessage() bool

func (MessageRef) WithText

func (msg MessageRef) WithText(text string) Message

attach a text to a message

type Ref

type Ref interface {
	GetChannel() string
	GetUser() string
	GetTimestamp() string
	GetThread() string
	IsInternalMessage() bool
	WithText(text string) Message

	GetUniqueKey() string
}

Jump to

Keyboard shortcuts

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