private RateLimitViewModel makeRateVm(RateLimits rl) { RateLimitViewModel rlvm = new RateLimitViewModel() { CallsPerWindow = rl.CallsPerWindow, RateLimitId = rl.RateLimitsId, RateWindowInMinutes = (int)Math.Ceiling(rl.RateWindow.TotalMinutes) }; return(rlvm); }
public static Attachment RateLimits(RateLimitViewModel rateLimit) => new AttachmentBuilder() .WithTitle("API Rate Limits") .WithThumbnailUrl("https://cdn.discordapp.com/app-icons/751048410357956658/168781156967a40bba1362042f7f1713.png") .WithCurrentTimestamp() .WithColor(Color) .WithFields( new AttachmentFieldBuilder() .WithName("Site") .WithValue($"Retry After: {rateLimit.SiteLimit.RetryAfter?.ToString("O") ?? "None"}"), new AttachmentFieldBuilder() .WithName("API") .WithValue(@$ "Hourly Remaining: {rateLimit.APILimit.HourlyRemaining}