Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConversationYAML ¶
type ConversationYAML struct {
Messages map[int]*MessageYAML `yaml:"messages"` // Messages.
}
ConversationYAML is a YAML model for conversation.
type Message ¶
type Message struct { Side MessageSide // Conversation side. Text string // Message text. }
Message is a message in a conversation.
type MessageChain ¶
type MessageChain struct {
// contains filtered or unexported fields
}
MessageChain is a single conversation.
func (*MessageChain) Read ¶
func (c *MessageChain) Read(messageID int) []Message
Store reads all messages from the conversation.
func (*MessageChain) Store ¶
func (c *MessageChain) Store(msgID int, replyToID *int, side MessageSide, text string) error
Store writes new message into the conversation.
type MessageSide ¶
type MessageSide string
MessageSide is a side of conversation.
const ( Bot MessageSide = "bot" // Bot. User MessageSide = "user" // User. )
type MessageYAML ¶
type MessageYAML struct { ReplyTo *int `yaml:"reply_to,omitempty"` // ID of message (if this one is a reply). Side MessageSide `yaml:"side"` // Conversation side. Text string `yaml:"text"` // Message text. }
MessageYAML is a YAML model for a message.
type RootYAML ¶
type RootYAML struct {
Conversations map[int64]*ConversationYAML `yaml:"conversations"` // Conversations.
}
RootYAML is a YAML model for data root.
Click to show internal directories.
Click to hide internal directories.