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:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user