Skip to content

Commit

Permalink
Add concat template function
Browse files Browse the repository at this point in the history
Signed-off-by: Knut Ahlers <[email protected]>
  • Loading branch information
Luzifer committed Jun 17, 2021
1 parent 56e1387 commit edd8a12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) }))
}
1 change: 1 addition & 0 deletions wiki/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit edd8a12

Please sign in to comment.