Add concat template function
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
56e138724b
commit
edd8a12af1
2 changed files with 2 additions and 0 deletions
|
@ -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) }))
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue