mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 09:10:14 +00:00
Port more things!
This commit is contained in:
parent
f6fb8204bb
commit
47b16dc51b
26 changed files with 332 additions and 186 deletions
|
|
@ -27,6 +27,7 @@ namespace Myriad.Gateway
|
|||
public IReadOnlyDictionary<int, Shard> Shards => _shards;
|
||||
public ClusterSessionState SessionState => GetClusterState();
|
||||
public User? User => _shards.Values.Select(s => s.User).FirstOrDefault(s => s != null);
|
||||
public ApplicationPartial? Application => _shards.Values.Select(s => s.Application).FirstOrDefault(s => s != null);
|
||||
|
||||
private ClusterSessionState GetClusterState()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ namespace Myriad.Gateway
|
|||
public ShardState State { get; private set; }
|
||||
public TimeSpan? Latency { get; private set; }
|
||||
public User? User { get; private set; }
|
||||
public ApplicationPartial? Application { get; private set; }
|
||||
|
||||
public Func<IGatewayEvent, Task>? OnEventReceived { get; set; }
|
||||
|
||||
|
|
@ -258,6 +259,7 @@ namespace Myriad.Gateway
|
|||
ShardInfo = ready.Shard;
|
||||
SessionInfo = SessionInfo with { Session = ready.SessionId };
|
||||
User = ready.User;
|
||||
Application = ready.Application;
|
||||
State = ShardState.Open;
|
||||
|
||||
return Task.CompletedTask;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue