Does not restart please Fix

Actually it does because it runs the Execute() method again once that error is thrown.
catch (NullReferenceException) { ColoredConsoleWrite(ConsoleColor.White, "Null Refference - Restarting"); Execute(); }
It just keeps throwing the error - I would say either restart or give it 5 more minutes?
I restart every time. the next time I give him 5 minutes.
can you make a automatic restart?
Well, I could, yes.
But I don't believe it would be effective.
I use google and i starting with strg and f5 and if there is this error and I was asleep the ( rest arte ) goes immediately passed
modify client.cs, line 85 to use refresh token instead of access token. because google access token does expire while refresh token doesn't
@evoamac can you show code?
public async Task DoGoogleLogin()
{
_authType = AuthType.Google;
GoogleLogin.TokenResponseModel tokenResponse = null;
if (_settings.GoogleRefreshToken == string.Empty && AccessToken == string.Empty)
{
var deviceCode = await GoogleLogin.GetDeviceCode();
tokenResponse = await GoogleLogin.GetAccessToken(deviceCode);
_accessToken = tokenResponse.id_token;
Console.WriteLine($"Put RefreshToken in settings for direct login: {tokenResponse.refresh_token}");
_settings.GoogleRefreshToken = tokenResponse.refresh_token;
AccessToken = tokenResponse.refresh_token;
}
else
{
if (_settings.GoogleRefreshToken != null)
tokenResponse = await GoogleLogin.GetAccessToken(_settings.GoogleRefreshToken);
else
tokenResponse = await GoogleLogin.GetAccessToken(AccessToken);
_accessToken = tokenResponse.id_token;
}
}
This is what I have and it's working well so far. I had the error once though, few hours ago.
in client.cs change Console.WriteLine($"Put RefreshToken in settings for direct login: {tokenResponse.accessToken}"); To Console.WriteLine($"Put RefreshToken in settings for direct login: {tokenResponse.refresh_token}");
and you will get a short token in the console while first login, put that token in your app.config.
I'd recommend you to just update your bot. The newest version does all that stuff automatically.
I updated code Console.WriteLine($"Put RefreshToken in settings for direct login: {tokenResponse.refresh_token}"); But still get same error? Huh