diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt b/common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt index 35af1f6..9e2342d 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt @@ -1,11 +1,10 @@ package dev.erdragh.astralbot -import com.mojang.logging.LogUtils -import dev.erdragh.astralbot.listeners.CommandHandlingListener -import dev.erdragh.astralbot.listeners.UserEventListener import dev.erdragh.astralbot.config.AstralBotConfig import dev.erdragh.astralbot.handlers.FAQHandler import dev.erdragh.astralbot.handlers.MinecraftHandler +import dev.erdragh.astralbot.listeners.CommandHandlingListener +import dev.erdragh.astralbot.listeners.UserEventListener import kotlinx.coroutines.* import net.dv8tion.jda.api.JDA import net.dv8tion.jda.api.JDABuilder @@ -14,6 +13,7 @@ import net.dv8tion.jda.api.entities.Guild import net.dv8tion.jda.api.entities.channel.concrete.TextChannel import net.dv8tion.jda.api.requests.GatewayIntent import net.minecraft.server.MinecraftServer +import org.slf4j.LoggerFactory import java.io.File import java.time.Duration import java.time.LocalDateTime @@ -22,7 +22,7 @@ import kotlin.io.path.absolute import kotlin.properties.Delegates const val MODID = "astralbot" -val LOGGER = LogUtils.getLogger() +val LOGGER = LoggerFactory.getLogger(MODID) private lateinit var startTimestamp: LocalDateTime var minecraftHandler: MinecraftHandler? = null @@ -90,6 +90,7 @@ private fun setupFromJDA(api: JDA) { LOGGER.warn("Configured Discord Guild (server) ID is not valid.") return } + LOGGER.info("Running with Guild '${g.name}' (${g.id})") val ch = g.getTextChannelById(AstralBotConfig.DISCORD_CHANNEL.get()) if (ch == null) { LOGGER.warn("Configured Discord channel ID is not valid.") @@ -97,6 +98,7 @@ private fun setupFromJDA(api: JDA) { } textChannel = ch guild = g + LOGGER.info("Chat sync configured in channel '${ch.name}' (${ch.id})") // Text channel was fetched, now the minecraftHandler can fetch its webhook stuff minecraftHandler?.updateWebhookClient() diff --git a/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt b/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt index 055e1f7..3c41159 100644 --- a/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt +++ b/common/src/main/kotlin/dev/erdragh/astralbot/config/AstralBotConfig.kt @@ -141,9 +141,9 @@ object AstralBotConfig { DISCORD_CHANNEL = builder.comment("Channel ID where the chat messages are synced") .defineInRange("discordChannel", 0L, 0L, Long.MAX_VALUE) DISCORD_GUILD = builder.comment("Guild (server) ID where the chat messages etc. are synced") - .defineInRange("discordChannel", 0L, 0L, Long.MAX_VALUE) + .defineInRange("discordGuild", 0L, 0L, Long.MAX_VALUE) DISCORD_ROLE = builder.comment("ID of the role given to linked users") - .defineInRange("discordChannel", 0L, 0L, Long.MAX_VALUE) + .defineInRange("discordRole", 0L, 0L, Long.MAX_VALUE) CLICKABLE_MESSAGES = builder.comment("Whether to make messages sent into the Minecraft chat open the Discord chat when clicked")