Browse Source

Create DM channel if one does not exist.

tags/1.0
AntiTcb 8 years ago
parent
commit
6fed78025c
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs

+ 2
- 2
src/Discord.Net.WebSocket/Entities/Users/SocketUser.cs View File

@@ -66,8 +66,8 @@ namespace Discord.WebSocket
internal SocketUser Clone() => MemberwiseClone() as SocketUser;

//IUser
Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IDMChannel>(GlobalUser.DMChannel);
async Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options)
=> await Task.FromResult<IDMChannel>(GlobalUser.DMChannel ?? await CreateDMChannelAsync(options) as IDMChannel);
async Task<IDMChannel> IUser.CreateDMChannelAsync(RequestOptions options)
=> await CreateDMChannelAsync(options).ConfigureAwait(false);
}


Loading…
Cancel
Save