Process chat messages correctly when using /ss commands

This commit is contained in:
Loporrit
2025-07-25 22:06:14 +00:00
parent 4b6978c1c7
commit b5d5892ec3
2 changed files with 44 additions and 6 deletions

View File

@@ -45,7 +45,20 @@ public class ChatService : DisposableMediatorSubscriberBase
Mediator.Subscribe<UserChatMsgMessage>(this, HandleUserChat);
Mediator.Subscribe<GroupChatMsgMessage>(this, HandleGroupChat);
_gameChatHooks = new(() => new GameChatHooks(loggerFactory.CreateLogger<GameChatHooks>(), gameInteropProvider));
_gameChatHooks = new(() => new GameChatHooks(loggerFactory.CreateLogger<GameChatHooks>(), gameInteropProvider, SendChatShell));
// Initialize chat hooks in advance
_ = Task.Run(() =>
{
try
{
_ = _gameChatHooks.Value;
}
catch (Exception ex)
{
_logger.LogError(ex, "Failed to initialize chat hooks");
}
});
}
protected override void Dispose(bool disposing)