diff --git a/src/Discord.Net/Channel.cs b/src/Discord.Net/Channel.cs
index 45a9bbbf1..880a35ca3 100644
--- a/src/Discord.Net/Channel.cs
+++ b/src/Discord.Net/Channel.cs
@@ -21,7 +21,7 @@ namespace Discord
private string _name;
/// Returns the name of this channel.
- public string Name { get { return !IsPrivate ? $"#{_name}" : $"@{Recipient.Name}"; } internal set { _name = value; } }
+ public string Name { get { return !IsPrivate ? $"{_name}" : $"@{Recipient.Name}"; } internal set { _name = value; } }
/// Returns the position of this channel in the channel list for this server.
public int Position { get; internal set; }
diff --git a/src/Discord.Net/DiscordClient.cs b/src/Discord.Net/DiscordClient.cs
index e3e1a8a61..4318b679d 100644
--- a/src/Discord.Net/DiscordClient.cs
+++ b/src/Discord.Net/DiscordClient.cs
@@ -26,7 +26,6 @@ namespace Discord
private readonly JsonSerializer _serializer;
private readonly Random _rand;
- private volatile CancellationTokenSource _disconnectToken;
private volatile Task _tasks;
private string _currentVoiceServerId, _currentVoiceEndpoint, _currentVoiceToken;
@@ -68,7 +67,13 @@ namespace Discord
/// Returns true if the user has successfully logged in and the websocket connection has been established.
public bool IsConnected => _isConnected;
private bool _isConnected;
-
+
+ private volatile CancellationTokenSource _disconnectToken;
+ /// Returns true if this client was requested to disconnect.
+ public bool IsClosing => _disconnectToken.IsCancellationRequested;
+ /// Returns a cancel token that is triggered when a disconnect is requested.
+ public CancellationToken CloseToken => _disconnectToken.Token;
+
/// Initializes a new instance of the DiscordClient class.
public DiscordClient(DiscordClientConfig config = null)
{
@@ -1228,20 +1233,20 @@ namespace Discord
//Voice
- public Task JoinVoice(Server server, Channel channel)
- => JoinVoice(server.Id, channel.Id);
- public Task JoinVoice(Server server, string channelId)
- => JoinVoice(server.Id, channelId);
- public Task JoinVoice(string serverId, Channel channel)
- => JoinVoice(serverId, channel.Id);
- public async Task JoinVoice(string serverId, string channelId)
+ public Task JoinVoiceServer(Server server, Channel channel)
+ => JoinVoiceServer(server.Id, channel.Id);
+ public Task JoinVoiceServer(Server server, string channelId)
+ => JoinVoiceServer(server.Id, channelId);
+ public Task JoinVoiceServer(string serverId, Channel channel)
+ => JoinVoiceServer(serverId, channel.Id);
+ public async Task JoinVoiceServer(string serverId, string channelId)
{
- await LeaveVoice();
+ await LeaveVoiceServer();
_currentVoiceServerId = serverId;
_webSocket.JoinVoice(serverId, channelId);
}
- public async Task LeaveVoice()
+ public async Task LeaveVoiceServer()
{
await _voiceWebSocket.DisconnectAsync();
if (_currentVoiceEndpoint != null)