mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
Allow fallback string for user not found
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
b3defa44fd
commit
f18e9c1612
1 changed files with 5 additions and 1 deletions
|
@ -56,8 +56,12 @@ func init() {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
messageFunctions["recentGame"] = func(username string, _ ...string) (string, error) {
|
messageFunctions["recentGame"] = func(username string, v ...string) (string, error) {
|
||||||
game, _, err := twitch.getRecentStreamInfo(username)
|
game, _, err := twitch.getRecentStreamInfo(username)
|
||||||
|
if err != nil && len(v) > 0 {
|
||||||
|
return v[0], nil
|
||||||
|
}
|
||||||
|
|
||||||
return game, err
|
return game, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue