Remove IUser.CreateDMChannelAsync, implicitly implement IUser.GetDMChannelAsync
This commit is contained in:
@@ -53,10 +53,10 @@ namespace Discord.WebSocket
|
||||
hasChanges = true;
|
||||
}
|
||||
return hasChanges;
|
||||
}
|
||||
}
|
||||
|
||||
public Task<RestDMChannel> CreateDMChannelAsync(RequestOptions options = null)
|
||||
=> UserHelper.CreateDMChannelAsync(this, Discord, options);
|
||||
public async Task<IDMChannel> GetDMChannelAsync(RequestOptions options = null)
|
||||
=> GlobalUser.DMChannel ?? await UserHelper.CreateDMChannelAsync(this, Discord, options) as IDMChannel;
|
||||
|
||||
public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128)
|
||||
=> CDN.GetUserAvatarUrl(Id, AvatarId, size, format);
|
||||
@@ -66,9 +66,7 @@ namespace Discord.WebSocket
|
||||
internal SocketUser Clone() => MemberwiseClone() as SocketUser;
|
||||
|
||||
//IUser
|
||||
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);
|
||||
Task<IDMChannel> IUser.GetDMChannelAsync(RequestOptions options)
|
||||
=> GetDMChannelAsync(options);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user