1
0
Fork 0
mirror of https://git.sr.ht/~ashkeel/strimertul synced 2024-09-18 01:50:50 +00:00

Fix twitch status poll crashing when twitch is not configured

This commit is contained in:
Ash Keel 2022-06-19 01:52:17 +02:00
parent 7247095f00
commit a6b8ffa877
No known key found for this signature in database
GPG key ID: BAD8D93E7314ED3E
2 changed files with 6 additions and 0 deletions

View file

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed `game` command not working when the specified channel contained the @ symbol at the beginning.
- Fixed strimertul crashing at start if the database folder didn't exist and a database driver was not manually specified
- Fixed strimertul crashing after a minute of being open if Twitch was not configured.
## [2.1.1] - 2022-03-24

View file

@ -143,6 +143,11 @@ func (c *Client) runStatusPoll() {
// Wait for next poll
time.Sleep(60 * time.Second)
// Make sure we're configured and connected properly first
if !c.Config.Enabled || c.Bot == nil || c.Bot.config.Channel == "" {
continue
}
// Check if streamer is online, if possible
func() {
status, err := c.API.GetStreams(&helix.StreamsParams{