Skip to content

Commit

Permalink
Update AntiRaidModule errors to get more info about the error
Browse files Browse the repository at this point in the history
WinG4merBR committed Jan 8, 2025
1 parent a17f58a commit 4c9eab9
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import net.dv8tion.jda.api.hooks.ListenerAdapter
import kotlin.reflect.jvm.jvmName

class MajorEventListener(private val foxy: FoxyInstance): ListenerAdapter() {
private val logger = KotlinLogging.logger(this::class.jvmName)
private val coroutineScope = CoroutineScope(Dispatchers.Default + SupervisorJob())
private val antiRaid = AntiRaidModule(foxy)
private val topggStats = TopggStatsSender(foxy)
@@ -24,6 +25,8 @@ class MajorEventListener(private val foxy: FoxyInstance): ListenerAdapter() {
OnlineStatus.ONLINE,
Activity.customStatus(Constants.DEFAULT_ACTIVITY(foxy.environment)))

logger.info { "Shard #${event.jda.shardInfo.shardId} is ready!" }

if (foxy.environment == "production") {
topggStats.send(event.jda.guildCache.size())
}
Original file line number Diff line number Diff line change
@@ -212,7 +212,7 @@ class AntiRaidModule(
else -> throw IllegalArgumentException("Invalid action type! Received $action")
}
} catch (e: Exception) {
logger.warn { "Can't take an action for user ${user.id}! Missing permissions?" }
logger.warn { "Can't take an action for user ${user.id} on guild ${guild.id}! Missing permissions? ${e.message}" }
}
}

0 comments on commit 4c9eab9

Please sign in to comment.