mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-14 02:52:42 +00:00
Fix: Display fallback when no category is set
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
7bb9e2869d
commit
ca55834315
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ func init() {
|
||||||
|
|
||||||
tplFuncs.Register("recentGame", genericTemplateFunctionGetter(func(username string, v ...string) (string, error) {
|
tplFuncs.Register("recentGame", genericTemplateFunctionGetter(func(username string, v ...string) (string, error) {
|
||||||
game, _, err := twitch.GetRecentStreamInfo(strings.TrimLeft(username, "#"))
|
game, _, err := twitch.GetRecentStreamInfo(strings.TrimLeft(username, "#"))
|
||||||
if err != nil && len(v) > 0 {
|
if len(v) > 0 && (err != nil || game == "") {
|
||||||
return v[0], nil
|
return v[0], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue