More cleanup
This commit is contained in:
@@ -57,16 +57,6 @@ namespace Discord
|
|||||||
return _channels.Update(response.Id, serverId, response);
|
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>
|
/// <summary> Destroys the provided channel. </summary>
|
||||||
public Task<Channel> DestroyChannel(Channel channel)
|
public Task<Channel> DestroyChannel(Channel channel)
|
||||||
=> DestroyChannel(channel?.Id);
|
=> DestroyChannel(channel?.Id);
|
||||||
|
|||||||
@@ -398,6 +398,14 @@ namespace Discord
|
|||||||
return channel;
|
return channel;
|
||||||
return await CreatePMChannel(user?.Id);
|
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>
|
/// <summary> Returns all channels with the specified server and name. </summary>
|
||||||
/// <remarks> Name formats supported: Name and #Name. Search is case-insensitive. </remarks>
|
/// <remarks> Name formats supported: Name and #Name. Search is case-insensitive. </remarks>
|
||||||
|
|||||||
Reference in New Issue
Block a user