<commit_before>package com.mrpowergamerbr.loritta.website.views.subviews.api.config.types

import com.google.gson.JsonObject
import com.mrpowergamerbr.loritta.userdata.ServerConfig
import net.dv8tion.jda.core.entities.Guild

class TextChannelsPayload : ConfigPayloadType("text_channels") {
	override fun process(payload: JsonObject, serverConfig: ServerConfig, guild: Guild) {
		applyReflection(payload, serverConfig.joinLeaveConfig)
	}
}<commit_msg>Corrigir processamento de payloads de canais de texto<commit_after>package com.mrpowergamerbr.loritta.website.views.subviews.api.config.types

import com.github.salomonbrys.kotson.array
import com.github.salomonbrys.kotson.get
import com.github.salomonbrys.kotson.nullString
import com.google.gson.JsonObject
import com.mrpowergamerbr.loritta.userdata.ServerConfig
import com.mrpowergamerbr.loritta.userdata.TextChannelConfig
import net.dv8tion.jda.core.entities.Guild

class TextChannelsPayload : ConfigPayloadType("text_channels") {
	override fun process(payload: JsonObject, serverConfig: ServerConfig, guild: Guild) {
		serverConfig.textChannelConfigs.clear()
		val entries = payload["entries"].array

		for (entry in entries) {
			val id = entry["id"].nullString ?: continue

			val config = if (id == "default") {
				// Config default
				val textChannelConfig = TextChannelConfig("default")
				serverConfig.defaultTextChannelConfig = textChannelConfig
				textChannelConfig
			} else {
				val textChannelConfig = TextChannelConfig(id)
				serverConfig.textChannelConfigs.add(textChannelConfig)
				textChannelConfig
			}

			applyReflection(payload, config)
		}
	}
}
{'fraction_non_alphanumeric': 0.09225092250922509, 'fraction_numerical': 0.0012300123001230013, 'mean_word_length': 5.723140495867769, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4745865', 'n_tokens_mistral': 537, 'n_tokens_neox': 490, 'n_words': 88}