funny react

This commit is contained in:
2026-03-12 20:18:40 +00:00
parent 7844b21160
commit bf27843e82
2 changed files with 58 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ using System.Globalization;
using System.Text.Json;
using Valour.Sdk.Models;
using Valour.Sdk.Client;
using System.Text;
namespace SkyBot
{
@@ -105,5 +106,33 @@ namespace SkyBot
initializedPlanets.Add(planet.Id);
}
}
public class ReactionInterceptor : TextWriter
{
private readonly TextWriter _original;
public bool DetectedAlreadyExists { get; private set; }
public override Encoding Encoding => _original.Encoding;
public ReactionInterceptor(TextWriter original)
{
_original = original;
}
public void Reset() => DetectedAlreadyExists = false;
public override void WriteLine(string value)
{
if (value?.Contains("Reaction already exists") == true)
DetectedAlreadyExists = true;
_original.WriteLine(value);
}
public override void Write(string value)
{
if (value?.Contains("Reaction already exists") == true)
DetectedAlreadyExists = true;
_original.Write(value);
}
}
};
};