Add concat template function

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-06-17 16:54:50 +02:00
parent 56e138724b
commit edd8a12af1
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
2 changed files with 2 additions and 0 deletions

View file

@ -61,4 +61,5 @@ func init() {
tplFuncs.Register("toLower", genericTemplateFunctionGetter(strings.ToLower))
tplFuncs.Register("toUpper", genericTemplateFunctionGetter(strings.ToUpper))
tplFuncs.Register("followDate", genericTemplateFunctionGetter(twitch.GetFollowDate))
tplFuncs.Register("concat", genericTemplateFunctionGetter(func(delim string, parts ...string) string { return strings.Join(parts, delim) }))
}

View file

@ -144,6 +144,7 @@ Additionally there are some functions available in the templates:
- `arg <idx>` - Takes the message sent to the channel, splits by space and returns the Nth element
- `channelCounter <counter name>` - Wraps the counter name into a channel specific counter name including the channel name
- `concat <delimiter> <...parts>` - Join the given string parts with delimiter
- `counterValue <counter name>` - Returns the current value of the counter which identifier was supplied
- `displayName <username> [fallback]` - Returns the display name the specified user set for themselves
- `fixUsername <username>` - Ensures the username no longer contains the `@` or `#` prefix