Allow fallback string for user not found

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2020-12-24 13:30:42 +01:00
parent b3defa44fd
commit f18e9c1612
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

View file

@ -56,8 +56,12 @@ func init() {
return s
}
messageFunctions["recentGame"] = func(username string, _ ...string) (string, error) {
messageFunctions["recentGame"] = func(username string, v ...string) (string, error) {
game, _, err := twitch.getRecentStreamInfo(username)
if err != nil && len(v) > 0 {
return v[0], nil
}
return game, err
}
}