Compare commits

..

No commits in common. "df56c76a89346aecf05bdeafd312b6f01c6bfc21" and "a9576e5aa13c86ef1322619136b2d193dce57d42" have entirely different histories.

4 changed files with 9 additions and 13 deletions

View file

@ -524,7 +524,7 @@ public sealed partial class Help : EllieModule<HelpService>
=> smc.RespondConfirmAsync(_sender, => smc.RespondConfirmAsync(_sender,
""" """
- In case you don't want or cannot Donate to EllieBot project, but you - In case you don't want or cannot Donate to EllieBot project, but you
- EllieBot is a free and [open source](https://toastielab.dev/Emotions-stuff/elliebot) project which means you can run your own "selfhosted" instance on your computer. - EllieBot is a free and [open source](https://toastielab.dev/Emotions-stuff/Ellie) project which means you can run your own "selfhosted" instance on your computer.
*Keep in mind that running the bot on your computer means that the bot will be offline when you turn off your computer* *Keep in mind that running the bot on your computer means that the bot will be offline when you turn off your computer*

View file

@ -2,7 +2,6 @@
using EllieBot.Modules.Xp.Services; using EllieBot.Modules.Xp.Services;
using EllieBot.Db.Models; using EllieBot.Db.Models;
using EllieBot.Modules.Patronage; using EllieBot.Modules.Patronage;
using EllieBot.Modules.Utility;
namespace EllieBot.Modules.Xp; namespace EllieBot.Modules.Xp;

View file

@ -668,7 +668,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand
/// <param name="channel"></param> /// <param name="channel"></param>
private async Task ScanUserForVoiceXp(SocketGuildUser user, SocketVoiceChannel channel) private async Task ScanUserForVoiceXp(SocketGuildUser user, SocketVoiceChannel channel)
{ {
if (UserParticipatingInVoiceChannel(user) && ShouldTrackXp(user, channel)) if (UserParticipatingInVoiceChannel(user) && ShouldTrackXp(user, channel.Id))
await UserJoinedVoiceChannel(user); await UserJoinedVoiceChannel(user);
else else
await UserLeftVoiceChannel(user, channel); await UserLeftVoiceChannel(user, channel);
@ -767,12 +767,9 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand
} }
*/ */
private bool ShouldTrackXp(SocketGuildUser user, IMessageChannel channel) private bool ShouldTrackXp(SocketGuildUser user, ulong channelId)
{ {
var channelId = channel.Id; if (_excludedChannels.TryGetValue(user.Guild.Id, out var chans) && chans.Contains(channelId))
if (_excludedChannels.TryGetValue(user.Guild.Id, out var chans) && (chans.Contains(channelId)
|| (channel is SocketThreadChannel tc && chans.Contains(tc.ParentChannel.Id))))
return false; return false;
if (_excludedServers.Contains(user.Guild.Id)) if (_excludedServers.Contains(user.Guild.Id))
@ -791,7 +788,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand
_ = Task.Run(async () => _ = Task.Run(async () =>
{ {
if (!ShouldTrackXp(user, arg.Channel)) if (!ShouldTrackXp(user, arg.Channel.Id))
return; return;
var xpConf = _xpConfig.Data; var xpConf = _xpConfig.Data;
@ -1289,9 +1286,9 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand
Image? frame = null; Image? frame = null;
if (item is 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")); 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")); frame = Image.Load<Rgba32>(File.OpenRead("data/images/frame_gold.png"));
} }
else else
@ -1468,7 +1465,7 @@ public class XpService : IEService, IReadyExecutor, IExecNoCommand
{ {
var patron = await _ps.GetPatronAsync(userId); var patron = await _ps.GetPatronAsync(userId);
if (patron is null || (int)patron.Value.Tier < (int)req) if ((int)patron.Tier < (int)req)
return BuyResult.InsufficientPatronTier; return BuyResult.InsufficientPatronTier;
} }

View file

@ -1,4 +1,4 @@
#nullable disable warnings #nullable disable warnings
namespace EllieBot.Db.Models; namespace EllieBot.Db.Models;
public class XpShopOwnedItem : DbEntity public class XpShopOwnedItem : DbEntity