diff --git a/src/NadekoBot/Modules/Xp/Xp.cs b/src/NadekoBot/Modules/Xp/Xp.cs index 1e89b67df..7b3a001b5 100644 --- a/src/NadekoBot/Modules/Xp/Xp.cs +++ b/src/NadekoBot/Modules/Xp/Xp.cs @@ -395,7 +395,9 @@ public partial class Xp : NadekoModule .WithTitle(item.Name) .AddField(GetText(strs.price), Gambling.Gambling.N(item.Price, culture), true) // .AddField(GetText(strs.buy), $"{prefix}xpbuy {key}", true) - .WithImageUrl(item.Url.ToString()); + .WithImageUrl(string.IsNullOrWhiteSpace(item.Preview) + ? item.Url + : item.Preview); if (!string.IsNullOrWhiteSpace(item.Desc)) eb.WithDescription(item.Desc); diff --git a/src/NadekoBot/Modules/Xp/XpConfig.cs b/src/NadekoBot/Modules/Xp/XpConfig.cs index df6a49e33..b9a1ba2a1 100644 --- a/src/NadekoBot/Modules/Xp/XpConfig.cs +++ b/src/NadekoBot/Modules/Xp/XpConfig.cs @@ -10,7 +10,7 @@ namespace NadekoBot.Modules.Xp; public sealed partial class XpConfig : ICloneable { [Comment(@"DO NOT CHANGE")] - public int Version { get; set; } = 3; + public int Version { get; set; } = 4; [Comment(@"How much XP will the users receive per message")] public int XpPerMessage { get; set; } = 3; @@ -71,6 +71,9 @@ To remove an item from the shop, but keep previous purchases, set the price to - [Comment(@"Direct url to the .png image which will be applied to the user's XP card")] public string Url { get; set; } + [Comment(@"Optional preview url which will show instead of the real URL in the shop ")] + public string Preview { get; set; } + [Comment(@"Optional description of the item")] public string Desc { get; set; } } diff --git a/src/NadekoBot/Modules/Xp/XpConfigService.cs b/src/NadekoBot/Modules/Xp/XpConfigService.cs index 54dccd69b..c420b4ccb 100644 --- a/src/NadekoBot/Modules/Xp/XpConfigService.cs +++ b/src/NadekoBot/Modules/Xp/XpConfigService.cs @@ -52,11 +52,11 @@ public sealed class XpConfigService : ConfigServiceBase }); } - if (data.Version < 3) + if (data.Version < 4) { ModifyConfig(c => { - c.Version = 3; + c.Version = 4; }); } } diff --git a/src/NadekoBot/data/xp.yml b/src/NadekoBot/data/xp.yml index 97c017f6c..0c9a16c8c 100644 --- a/src/NadekoBot/data/xp.yml +++ b/src/NadekoBot/data/xp.yml @@ -1,5 +1,5 @@ # DO NOT CHANGE -version: 3 +version: 4 # How much XP will the users receive per message xpPerMessage: 3 # How often can the users receive XP in minutes @@ -31,6 +31,8 @@ shop: price: 0 # Direct url to the .png image which will be applied to the user's XP card url: '' + # Optional preview url which will show instead of the real URL in the shop + preview: # Optional description of the item desc: # Backgrounds available for sale. Keys are unique IDs. @@ -45,5 +47,7 @@ shop: price: 0 # Direct url to the .png image which will be applied to the user's XP card url: '' + # Optional preview url which will show instead of the real URL in the shop + preview: # Optional description of the item desc: