mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2025-03-16 03:35:59 +00:00
Fix: Use fallback on empty display name
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
487bce25d7
commit
7bb9e2869d
1 changed files with 1 additions and 1 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
func init() {
|
||||
tplFuncs.Register("displayName", genericTemplateFunctionGetter(func(username string, v ...string) (string, error) {
|
||||
displayName, err := twitch.GetDisplayNameForUser(strings.TrimLeft(username, "#"))
|
||||
if err != nil && len(v) > 0 {
|
||||
if len(v) > 0 && (err != nil || displayName == "") {
|
||||
return v[0], nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue