Remove support for TokenType.User (#958)

* Set usage of TokenType.User as an error rather than a warning.

* Remove commented sections and #pragma's

Additionally, changes use of ReadMessages to ViewChannel since that Obsolete was also suppressed by the pragma
This commit is contained in:
Joe4evr
2018-03-12 18:59:22 +01:00
committed by Christopher F
parent 170a2e00bd
commit 2fd4f5670e
5 changed files with 13 additions and 38 deletions

View File

@@ -1,4 +1,3 @@
#pragma warning disable CS0618
using Discord.API;
using Discord.API.Gateway;
using Discord.Logging;
@@ -446,7 +445,7 @@ namespace Discord.WebSocket
{
var model = data.Guilds[i];
var guild = AddGuild(model, state);
if (!guild.IsAvailable || ApiClient.AuthTokenType == TokenType.User)
if (!guild.IsAvailable)
unavailableGuilds++;
else
await GuildAvailableAsync(guild).ConfigureAwait(false);
@@ -465,9 +464,6 @@ namespace Discord.WebSocket
return;
}
if (ApiClient.AuthTokenType == TokenType.User)
await SyncGuildsAsync().ConfigureAwait(false);
_lastGuildAvailableTime = Environment.TickCount;
_guildDownloadTask = WaitForGuildsAsync(_connection.CancelToken, _gatewayLogger)
.ContinueWith(async x =>
@@ -542,8 +538,6 @@ namespace Discord.WebSocket
var guild = AddGuild(data, State);
if (guild != null)
{
if (ApiClient.AuthTokenType == TokenType.User)
await SyncGuildsAsync().ConfigureAwait(false);
await TimedInvokeAsync(_joinedGuildEvent, nameof(JoinedGuild), guild).ConfigureAwait(false);
}
else