Skip to content

Commit

Permalink
Change logging, re-enable log parser, and fix filter extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sschr15 committed Dec 18, 2023
1 parent 7c948a3 commit 2cac632
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
7 changes: 5 additions & 2 deletions src/main/kotlin/org/quiltmc/community/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import dev.kord.gateway.ALL
import dev.kord.gateway.Intents
import dev.kord.gateway.PrivilegedIntent
import dev.kord.rest.builder.message.embed
import org.quiltmc.community.cozy.modules.logs.extLogParser
import org.quiltmc.community.cozy.modules.logs.processors.PiracyProcessor
import org.quiltmc.community.cozy.modules.logs.processors.ProblematicLauncherProcessor
import org.quiltmc.community.cozy.modules.tags.TagFormatter
import org.quiltmc.community.cozy.modules.tags.config.TagsConfig
import org.quiltmc.community.cozy.modules.tags.tags
Expand All @@ -38,6 +41,8 @@ import org.quiltmc.community.database.collections.TagsCollection
import org.quiltmc.community.database.collections.WelcomeChannelCollection
import org.quiltmc.community.database.entities.InvalidMention
import org.quiltmc.community.database.getSettings
import org.quiltmc.community.logs.NonQuiltLoaderProcessor
import org.quiltmc.community.logs.RuleBreakingModProcessor
import org.quiltmc.community.modes.quilt.extensions.*
import org.quiltmc.community.modes.quilt.extensions.filtering.FilterExtension
import org.quiltmc.community.modes.quilt.extensions.github.GithubExtension
Expand Down Expand Up @@ -96,7 +101,6 @@ suspend fun setupLadysnake() = ExtensibleBot(DISCORD_TOKEN) {

extPluralKit()

/* temporarily disabled because upstream needs updating
extLogParser {
// Bundled non-default processors
processor(PiracyProcessor())
Expand Down Expand Up @@ -154,7 +158,6 @@ suspend fun setupLadysnake() = ExtensibleBot(DISCORD_TOKEN) {
//
// globalPredicate(::predicate)
}
*/

help {
enableBundledExtension = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import org.quiltmc.community.database.collections.FilterEventCollection
import org.quiltmc.community.database.collections.GlobalSettingsCollection
import org.quiltmc.community.database.collections.ServerSettingsCollection
import org.quiltmc.community.database.entities.FilterEntry
import org.quiltmc.community.database.getSettings
import java.util.*
import kotlin.time.Duration.Companion.minutes

Expand Down Expand Up @@ -997,14 +998,16 @@ class FilterExtension : Extension() {

guild.getFilterLogChannel()?.createMessage {
if (pingStaff) {
val modRole = when (guild.id) {
LADYSNAKE_GUILD -> guild.getRole(LADYSNAKE_MODERATOR_ROLE)
YOUTUBE_GUILD -> guild.getRole(YOUTUBE_MODERATOR_ROLE)
// val modRole = when (guild.id) {
// LADYSNAKE_GUILD -> guild.getRole(LADYSNAKE_MODERATOR_ROLE)
// YOUTUBE_GUILD -> guild.getRole(YOUTUBE_MODERATOR_ROLE)
//
// else -> null
// }

else -> null
}
val modRoles = guild.getSettings()?.moderatorRoles

content = modRole?.mention
content = modRoles?.joinToString(" ") { "<@&${it.value}>" }
?: "**Warning:** This filter shouldn't have triggered on this server! This is a bug!"
}

Expand Down
18 changes: 1 addition & 17 deletions src/main/resources/logback.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,9 @@ appender("CONSOLE", ConsoleAppender) {

if (logUrl != null) {
appender("DISCORD_ALL", DiscordLogAppender) {
level = INFO
url = System.getenv("DISCORD_LOGGER_URL")
}

appender("DISCORD_WARN", DiscordLogAppender) {
level = WARN
url = System.getenv("DISCORD_LOGGER_URL")
}

logger(
"org.quiltmc.community.modes.quilt.extensions.messagelog.MessageLogExtension",
TRACE,
["DISCORD_ALL"]
)

logger(
"org.quiltmc.community.AppKt.setupQuilt.extLogParser.predicate",
DEBUG,
["DISCORD_WARN"]
)
}

root(defaultLevel, ["CONSOLE"])

0 comments on commit 2cac632

Please sign in to comment.