| @@ -20,6 +20,6 @@ namespace Discord | |||||
| string Username { get; } | string Username { get; } | ||||
| /// <summary> Returns a private message channel to this user, creating one if it does not already exist. </summary> | /// <summary> Returns a private message channel to this user, creating one if it does not already exist. </summary> | ||||
| Task<IDMChannel> GetDMChannelAsync(RequestOptions options = null); | |||||
| Task<IDMChannel> GetOrCreateDMChannelAsync(RequestOptions options = null); | |||||
| } | } | ||||
| } | } | ||||
| @@ -54,7 +54,7 @@ namespace Discord.Rest | |||||
| Update(model); | Update(model); | ||||
| } | } | ||||
| public Task<RestDMChannel> GetDMChannelAsync(RequestOptions options = null) | |||||
| public Task<RestDMChannel> GetOrCreateDMChannelAsync(RequestOptions options = null) | |||||
| => UserHelper.CreateDMChannelAsync(this, Discord, options); | => UserHelper.CreateDMChannelAsync(this, Discord, options); | ||||
| public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) | public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) | ||||
| @@ -64,7 +64,7 @@ namespace Discord.Rest | |||||
| private string DebuggerDisplay => $"{Username}#{Discriminator} ({Id}{(IsBot ? ", Bot" : "")})"; | private string DebuggerDisplay => $"{Username}#{Discriminator} ({Id}{(IsBot ? ", Bot" : "")})"; | ||||
| //IUser | //IUser | ||||
| async Task<IDMChannel> IUser.GetDMChannelAsync(RequestOptions options) | |||||
| => await GetDMChannelAsync(options); | |||||
| async Task<IDMChannel> IUser.GetOrCreateDMChannelAsync(RequestOptions options) | |||||
| => await GetOrCreateDMChannelAsync(options); | |||||
| } | } | ||||
| } | } | ||||
| @@ -49,7 +49,7 @@ namespace Discord.Rpc | |||||
| Username = model.Username.Value; | Username = model.Username.Value; | ||||
| } | } | ||||
| public Task<RestDMChannel> GetDMChannelAsync(RequestOptions options = null) | |||||
| public Task<RestDMChannel> GetOrCreateDMChannelAsync(RequestOptions options = null) | |||||
| => UserHelper.CreateDMChannelAsync(this, Discord, options); | => UserHelper.CreateDMChannelAsync(this, Discord, options); | ||||
| public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) | public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) | ||||
| @@ -59,7 +59,7 @@ namespace Discord.Rpc | |||||
| private string DebuggerDisplay => $"{Username}#{Discriminator} ({Id}{(IsBot ? ", Bot" : "")})"; | private string DebuggerDisplay => $"{Username}#{Discriminator} ({Id}{(IsBot ? ", Bot" : "")})"; | ||||
| //IUser | //IUser | ||||
| async Task<IDMChannel> IUser.GetDMChannelAsync(RequestOptions options) | |||||
| => await GetDMChannelAsync(options); | |||||
| async Task<IDMChannel> IUser.GetOrCreateDMChannelAsync(RequestOptions options) | |||||
| => await GetOrCreateDMChannelAsync(options); | |||||
| } | } | ||||
| } | } | ||||
| @@ -55,7 +55,7 @@ namespace Discord.WebSocket | |||||
| return hasChanges; | return hasChanges; | ||||
| } | } | ||||
| public async Task<IDMChannel> GetDMChannelAsync(RequestOptions options = null) | |||||
| public async Task<IDMChannel> GetOrCreateDMChannelAsync(RequestOptions options = null) | |||||
| => GlobalUser.DMChannel ?? await UserHelper.CreateDMChannelAsync(this, Discord, options) as IDMChannel; | => GlobalUser.DMChannel ?? await UserHelper.CreateDMChannelAsync(this, Discord, options) as IDMChannel; | ||||
| public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) | public string GetAvatarUrl(ImageFormat format = ImageFormat.Auto, ushort size = 128) | ||||
| @@ -64,9 +64,5 @@ namespace Discord.WebSocket | |||||
| public override string ToString() => $"{Username}#{Discriminator}"; | public override string ToString() => $"{Username}#{Discriminator}"; | ||||
| private string DebuggerDisplay => $"{Username}#{Discriminator} ({Id}{(IsBot ? ", Bot" : "")})"; | private string DebuggerDisplay => $"{Username}#{Discriminator} ({Id}{(IsBot ? ", Bot" : "")})"; | ||||
| internal SocketUser Clone() => MemberwiseClone() as SocketUser; | internal SocketUser Clone() => MemberwiseClone() as SocketUser; | ||||
| //IUser | |||||
| Task<IDMChannel> IUser.GetDMChannelAsync(RequestOptions options) | |||||
| => GetDMChannelAsync(options); | |||||
| } | } | ||||
| } | } | ||||