mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
Cleaned up around xp.yml. Fixed a typo, added an error to .xpshop if the feature is disabled.
This commit is contained in:
@@ -347,6 +347,12 @@ public partial class Xp : NadekoModule<XpService>
|
||||
[Cmd]
|
||||
public async Task XpShop()
|
||||
{
|
||||
if (!_service.IsShopEnabled())
|
||||
{
|
||||
await ReplyErrorLocalizedAsync(strs.xp_shop_disabled);
|
||||
return;
|
||||
}
|
||||
|
||||
await SendConfirmAsync(GetText(strs.available_commands), $@"`{prefix}xpshop bgs`
|
||||
`{prefix}xpshop frames`");
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ Leave at 'None' if patron system is disabled or you don't want any restrictions"
|
||||
|
||||
[Comment(@"Frames available for sale. Keys are unique IDs.
|
||||
Do not change keys as they are not publicly visible. Only change properties (name, price, id)
|
||||
Removing a key compeltely means all previous purchases will also be unusable.
|
||||
Removing a key which previously existed means that all previous purchases will also be unusable.
|
||||
To remove an item from the shop, but keep previous purchases, set the price to -1")]
|
||||
public Dictionary<string, ShopItemInfo>? Frames { get; set; } = new()
|
||||
{
|
||||
@@ -52,7 +52,7 @@ To remove an item from the shop, but keep previous purchases, set the price to -
|
||||
|
||||
[Comment(@"Backgrounds available for sale. Keys are unique IDs.
|
||||
Do not change keys as they are not publicly visible. Only change properties (name, price, id)
|
||||
Removing a key compeltely means all previous purchases will also be unusable.
|
||||
Removing a key which previously existed means that all previous purchases will also be unusable.
|
||||
To remove an item from the shop, but keep previous purchases, set the price to -1")]
|
||||
public Dictionary<string, ShopItemInfo>? Bgs { get; set; } = new()
|
||||
{
|
||||
|
@@ -33,6 +33,11 @@ public sealed class XpConfigService : ConfigServiceBase<XpConfig>
|
||||
ConfigPrinters.ToString,
|
||||
x => x > 0);
|
||||
|
||||
AddParsedProp("shop.is_enabled",
|
||||
conf => conf.Shop.IsEnabled,
|
||||
bool.TryParse,
|
||||
ConfigPrinters.ToString);
|
||||
|
||||
Migrate();
|
||||
}
|
||||
|
||||
|
@@ -1470,6 +1470,9 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
||||
|
||||
public PatronTier GetXpShopTierRequirement()
|
||||
=> _xpConfig.Data.Shop.TierRequirement;
|
||||
|
||||
public bool IsShopEnabled()
|
||||
=> _xpConfig.Data.Shop.IsEnabled;
|
||||
}
|
||||
|
||||
public enum BuyResult
|
||||
|
Reference in New Issue
Block a user