diff --git a/config.ini b/config.ini index c5b823a..2aa4129 100644 --- a/config.ini +++ b/config.ini @@ -1,8 +1,8 @@ # Ci configuration for GitHub Actions. [framework] -ver=3 +ver=1 [main] -ver=2.5.1 +ver=2.5.2 [release] test=0 [ci] diff --git a/matrix_sync/client/receiver.py b/matrix_sync/client/receiver.py index 7294c4a..2e0f488 100644 --- a/matrix_sync/client/receiver.py +++ b/matrix_sync/client/receiver.py @@ -18,7 +18,7 @@ async def message_callback(room: MatrixRoom, event: RoomMessageText) -> None: room_info.id = room.room_id room_info.display_name= room.display_name if event.sender != plg_globals.config["user_id"]: - event_dispatcher(MatrixMessageEvent, event.body, room.user_name(event.sender), room) + event_dispatcher(MatrixMessageEvent, event.body, room.user_name(event.sender), room_info) def on_sync_error(response: SyncError): logger = get_logger() diff --git a/matrix_sync/event/receiver.py b/matrix_sync/event/receiver.py index 1831138..f9408b0 100644 --- a/matrix_sync/event/receiver.py +++ b/matrix_sync/event/receiver.py @@ -7,11 +7,11 @@ def listen_message(server: PluginServerInterface): server.register_event_listener("MatrixRoomMessage", on_matrix_message) -def on_matrix_message(server, message: str, sender: str, room): +def on_matrix_message(server, message: str, sender: str, room_info): logger = get_logger() if plg_globals.settings["listen"]["all_rooms"]: message_format = plg_globals.settings["message_format"]["all_room"] - room_message = message_format.replace('%room_display_name%', room.display_name).replace('%sender%', sender).replace('%message%', message) + room_message = message_format.replace('%room_display_name%', room_info.display_name).replace('%sender%', sender).replace('%message%', message) else: message_format = plg_globals.settings["message_format"]["single_room"] room_message = message_format.replace('%sender%', sender).replace('%message%', message) diff --git a/matrix_sync/logger/get_logger.py b/matrix_sync/logger/get_logger.py index 5c45674..5ee9fa4 100644 --- a/matrix_sync/logger/get_logger.py +++ b/matrix_sync/logger/get_logger.py @@ -15,6 +15,9 @@ def warning(self, *args): def error(self, *args): psi.logger.error(args[0]) + def debug(self, *args): + psi.logger.debug(args[0]) + def get_logger(): if plg_globals.settings["log_style"]["mcdr"]: logger = psiLogger() diff --git a/mcdreforged.plugin.json b/mcdreforged.plugin.json index 31e80ea..2d314ac 100644 --- a/mcdreforged.plugin.json +++ b/mcdreforged.plugin.json @@ -1,6 +1,6 @@ { "id": "matrix_sync", - "version": "2.5.1", + "version": "2.5.2", "name": "MatrixSync", "description": { "en_us": "Sync messages between online game and Matrix groups.",