mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 01:30:13 +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
|
|
@ -16,6 +16,8 @@ public class Cluster
|
|||
private readonly ConcurrentDictionary<int, Shard> _shards = new();
|
||||
private IGatewayRatelimiter? _ratelimiter;
|
||||
|
||||
public GatewayStatusUpdate DiscordPresence { get; set; }
|
||||
|
||||
public Cluster(GatewaySettings gatewaySettings, ILogger logger)
|
||||
{
|
||||
_gatewaySettings = gatewaySettings;
|
||||
|
|
@ -54,7 +56,7 @@ public class Cluster
|
|||
|
||||
private void CreateAndAddShard(string url, ShardInfo shardInfo)
|
||||
{
|
||||
var shard = new Shard(_gatewaySettings, shardInfo, _ratelimiter!, url, _logger);
|
||||
var shard = new Shard(_gatewaySettings, shardInfo, _ratelimiter!, url, _logger, DiscordPresence);
|
||||
shard.OnEventReceived += evt => OnShardEventReceived(shard, evt);
|
||||
_shards[shardInfo.ShardId] = shard;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue