|
|
@@ -213,6 +213,10 @@ namespace Discord.API |
|
|
|
options.BucketId = GatewayBucket.Get(GatewayBucketType.Unbucketed).Id; |
|
|
|
await RequestQueue.SendAsync(new WebSocketRequest(WebSocketClient, bytes, true, opCode == GatewayOpCode.Heartbeat, options)).ConfigureAwait(false); |
|
|
|
await _sentGatewayMessageEvent.InvokeAsync(opCode).ConfigureAwait(false); |
|
|
|
|
|
|
|
#if DEBUG |
|
|
|
Console.WriteLine($"Sent {opCode}:\n{SerializeJson(payload)}"); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
public async Task SendIdentifyAsync(int largeThreshold = 100, int shardID = 0, int totalShards = 1, GatewayIntents gatewayIntents = GatewayIntents.AllUnprivileged, (UserStatus, bool, long?, GameModel)? presence = null, RequestOptions options = null) |
|
|
@@ -237,12 +241,12 @@ namespace Discord.API |
|
|
|
|
|
|
|
if (presence.HasValue) |
|
|
|
{ |
|
|
|
msg.Presence = new StatusUpdateParams |
|
|
|
msg.Presence = new PresenceUpdateParams |
|
|
|
{ |
|
|
|
Status = presence.Value.Item1, |
|
|
|
IsAFK = presence.Value.Item2, |
|
|
|
IdleSince = presence.Value.Item3, |
|
|
|
Game = presence.Value.Item4, |
|
|
|
Activities = new object[] { presence.Value.Item4 } |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
@@ -264,18 +268,18 @@ namespace Discord.API |
|
|
|
options = RequestOptions.CreateOrClone(options); |
|
|
|
await SendGatewayAsync(GatewayOpCode.Heartbeat, lastSeq, options: options).ConfigureAwait(false); |
|
|
|
} |
|
|
|
public async Task SendStatusUpdateAsync(UserStatus status, bool isAFK, long? since, GameModel game, RequestOptions options = null) |
|
|
|
public async Task SendPresenceUpdateAsync(UserStatus status, bool isAFK, long? since, GameModel game, RequestOptions options = null) |
|
|
|
{ |
|
|
|
options = RequestOptions.CreateOrClone(options); |
|
|
|
var args = new StatusUpdateParams |
|
|
|
var args = new PresenceUpdateParams |
|
|
|
{ |
|
|
|
Status = status, |
|
|
|
IdleSince = since, |
|
|
|
IsAFK = isAFK, |
|
|
|
Game = game |
|
|
|
Activities = new object[] { game } |
|
|
|
}; |
|
|
|
options.BucketId = GatewayBucket.Get(GatewayBucketType.PresenceUpdate).Id; |
|
|
|
await SendGatewayAsync(GatewayOpCode.StatusUpdate, args, options: options).ConfigureAwait(false); |
|
|
|
await SendGatewayAsync(GatewayOpCode.PresenceUpdate, args, options: options).ConfigureAwait(false); |
|
|
|
} |
|
|
|
public async Task SendRequestMembersAsync(IEnumerable<ulong> guildIds, RequestOptions options = null) |
|
|
|
{ |
|
|
|