Skip to content

Conversation

@nova-27
Copy link
Owner

@nova-27 nova-27 commented Mar 30, 2025

config.ymlの変更点

consoleChannel:
  channelId: -1
  logFormat: "[{time} {level}] {message}"
  allowDispatchCommand: true

channelIdのチャンネルにBungeeCordコンソールログをlogFormatの形式で転送する
allowDispatchCommandがtrueならチャンネルからBungeeCordのコマンドを実行できるようにする

@nova-27 nova-27 self-assigned this Mar 30, 2025
@nova-27 nova-27 added the enhancement New feature or request label Mar 30, 2025
@nova-27 nova-27 requested a review from Copilot March 30, 2025 16:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds functionality to forward BungeeCord console logs to Discord, while also enabling command dispatch from a designated channel.

  • Added consoleChannel configuration in config.yml.
  • Refactored BotManager to support multiple channel types and updated message sending methods accordingly.
  • Introduced BungeeLoggingListener to format and forward console logs and updated related listeners and the main plugin class.

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main/resources/config.yml Added new consoleChannel configuration options.
src/main/java/work/novablog/mcplugin/discordconnect/util/Message.java Added a new enum value for dispatching commands.
src/main/java/work/novablog/mcplugin/discordconnect/util/BotManager.java Refactored channel handling to support CHAT, CONSOLE, and ALL channel types.
src/main/java/work/novablog/mcplugin/discordconnect/listener/LunaChatListener.java Updated to use the new sendMessageToChannel method.
src/main/java/work/novablog/mcplugin/discordconnect/listener/DiscordListener.java Added command dispatch handling for designated channels.
src/main/java/work/novablog/mcplugin/discordconnect/listener/ChatCasterListener.java Updated to use the new sendMessageToChannel method.
src/main/java/work/novablog/mcplugin/discordconnect/listener/BungeeLoggingListener.java Introduced new listener to forward formatted console log messages.
src/main/java/work/novablog/mcplugin/discordconnect/listener/BungeeListener.java Updated to use the new sendMessageToChannel method.
src/main/java/work/novablog/mcplugin/discordconnect/DiscordConnect.java Modified to incorporate console channel configuration and register the logging listener.
Files not reviewed (1)
  • src/main/resources/ja_JP.properties: Language not supported
Comments suppressed due to low confidence (1)

src/main/java/work/novablog/mcplugin/discordconnect/util/BotManager.java:127

  • [nitpick] Consider renaming the local variable 'channelIds' in the loop (e.g., to 'ids') to avoid shadowing the instance field 'channelIds'.
for (ChannelType type : channelIds.keySet()) {

@nova-27 nova-27 merged commit 712ced6 into develop Mar 30, 2025
1 check passed
@nova-27 nova-27 deleted the 19-コンソールログを転送する branch March 30, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants