mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 02:08:27 -04:00
5.1
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using NadekoBot.Modules.Xp.Services;
|
||||
using NadekoBot.Db.Models;
|
||||
using NadekoBot.Modules.Patronage;
|
||||
using NadekoBot.Modules.Utility;
|
||||
|
||||
namespace NadekoBot.Modules.Xp;
|
||||
|
||||
|
@@ -1286,9 +1286,9 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
||||
Image? frame = null;
|
||||
if (item is null)
|
||||
{
|
||||
if (patron.Tier == PatronTier.V)
|
||||
if (patron?.Tier == PatronTier.V)
|
||||
frame = Image.Load<Rgba32>(File.OpenRead("data/images/frame_silver.png"));
|
||||
else if (patron.Tier >= PatronTier.X || _creds.IsOwner(userId))
|
||||
else if (patron?.Tier >= PatronTier.X || _creds.IsOwner(userId))
|
||||
frame = Image.Load<Rgba32>(File.OpenRead("data/images/frame_gold.png"));
|
||||
}
|
||||
else
|
||||
@@ -1465,7 +1465,7 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
||||
{
|
||||
var patron = await _ps.GetPatronAsync(userId);
|
||||
|
||||
if ((int)patron.Tier < (int)req)
|
||||
if (patron is null || (int)patron.Value.Tier < (int)req)
|
||||
return BuyResult.InsufficientPatronTier;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user