Added SelfUser.ModifyStatusAsync
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user