holy shit I am the goat

This commit is contained in:
2026-02-28 22:40:27 +00:00
parent 940ab3535a
commit 2a27da1ab4
6 changed files with 145 additions and 104 deletions

39
Services/PlanetService.cs Normal file
View File

@@ -0,0 +1,39 @@
using Valour.Sdk.Client;
using Valour.Sdk.Models;
using Valour.Shared.Models;
namespace Reactor.Services
{
public static class PlanetService
{
public static async Task InitializePlanetsAsync(
ValourClient client,
Dictionary<long, Channel> channelCache,
HashSet<long> initializedPlanets)
{
foreach (var planet in client.PlanetService.JoinedPlanets)
{
if (initializedPlanets.Contains(planet.Id))
continue;
Console.WriteLine($"Initializing Planet: {planet.Name}");
await planet.EnsureReadyAsync();
await planet.FetchInitialDataAsync();
foreach (var channel in planet.Channels)
{
channelCache[channel.Id] = channel;
if (channel.ChannelType == ChannelTypeEnum.PlanetChat)
{
await channel.OpenWithResult("Reactor");
Console.WriteLine($"Realtime opened for: {planet.Name} -> {channel.Name}");
}
}
initializedPlanets.Add(planet.Id);
}
}
}
}