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.Audio;
using Discord.Rest;
using System;
@@ -64,7 +63,7 @@ namespace Discord.WebSocket
public Task DownloaderPromise => _downloaderPromise.Task;
public IAudioClient AudioClient => _audioClient;
public SocketTextChannel DefaultChannel => TextChannels
.Where(c => CurrentUser.GetPermissions(c).ReadMessages)
.Where(c => CurrentUser.GetPermissions(c).ViewChannel)
.OrderBy(c => c.Position)
.FirstOrDefault();
public SocketVoiceChannel AFKChannel
@@ -192,12 +191,9 @@ namespace Discord.WebSocket
_syncPromise = new TaskCompletionSource<bool>();
_downloaderPromise = new TaskCompletionSource<bool>();
if (Discord.ApiClient.AuthTokenType != TokenType.User)
{
var _ = _syncPromise.TrySetResultAsync(true);
/*if (!model.Large)
_ = _downloaderPromise.TrySetResultAsync(true);*/
}
var _ = _syncPromise.TrySetResultAsync(true);
/*if (!model.Large)
_ = _downloaderPromise.TrySetResultAsync(true);*/
}
internal void Update(ClientState state, Model model)
{