Skip to content

Commit

Permalink
Fix 'Commando' and 'SPT' bot commands not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Jul 16, 2024
1 parent b8102bf commit 60fdb19
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/controllers/FikaDialogueController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -271,4 +272,4 @@ export class FikaDialogueController {
public unIgnoreFriend(fromId: string, friendId: string): void {
this.fikaPlayerRelationsHelper.removeFromIgnoreList(fromId, friendId);
}
}
}

0 comments on commit 60fdb19

Please sign in to comment.