mirror of
https://github.com/Luzifer/discord-community.git
synced 2024-12-20 10:21:22 +00:00
Fix: Allow locale time in templating
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
4f63bf2d19
commit
5c305cd887
1 changed files with 4 additions and 1 deletions
|
@ -212,8 +212,11 @@ func (m modStreamSchedule) assembleEmbed(data *twitchStreamSchedule) *discordgo.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m modStreamSchedule) executeContentTemplate(data *twitchStreamSchedule) (string, error) {
|
func (m modStreamSchedule) executeContentTemplate(data *twitchStreamSchedule) (string, error) {
|
||||||
|
fns := sprig.FuncMap()
|
||||||
|
fns["localeStrftime"] = localeStrftime
|
||||||
|
|
||||||
tpl, err := template.New("streamschedule").
|
tpl, err := template.New("streamschedule").
|
||||||
Funcs(sprig.FuncMap()).
|
Funcs(fns).
|
||||||
Parse(m.attrs.MustString("content", ptrStringEmpty))
|
Parse(m.attrs.MustString("content", ptrStringEmpty))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.Wrap(err, "parsing template")
|
return "", errors.Wrap(err, "parsing template")
|
||||||
|
|
Loading…
Reference in a new issue