mirror of
				https://gitlab.com/Kwoth/nadekobot.git
				synced 2025-11-04 00:34:26 -05:00 
			
		
		
		
	fix: .xpexclude should will now work with forums too. If you exclude a forum you won't be able to gain xp in any of the threads.
This commit is contained in:
		@@ -668,7 +668,7 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
 | 
			
		||||
    /// <param name="channel"></param>
 | 
			
		||||
    private async Task ScanUserForVoiceXp(SocketGuildUser user, SocketVoiceChannel channel)
 | 
			
		||||
    {
 | 
			
		||||
        if (UserParticipatingInVoiceChannel(user) && ShouldTrackXp(user, channel.Id))
 | 
			
		||||
        if (UserParticipatingInVoiceChannel(user) && ShouldTrackXp(user, channel))
 | 
			
		||||
            await UserJoinedVoiceChannel(user);
 | 
			
		||||
        else
 | 
			
		||||
            await UserLeftVoiceChannel(user, channel);
 | 
			
		||||
@@ -767,9 +767,12 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
 | 
			
		||||
    }
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
    private bool ShouldTrackXp(SocketGuildUser user, ulong channelId)
 | 
			
		||||
    private bool ShouldTrackXp(SocketGuildUser user, IMessageChannel channel)
 | 
			
		||||
    {
 | 
			
		||||
        if (_excludedChannels.TryGetValue(user.Guild.Id, out var chans) && chans.Contains(channelId))
 | 
			
		||||
        var channelId = channel.Id;
 | 
			
		||||
        
 | 
			
		||||
        if (_excludedChannels.TryGetValue(user.Guild.Id, out var chans) && (chans.Contains(channelId) 
 | 
			
		||||
            || (channel is SocketThreadChannel tc && chans.Contains(tc.ParentChannel.Id))))
 | 
			
		||||
            return false;
 | 
			
		||||
 | 
			
		||||
        if (_excludedServers.Contains(user.Guild.Id))
 | 
			
		||||
@@ -788,7 +791,7 @@ public class XpService : INService, IReadyExecutor, IExecNoCommand
 | 
			
		||||
 | 
			
		||||
        _ = Task.Run(async () =>
 | 
			
		||||
        {
 | 
			
		||||
            if (!ShouldTrackXp(user, arg.Channel.Id))
 | 
			
		||||
            if (!ShouldTrackXp(user, arg.Channel))
 | 
			
		||||
                return;
 | 
			
		||||
 | 
			
		||||
            var xpConf = _xpConfig.Data;
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ public class YtdlOperation
 | 
			
		||||
        }
 | 
			
		||||
        catch (Win32Exception)
 | 
			
		||||
        {
 | 
			
		||||
            Log.Error("youtube-dl is likely not installed. " + "Please install it before running the command again");
 | 
			
		||||
            Log.Error("youtube-dl is likely not installed. Please install it before running the command again");
 | 
			
		||||
            return default;
 | 
			
		||||
        }
 | 
			
		||||
        catch (Exception ex)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user