using NadekoBot.Db.Models; using OneOf; namespace NadekoBot.Modules.Patronage; /// /// Manages patrons and provides access to their data /// public interface IPatronageService { /// /// Called when the payment is made. /// Either as a single payment for that patron, /// or as a recurring monthly donation. /// public event Func OnNewPatronPayment; /// /// Called when the patron changes the pledge amount /// (Patron old, Patron new) => Task /// public event Func OnPatronUpdated; /// /// Called when the patron refunds the purchase or it's marked as fraud /// public event Func OnPatronRefunded; /// /// Gets a Patron with the specified userId /// /// UserId for which to get the patron data for. /// A patron with the specifeid userId public Task GetPatronAsync(ulong userId); Task LimitHitAsync(LimitedFeatureName key, ulong userId, int amount = 1); Task LimitForceHit(LimitedFeatureName key, ulong userId, int amount); Task GetUserLimit(LimitedFeatureName name, ulong userId); Task> LimitStats(ulong userId); PatronConfigData GetConfig(); int PercentBonus(Patron? user); int PercentBonus(long amount); }