feat(bot): support threads for logs (#541)
This commit is contained in:
		@@ -46,7 +46,7 @@ public class ServerConfig
 | 
			
		||||
        var channelString = ctx.PeekArgument();
 | 
			
		||||
        channel = await ctx.MatchChannel();
 | 
			
		||||
        if (channel == null || channel.GuildId != ctx.Guild.Id) throw Errors.ChannelNotFound(channelString);
 | 
			
		||||
        if (channel.Type != Channel.ChannelType.GuildText)
 | 
			
		||||
        if (channel.Type != Channel.ChannelType.GuildText && channel.Type != Channel.ChannelType.GuildPublicThread && channel.Type != Channel.ChannelType.GuildPrivateThread)
 | 
			
		||||
            throw new PKError("PluralKit cannot log messages to this type of channel.");
 | 
			
		||||
 | 
			
		||||
        var perms = await _cache.PermissionsIn(channel.Id);
 | 
			
		||||
 
 | 
			
		||||
@@ -75,7 +75,7 @@ public class LogChannelService
 | 
			
		||||
 | 
			
		||||
        // Find log channel and check if valid
 | 
			
		||||
        var logChannel = await FindLogChannel(guildId, logChannelId.Value);
 | 
			
		||||
        if (logChannel == null || logChannel.Type != Channel.ChannelType.GuildText) return null;
 | 
			
		||||
        if (logChannel == null || logChannel.Type != Channel.ChannelType.GuildText && logChannel.Type != Channel.ChannelType.GuildPublicThread && logChannel.Type != Channel.ChannelType.GuildPrivateThread) return null;
 | 
			
		||||
 | 
			
		||||
        // Check bot permissions
 | 
			
		||||
        var perms = await GetPermissionsInLogChannel(logChannel);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user