Added an optional preview url to the xp shop items

This commit is contained in:
Kwoth
2022-08-01 10:53:59 +02:00
parent 4b3fc53cb6
commit cf3788c6ea
4 changed files with 14 additions and 5 deletions

View File

@@ -395,7 +395,9 @@ public partial class Xp : NadekoModule<XpService>
.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);