mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-12 02:08:27 -04:00
fix: Fixed xpcurrew breaking xp gain if user gains 0 xp from being in a voice channel while voice xp is enabled
This commit is contained in:
@@ -178,8 +178,9 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
|||||||
{
|
{
|
||||||
foreach (var user in globalToAdd)
|
foreach (var user in globalToAdd)
|
||||||
{
|
{
|
||||||
var amount = user.Value.XpAmount * conf.CurrencyPerXp;
|
var amount = (long)(user.Value.XpAmount * conf.CurrencyPerXp);
|
||||||
await _cs.AddAsync(user.Key, (long)(amount), null);
|
if (amount > 0)
|
||||||
|
await _cs.AddAsync(user.Key, amount, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -770,7 +771,8 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
|
|||||||
{
|
{
|
||||||
var channelId = channel.Id;
|
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))))
|
|| (channel is SocketThreadChannel tc && chans.Contains(tc.ParentChannel.Id))))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user