Create DM channel if one does not exist.

This commit is contained in:
AntiTcb
2017-05-16 20:02:32 -04:00
parent 588df7b0c7
commit 6fed78025c

View File

@@ -66,8 +66,8 @@ namespace Discord.WebSocket
internal SocketUser Clone() => MemberwiseClone() as SocketUser; internal SocketUser Clone() => MemberwiseClone() as SocketUser;
//IUser //IUser
Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options) async Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IDMChannel>(GlobalUser.DMChannel); => await Task.FromResult<IDMChannel>(GlobalUser.DMChannel ?? await CreateDMChannelAsync(options) as IDMChannel);
async Task<IDMChannel> IUser.CreateDMChannelAsync(RequestOptions options) async Task<IDMChannel> IUser.CreateDMChannelAsync(RequestOptions options)
=> await CreateDMChannelAsync(options).ConfigureAwait(false); => await CreateDMChannelAsync(options).ConfigureAwait(false);
} }