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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user