owncast/models/chatMessage.go

22 lines
541 B
Go
Raw Normal View History

package models
2020-05-24 03:57:49 +03:00
2020-07-12 05:08:47 +03:00
import "time"
//ChatMessage represents a single chat message
type ChatMessage struct {
ClientID string `json:"-"`
2020-07-12 05:08:47 +03:00
Author string `json:"author"`
Body string `json:"body"`
Image string `json:"image"`
ID string `json:"id"`
MessageType string `json:"type"`
2020-07-13 00:53:33 +03:00
Visible bool `json:"visible"`
2020-07-12 05:08:47 +03:00
Timestamp time.Time `json:"timestamp"`
2020-05-24 03:57:49 +03:00
}
//Valid checks to ensure the message is valid
func (s ChatMessage) Valid() bool {
return s.Author != "" && s.Body != "" && s.ID != ""
}