mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 09:40:10 +00:00
feat: update Discord status only on identify
See <https://github.com/discord/discord-api-docs/issues/4073#issuecomment-1016762755> We still update status when restarting cluster, because it doesn't really matter if the session dies in that case (we're already restarting / going to reidentify)
This commit is contained in:
parent
b586ef5d0a
commit
c6e4c862b8
3 changed files with 31 additions and 63 deletions
|
|
@ -41,12 +41,15 @@ public class Shard
|
|||
private TimeSpan _reconnectDelay = TimeSpan.Zero;
|
||||
private Task? _worker;
|
||||
|
||||
public Shard(GatewaySettings settings, ShardInfo info, IGatewayRatelimiter ratelimiter, string url, ILogger logger)
|
||||
private GatewayStatusUpdate? _presence { get; init; }
|
||||
|
||||
public Shard(GatewaySettings settings, ShardInfo info, IGatewayRatelimiter ratelimiter, string url, ILogger logger, GatewayStatusUpdate? presence = null)
|
||||
{
|
||||
_jsonSerializerOptions = new JsonSerializerOptions().ConfigureForMyriad();
|
||||
|
||||
_settings = settings;
|
||||
_info = info;
|
||||
_presence = presence;
|
||||
_ratelimiter = ratelimiter;
|
||||
_url = url;
|
||||
_logger = logger.ForContext<Shard>().ForContext("ShardId", info.ShardId);
|
||||
|
|
@ -164,7 +167,8 @@ public class Shard
|
|||
},
|
||||
Shard = _info,
|
||||
Token = _settings.Token,
|
||||
LargeThreshold = 50
|
||||
LargeThreshold = 50,
|
||||
Presence = _presence,
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue