diff --git a/lib/command_message.go b/lib/command_message.go index d6efed8..a17748d 100644 --- a/lib/command_message.go +++ b/lib/command_message.go @@ -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 { diff --git a/lib/command_user.go b/lib/command_user.go index 4b77f4f..52e638c 100644 --- a/lib/command_user.go +++ b/lib/command_user.go @@ -28,16 +28,16 @@ func (c *UserCommand) ApplicationCommand() *discordgo.ApplicationCommand { } } -func (c *UserCommand) Validate() (bool, error) { +func (c *UserCommand) 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 UserCommandCtx struct {