private void ListBackupsCallback(object raw) { ArkIOInterfaceResponse data = ((ArkIOInterfaceRequestData)raw).response; //Parse DateTimes for each of these. List <long> dates = new List <long>(); foreach (var date in data.output) { try { string[] r = date.Split(' '); string rawDate = r[r.Length - 1]; rawDate = rawDate.Substring(0, rawDate.Length - 4); long l = long.Parse(rawDate); dates.Add(l); } catch { } } dates.Sort(); dates.Reverse(); int i = 0; string output = ""; while (i < dates.Count) { if (i > 4) { break; } DateTime dt = new DateTime(dates[i]); DateTime dt_here = dt.ToLocalTime(); output += dt.ToShortTimeString() + " at " + dt.ToShortDateString() + " (" + dt_here.ToShortTimeString() + " at " + dt_here.ToShortDateString() + " here)\r\n"; i++; } var embed = Tools.GenerateEmbed("Latest Backups", Tools.CompareAndUsePlural("backup", dates.Count) + " (Max 5)", output, DSharpPlus.Entities.DiscordColor.Magenta); TryEditMessage(data.clientId, embed); }
private void Callback(object raw) { ArkIOInterfaceResponse data = ((ArkIOInterfaceRequestData)raw).response; Console.WriteLine("test"); }