refactor(lib,commands,errors): update errors to conform with Go's standatds

This commit is contained in:
Guz
2024-11-22 19:12:35 -03:00
parent 4b54589178
commit 7b8d7322d0
2 changed files with 6 additions and 6 deletions

View File

@@ -31,11 +31,11 @@ func (c *MessageCommand) ApplicationCommand() *discordgo.ApplicationCommand {
func (c *MessageCommand) Validate() error {
switch {
case c.Name == "":
return errors.New("Required property \"Name\" is empty")
return errors.New("required field \"Name\" is empty")
case c.Description == "":
return errors.New("Required property \"Description\" is empty")
return errors.New("required field \"Description\" is empty")
case c.Handler == nil:
return errors.New("Required property \"Handler\" is empty")
return errors.New("required field \"Handler\" is empty")
}
return nil
}

View File

@@ -31,11 +31,11 @@ func (c *UserCommand) ApplicationCommand() *discordgo.ApplicationCommand {
func (c *UserCommand) Validate() error {
switch {
case c.Name == "":
return errors.New("Required property \"Name\" is empty")
return errors.New("required field \"Name\" is empty")
case c.Description == "":
return errors.New("Required property \"Description\" is empty")
return errors.New("required field \"Description\" is empty")
case c.Handler == nil:
return errors.New("Required property \"Handler\" is empty")
return errors.New("required field \"Handler\" is empty")
}
return nil
}