From 60fdb19903cc40c9fcae50df3a6f19480f455f3e Mon Sep 17 00:00:00 2001 From: Lacyway <20912169+Lacyway@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:16:29 +0200 Subject: [PATCH] Fix 'Commando' and 'SPT' bot commands not working --- src/controllers/FikaDialogueController.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/controllers/FikaDialogueController.ts b/src/controllers/FikaDialogueController.ts index 80c70f35..7b2954f0 100644 --- a/src/controllers/FikaDialogueController.ts +++ b/src/controllers/FikaDialogueController.ts @@ -75,13 +75,14 @@ export class FikaDialogueController { } public sendMessage(sessionID: string, request: ISendMessageRequest): string { - const receiverProfile = this.saveServer.getProfile(request.dialogId); - if (!receiverProfile) { - // if it's not to another player let Aki handle it + const profiles = this.saveServer.getProfiles(); + if (!(sessionID in profiles) || !(request.dialogId in profiles)) { + // if it's not to another player let SPT handle it return DialogueController.prototype.sendMessage.call(this.dialogController, sessionID, request); } - const senderProfile = this.saveServer.getProfile(sessionID); + const receiverProfile = profiles[request.dialogId]; + const senderProfile = profiles[sessionID]; if (!(request.dialogId in senderProfile.dialogues)) { senderProfile.dialogues[request.dialogId] = { attachmentsNew: 0, @@ -271,4 +272,4 @@ export class FikaDialogueController { public unIgnoreFriend(fromId: string, friendId: string): void { this.fikaPlayerRelationsHelper.removeFromIgnoreList(fromId, friendId); } -} +} \ No newline at end of file