mpp-client-go/mpp/message.go

43 lines
767 B
Go
Executable File

package mpp
import "encoding/json"
type MppMessage struct {
Type string `json:"m"`
}
type MppTimeMessage struct {
MppMessage
Timestamp json.Number `json:"t"`
}
type HiMppMessage struct {
MppTimeMessage
User MppUser `json:"u"`
Motd string `json:"motd"`
}
type NoteQuotaMppMessage struct {
MppMessage
Allowance json.Number `json:"allowance"`
Max json.Number `json:"max"`
MaxHistLen json.Number `json:"maxHistLen"`
}
type ChatMppMessage struct {
MppTimeMessage
Message string `json:"a"`
Part MppParticipant `json:"p"`
}
type TimeMppMessage struct {
MppTimeMessage
Echo json.Number `json:"e"`
}
type ChannelMppMessage struct {
MppMessage
Channel MppChannel `json:"ch"`
Participants []MppParticipant `json:"ppl"`
}