Documentation ¶
Overview ¶
Package message defines in/out message types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMessage ¶
type InMessage struct { Sender Sender Matches []string // captured strings in the pattern Type Type ChannelID string ChannelName string UserID string UserName string Text string RawMessage interface{} // adapter's raw message data }
InMessage represents an incoming message.
func (*InMessage) MentionName ¶
MentionName returns the name of mentioned user.
func (*InMessage) MentionlessText ¶
MentionlessText returns the text which is trimmed the mention part.
type OutMessage ¶
type OutMessage struct { ChannelID string ChannelName string UserName string IconURL string Text string InReplyTo *InMessage // reply target message TriggeredBy *InMessage // trigger source message }
OutMessage represents an outgoing message.
type Sender ¶
type Sender interface { Send(*OutMessage) error SenderName() string }
Sender is a message sender.
type Type ¶
type Type uint
Type is a message type.
const ( // UnknownMessage means the message is unknown type. UnknownMessage Type = 0 // PublicMessage means the message is a public message. PublicMessage Type = 1 << iota // MentionMessage means the message is a mention and reply message. MentionMessage // DirectMessage means the message is a direct(private) message. DirectMessage )
Click to show internal directories.
Click to hide internal directories.