Create DM channel if one does not exist.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user