almost done, queue fix next
This commit is contained in:
@@ -5,34 +5,23 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (m *GatewayModMessageIn) Validate() error {
|
||||
func (m *GatewayMessageIn) Validate() error {
|
||||
if strings.TrimSpace(m.ID) == "" {
|
||||
return errors.New("id missing")
|
||||
}
|
||||
if strings.TrimSpace(m.MsgID) == "" {
|
||||
return errors.New("msg_id missing")
|
||||
}
|
||||
if strings.TrimSpace(m.Server) == "" {
|
||||
return errors.New("server missing")
|
||||
}
|
||||
if strings.TrimSpace(m.Author.ID) == "" {
|
||||
return errors.New("author.id missing")
|
||||
}
|
||||
if strings.TrimSpace(m.Content) == "" {
|
||||
return errors.New("content missing")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GatewayBotMessageIn) Validate() error {
|
||||
if strings.TrimSpace(m.MsgID) == "" {
|
||||
return errors.New("msg_id missing")
|
||||
}
|
||||
if strings.TrimSpace(m.ChannelID) == "" {
|
||||
return errors.New("channel_id missing")
|
||||
}
|
||||
if strings.TrimSpace(m.Author.ID) == "" {
|
||||
return errors.New("author missing")
|
||||
}
|
||||
if strings.TrimSpace(m.Content) == "" {
|
||||
return errors.New("content missing")
|
||||
if m.Type == "mod" && strings.TrimSpace(m.Destination.ID) == "" {
|
||||
return errors.New("destination.channel_id missing")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user