using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; namespace wakka { public class BinkPost { [JsonPropertyName("user")] public string? User { get; set; } [JsonPropertyName("body")] public string? Body { get; set; } [JsonPropertyName("time")] public long Time { get; set; } public string TimeString { get; set; } = string.Empty; } public class Bink { private static SshConnection Ssh { get; set; } = new SshConnection(); public void PostBink(string message) { Ssh.RunCommandWithInput("town bink --pipe", message); } public List? AllBinks() { return JsonSerializer.Deserialize>(Ssh.RunCommand("town bink --dump")); } public List? BinksBefore(long TimeStamp) { return JsonSerializer.Deserialize>(Ssh.RunCommand($"town bink --dump-before {TimeStamp}")); } public List? BinksAfter(long TimeStamp) { return JsonSerializer.Deserialize>(Ssh.RunCommand($"town bink --dump-after {TimeStamp}")); } } }