Update comments for Godoc
This commit is contained in:
parent
47051350b9
commit
f978f4e43f
@ -15,7 +15,7 @@ import (
|
|||||||
"strings"
|
"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.
|
// - Will error if the command's name or any of the aliases already exist.
|
||||||
func (c *CommandManager) AddCommand(command *Command) error {
|
func (c *CommandManager) AddCommand(command *Command) error {
|
||||||
var aliases = []string{command.Name}
|
var aliases = []string{command.Name}
|
||||||
@ -24,7 +24,7 @@ func (c *CommandManager) AddCommand(command *Command) error {
|
|||||||
}
|
}
|
||||||
for _, alias := range aliases {
|
for _, alias := range aliases {
|
||||||
if _, ok := c.Commands[alias]; ok {
|
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 {
|
if len(aliases) > 0 {
|
||||||
@ -48,7 +48,7 @@ func (c *CommandManager) RemoveCommand(name string) error {
|
|||||||
return nil
|
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 {
|
func (c *CommandManager) IsOwner(id string) bool {
|
||||||
for _, o := range c.Owners {
|
for _, o := range c.Owners {
|
||||||
if o == id {
|
if o == id {
|
||||||
@ -58,7 +58,7 @@ func (c *CommandManager) IsOwner(id string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// The OnMessage event handler
|
// OnMessage event handler
|
||||||
// Checks if the message has one of the specified prefixes
|
// Checks if the message has one of the specified prefixes
|
||||||
// Checks if the message contains one of the commands
|
// Checks if the message contains one of the commands
|
||||||
// Processes the arguments to pass into the command
|
// Processes the arguments to pass into the command
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user