Skip to content

Commit

Permalink
Improve SPT chatbot handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelWTF committed Jan 30, 2025
1 parent b4ac57d commit 7d3059d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/controllers/FikaDialogueController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class FikaDialogueController {
@inject("ConfigServer") protected configServer: ConfigServer,
@inject("FikaFriendRequestsHelper") protected fikaFriendRequestsHelper: FikaFriendRequestsHelper,
@inject("FikaPlayerRelationsHelper") protected fikaPlayerRelationsHelper: FikaPlayerRelationsHelper,
@inject("DialogueController") protected dialogController: DialogueController,
@inject("DialogueController") protected dialogueController: DialogueController,
@inject("SaveServer") protected saveServer: SaveServer,
@inject("HashUtil") protected hashUtil: HashUtil,
@inject("TimeUtil") protected timeUtil: TimeUtil,
Expand All @@ -40,9 +40,7 @@ export class FikaDialogueController {
}

public getFriendList(sessionID: string): IGetFriendListDataResponse {
// Cast to any to get rid of protected error
const dialogueChatBots: IDialogueChatBot[] = (this.dialogController as any).dialogueChatBots;
let botsAndFriends = dialogueChatBots.map((v) => v.getChatBot());
let botsAndFriends = (this.dialogueController as any).getActiveChatBots();

const friendsIds = this.fikaPlayerRelationsHelper.getFriendsList(sessionID);

Expand Down Expand Up @@ -78,7 +76,7 @@ export class FikaDialogueController {
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);
return DialogueController.prototype.sendMessage.call(this.dialogueController, sessionID, request);
}

const receiverProfile = profiles[request.dialogId];
Expand Down

0 comments on commit 7d3059d

Please sign in to comment.