fix(lib,commands): update Validate() method

This commit is contained in:
Guz
2024-11-22 19:10:58 -03:00
parent 14fae3941a
commit 4b54589178
2 changed files with 10 additions and 10 deletions

View File

@@ -28,16 +28,16 @@ func (c *MessageCommand) ApplicationCommand() *discordgo.ApplicationCommand {
}
}
func (c *MessageCommand) Validate() (bool, error) {
func (c *MessageCommand) Validate() error {
switch {
case c.Name == "":
return false, errors.New("Required property \"Name\" is empty")
return errors.New("Required property \"Name\" is empty")
case c.Description == "":
return false, errors.New("Required property \"Description\" is empty")
return errors.New("Required property \"Description\" is empty")
case c.Handler == nil:
return false, errors.New("Required property \"Handler\" is empty")
return errors.New("Required property \"Handler\" is empty")
}
return true, nil
return nil
}
type MessageCommandCtx struct {