mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-09-19 18:12:55 +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
@ -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 New Issue
Block a user