From f978f4e43f08926a1a23d87880d4a1b2ddcf7fee Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Mon, 6 Apr 2020 11:46:55 -0800 Subject: [PATCH] Update comments for Godoc --- command-manager.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/command-manager.go b/command-manager.go index 814a8cf..d5ca647 100644 --- a/command-manager.go +++ b/command-manager.go @@ -15,7 +15,7 @@ import ( "strings" ) -// Adds the Command at the address passed in to the Commands array on the CommandManager. +// AddCommand adds the Command at the address passed in to the Commands array on the CommandManager. // - Will error if the command's name or any of the aliases already exist. func (c *CommandManager) AddCommand(command *Command) error { var aliases = []string{command.Name} @@ -24,7 +24,7 @@ func (c *CommandManager) AddCommand(command *Command) error { } for _, alias := range aliases { if _, ok := c.Commands[alias]; ok { - return errors.New(fmt.Sprintf("An alias named %v already exists", alias)) + return fmt.Errorf("An alias named %v already exists", alias) } } if len(aliases) > 0 { @@ -48,7 +48,7 @@ func (c *CommandManager) RemoveCommand(name string) error { return nil } -// Checks if the user ID is in the Owners array +// Is the user ID passed in an owner of the bot func (c *CommandManager) IsOwner(id string) bool { for _, o := range c.Owners { if o == id { @@ -58,7 +58,7 @@ func (c *CommandManager) IsOwner(id string) bool { return false } -// The OnMessage event handler +// OnMessage event handler // Checks if the message has one of the specified prefixes // Checks if the message contains one of the commands // Processes the arguments to pass into the command