Skip to content

Commit

Permalink
保存
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Lqrs committed Dec 2, 2024
1 parent 5f387e0 commit 983ad25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,19 @@ object DiscordBotManager : ListenerAdapter() {
jda?.updateCommands()

botIsInitialized = true
// Discord bot is now online
Logger.info(LMB.getSysMessage(System.Log.BOT_ONLINE))
Fabricord.serverStartMessage?.let { sendToDiscord(it) }

if (Fabricord.messageStyle == "modern") {
if (!Fabricord.webHookId.isNullOrBlank()) {
webHook = jda?.retrieveWebhookById(Fabricord.webHookId!!)?.complete()
} else {
// The message style is set to 'modern' but the webhook URL is not configured.
Logger.error(LMB.getSysMessage(System.Log.WEBHOOK_NOT_CONFIGURED))
}
}
} catch (e: LoginException) {
//"Failed to login to Discord with the provided token"
Logger.error(LMB.getSysMessage(System.Log.FAILED_TO_LOGIN), e)
} catch (e: Exception) {
// "An unexpected error occurred during Discord bot startup"
Logger.error(LMB.getSysMessage(System.Log.FAILED_TO_START_BOT), e)
}
}
Expand All @@ -87,7 +83,6 @@ object DiscordBotManager : ListenerAdapter() {
jda?.shutdown()
botIsInitialized = false
} else {
// Discord bot is not initialized. Cannot stop the bot.
Logger.error(LMB.getSysMessage(System.Log.BOT_NOT_INITIALIZED))
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/fabricord/lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ system:
loading: "Loading %s v%s..."
enabling: "Enabling %s v%s..."
disabling: "Disabling %s v%s..."
bot_online: "Discord bot is now online"
initialized: "%s initialized successfully."
not_initialized: "MinecraftServer is not initialized. Cannot process /playerlist command."
bot_not_initialized: "Discord bot is not initialized. Cannot stop the bot."
missingrequiredparams:
- "Bot token or log channel ID is missing in config file."
- "Maybe you are running the mod for the first time?"
- "Please check the config file at %s"
stillstartingup: "Server is still starting up, please try again later."
failed_to_start: "Failed to start the bot: %s"
failed_to_stop: "Failed to stop the bot: %s"
failed_to_login: "Failed to login to Discord with the provided token"
failed_to_start_bot: "An unexpected error occurred during Discord bot startup"
webhook_not_configured: "The message style is set to 'modern' but the webhook URL is not configured."
checking_update: "Checking for updates..."
all_version_count: "There are %s available versions."
new_version_count: "There are %s newer versions than the current one."
Expand Down

0 comments on commit 983ad25

Please sign in to comment.