]> git.localhorst.tv Git - alttp.git/blobdiff - app/TwitchBot/TwitchBot.php
track twitch token expiration
[alttp.git] / app / TwitchBot / TwitchBot.php
index e5a5aa6e442307b06bbae8b68635a07f4255b463..63f4236f685e92bf659610257e93177a78cf7a11 100644 (file)
@@ -23,6 +23,9 @@ class TwitchBot {
                if (!$this->token) {
                        throw new \Exception('unable to find access token');
                }
+               if ($this->token->hasExpired()) {
+                       $this->token->refresh();
+               }
 
                $this->connector = new Connector();
                $this->connect();