Skip to content

Commit 8b89ad1

Browse files
Merge pull request #50 from nullinside-development-group/feature/ChatDisconnect
Updating chat client with new OAuth token after refresh
2 parents d325c3e + effe8aa commit 8b89ad1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Nullinside.Api.TwitchBot/Services/MainService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken) {
162162

163163
ITwitchApiProxy? botApi = await db.ConfigureApiAndRefreshToken(botUser, this._api, stoppingToken);
164164
if (null != botApi) {
165+
// Ensure the twitch client has the most up-to-date password
166+
this._client.TwitchOAuthToken = botApi.OAuth?.AccessToken;
167+
165168
// Trim channels that aren't live
166169
IEnumerable<string> liveUsers = await botApi.GetChannelsLive(usersWithBotEnabled
167170
.Where(u => null != u.TwitchId)

0 commit comments

Comments
 (0)