Exposed RequestOptions

This commit is contained in:
RogueException
2016-10-06 02:44:41 -03:00
parent aa7d9ad414
commit f41df1f966
54 changed files with 793 additions and 766 deletions

View File

@@ -82,10 +82,10 @@ namespace Discord.WebSocket
_roleIds = roles.ToImmutable();
}
public Task ModifyAsync(Action<ModifyGuildMemberParams> func)
=> UserHelper.ModifyAsync(this, Discord, func);
public Task KickAsync()
=> UserHelper.KickAsync(this, Discord);
public Task ModifyAsync(Action<ModifyGuildMemberParams> func, RequestOptions options = null)
=> UserHelper.ModifyAsync(this, Discord, func, options);
public Task KickAsync(RequestOptions options = null)
=> UserHelper.KickAsync(this, Discord, options);
public ChannelPermissions GetPermissions(IGuildChannel channel)
=> new ChannelPermissions(Permissions.ResolveChannel(Guild, this, channel, GuildPermissions.RawValue));
@@ -97,7 +97,7 @@ namespace Discord.WebSocket
IReadOnlyCollection<ulong> IGuildUser.RoleIds => RoleIds;
//IUser
Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode)
Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IDMChannel>(GlobalUser.DMChannel);
//IVoiceState

View File

@@ -7,17 +7,17 @@ namespace Discord.WebSocket
[DebuggerDisplay(@"{DebuggerDisplay,nq}")]
public struct SocketPresence : IPresence
{
public Game? Game { get; }
public UserStatus Status { get; }
public Game? Game { get; }
internal SocketPresence(Game? game, UserStatus status)
internal SocketPresence(UserStatus status, Game? game)
{
Game = game;
Status = status;
Game = game;
}
internal static SocketPresence Create(Model model)
{
return new SocketPresence(model.Game != null ? Discord.Game.Create(model.Game) : (Game?)null, model.Status);
return new SocketPresence(model.Status, model.Game != null ? Discord.Game.Create(model.Game) : (Game?)null);
}
public override string ToString() => Status.ToString();

View File

@@ -40,17 +40,17 @@ namespace Discord.WebSocket
Presence = SocketPresence.Create(model);
}
public Task<RestDMChannel> CreateDMChannelAsync()
=> UserHelper.CreateDMChannelAsync(this, Discord);
public Task<RestDMChannel> CreateDMChannelAsync(RequestOptions options = null)
=> UserHelper.CreateDMChannelAsync(this, Discord, options);
public override string ToString() => $"{Username}#{Discriminator}";
internal string DebuggerDisplay => $"{Username}#{Discriminator} ({Id}{(IsBot ? ", Bot" : "")})";
internal SocketUser Clone() => MemberwiseClone() as SocketUser;
//IUser
Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode)
Task<IDMChannel> IUser.GetDMChannelAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IDMChannel>(GlobalUser.DMChannel);
async Task<IDMChannel> IUser.CreateDMChannelAsync()
=> await CreateDMChannelAsync();
async Task<IDMChannel> IUser.CreateDMChannelAsync(RequestOptions options)
=> await CreateDMChannelAsync(options);
}
}