Browse Source

More cleanup

tags/docs-0.9
Brandon Smith 9 years ago
parent
commit
738f5fa849
2 changed files with 8 additions and 10 deletions
  1. +0
    -10
      src/Discord.Net/DiscordClient.API.cs
  2. +8
    -0
      src/Discord.Net/DiscordClient.Cache.cs

+ 0
- 10
src/Discord.Net/DiscordClient.API.cs 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);


+ 8
- 0
src/Discord.Net/DiscordClient.Cache.cs 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>


Loading…
Cancel
Save