mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 17:28:27 -04:00
Added .xpshopbuy and .xpshopuse convenience commands
This commit is contained in:
@@ -1351,11 +1351,15 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
||||
if (!conf.Shop.IsEnabled)
|
||||
return BuyResult.UnknownItem;
|
||||
|
||||
if (conf.Shop.TierRequirement != PatronTier.None && !_creds.IsOwner(userId))
|
||||
var req = type == XpShopItemType.Background
|
||||
? conf.Shop.BgsTierRequirement
|
||||
: conf.Shop.FramesTierRequirement;
|
||||
|
||||
if (req != PatronTier.None && !_creds.IsOwner(userId))
|
||||
{
|
||||
var patron = await _ps.GetPatronAsync(userId);
|
||||
|
||||
if ((int)patron.Tier < (int)conf.Shop.TierRequirement)
|
||||
if ((int)patron.Tier < (int)req)
|
||||
return BuyResult.InsufficientPatronTier;
|
||||
}
|
||||
|
||||
@@ -1482,8 +1486,12 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
||||
return false;
|
||||
}
|
||||
|
||||
public PatronTier GetXpShopTierRequirement()
|
||||
=> _xpConfig.Data.Shop.TierRequirement;
|
||||
public PatronTier GetXpShopTierRequirement(Xp.XpShopInputType type)
|
||||
=> type switch
|
||||
{
|
||||
Xp.XpShopInputType.F => _xpConfig.Data.Shop.FramesTierRequirement,
|
||||
_ => _xpConfig.Data.Shop.BgsTierRequirement,
|
||||
};
|
||||
|
||||
public bool IsShopEnabled()
|
||||
=> _xpConfig.Data.Shop.IsEnabled;
|
||||
|
Reference in New Issue
Block a user