Added SelfUser.ModifyStatusAsync

This commit is contained in:
RogueException
2016-10-06 03:16:14 -03:00
parent f41df1f966
commit 6c34441f4c
8 changed files with 69 additions and 11 deletions

View File

@@ -212,12 +212,14 @@ namespace Discord.API
options = RequestOptions.CreateOrClone(options);
await SendGatewayAsync(GatewayOpCode.Heartbeat, lastSeq, options: options).ConfigureAwait(false);
}
public async Task SendStatusUpdateAsync(long? idleSince, Game game, RequestOptions options = null)
public async Task SendStatusUpdateAsync(UserStatus status, bool isAFK, long? since, Game game, RequestOptions options = null)
{
options = RequestOptions.CreateOrClone(options);
var args = new StatusUpdateParams
{
IdleSince = idleSince,
Status = status,
IdleSince = since,
IsAFK = isAFK,
Game = game
};
await SendGatewayAsync(GatewayOpCode.StatusUpdate, args, options: options).ConfigureAwait(false);

View File

@@ -6,8 +6,12 @@ namespace Discord.API.Gateway
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class StatusUpdateParams
{
[JsonProperty("idle_since"), Int53]
[JsonProperty("status")]
public UserStatus Status { get; set; }
[JsonProperty("since"), Int53]
public long? IdleSince { get; set; }
[JsonProperty("afk")]
public bool IsAFK { get; set; }
[JsonProperty("game")]
public Game Game { get; set; }
}