Documentation
¶
Index ¶
- func Boldtext(colorable string) string
- func GetCommandArguments(msg string, prefix string) ([]string, error)
- func GetCommandName(msg string, prefix string) (string, error)
- func GetRandomArrayElement(array []string) (string, error)
- func Greentext(colorable string) string
- func IsChannelName(s string) bool
- func IsCommand(msg string, prefix string) bool
- func Normaltext(colorable string) string
- func Returntonormal(colorable string) string
- func SelectReplyTarget(e *irc.Event) string
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCommandArguments ¶
GetCommandArguments extracts the command arguments from the command string.
Example ¶
args, err := GetCommandArguments(".interesting_command arg1 arg2", ".") if err != nil { log.Fatal(err) } fmt.Println(args)
Output: [arg1 arg2]
func GetCommandName ¶
GetCommandName extracts the command name from the command string.
Example ¶
name, err := GetCommandName(".interesting_command arg1 arg2", ".") if err != nil { log.Fatal(err) } fmt.Println(name)
Output: interesting_command
func GetRandomArrayElement ¶
GetRandomArrayElement selects a random element from the array. If the array is empty an error is returned.
func IsChannelName ¶
IsChannelName returns true if s is a channel name.
func Normaltext ¶
func Returntonormal ¶
func SelectReplyTarget ¶
func SelectReplyTarget(e *irc.Event) string
SelectReplyTarget returns the channel name if the message which triggered this event was sent in a channel or the sender's nickname if the message was sent directly to the bot.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.