More cleanup

This commit is contained in:
Brandon Smith
2015-08-30 17:08:24 -03:00
parent 5e8291fe25
commit 738f5fa849
2 changed files with 8 additions and 10 deletions

View File

@@ -57,16 +57,6 @@ namespace Discord
return _channels.Update(response.Id, serverId, response);
}
/// <summary> Creates a new private channel with the provided user. </summary>
public async Task<Channel> CreatePMChannel(string userId)
{
CheckReady();
if (userId == null) throw new ArgumentNullException(nameof(userId));
var response = await _api.CreatePMChannel(_myId, userId);
return _channels.Update(response.Id, response);
}
/// <summary> Destroys the provided channel. </summary>
public Task<Channel> DestroyChannel(Channel channel)
=> DestroyChannel(channel?.Id);

View File

@@ -398,6 +398,14 @@ namespace Discord
return channel;
return await CreatePMChannel(user?.Id);
}
private async Task<Channel> CreatePMChannel(string userId)
{
CheckReady();
if (userId == null) throw new ArgumentNullException(nameof(userId));
var response = await _api.CreatePMChannel(_myId, userId);
return _channels.Update(response.Id, response);
}
/// <summary> Returns all channels with the specified server and name. </summary>
/// <remarks> Name formats supported: Name and #Name. Search is case-insensitive. </remarks>