Skip to content

Commit

Permalink
Merge branch 'develop' into version/1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Erdragh committed Feb 8, 2025
2 parents e48ac37 + 82750e6 commit 7aa70eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
- Show better error message if FAQ is too long
- Limit the autocomplete suggestion return value length to fix no options showing up
- Added the `/listfaq` command
- Fixed the config wrongly storing guild and role id
- Fixed the config getting synced to the client (You may need to move the config from `world/serverconfig` to `config`)
- Headpat command now outputs a GIF thanks to @femmeromantic

# 1.5.2
Fix tps command using wrong numbers for calculation
Expand Down
10 changes: 6 additions & 4 deletions common/src/main/kotlin/dev/erdragh/astralbot/Bot.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -90,13 +90,15 @@ 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.")
return
}
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()
Expand Down

0 comments on commit 7aa70eb

Please sign in to comment.