A modular Twitch bot made in Go
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package twitchbot
|
|
|
|
import "strings"
|
|
|
|
func (c *Command) Build() string {
|
|
builder := strings.Builder{}
|
|
if c.Prefix != "" {
|
|
builder.WriteString(":" + c.Prefix + " ")
|
|
}
|
|
builder.WriteString(c.Command)
|
|
for _, arg := range c.Args {
|
|
if arg != "" {
|
|
builder.WriteString(" " + arg)
|
|
}
|
|
}
|
|
if c.Suffix != "" {
|
|
builder.WriteString(" :" + c.Suffix)
|
|
}
|
|
return builder.String()
|
|
}
|