Skip to content

Commit

Permalink
Get chatbots from the original Dialog Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelWTF committed Nov 25, 2024
1 parent 4c3f3ca commit 7afae29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/controllers/FikaDialogueController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { IFriendRequestListResponse } from "../models/eft/dialog/IFriendRequestL
@injectable()
export class FikaDialogueController {
constructor(
@injectAll("DialogueChatBot") protected dialogueChatBots: IDialogueChatBot[],
@inject("ProfileHelper") protected profileHelper: ProfileHelper,
@inject("ConfigServer") protected configServer: ConfigServer,
@inject("FikaFriendRequestsHelper") protected fikaFriendRequestsHelper: FikaFriendRequestsHelper,
Expand All @@ -40,7 +39,9 @@ export class FikaDialogueController {

public getFriendList(sessionID: string): IGetFriendListDataResponse {
const core = this.configServer.getConfig<ICoreConfig>(ConfigTypes.CORE);
let botsAndFriends = this.dialogueChatBots.map((v) => v.getChatBot());
// Cast to any to get rid of protected error
const dialogueChatBots: IDialogueChatBot[] = (this.dialogController as any).dialogueChatBots;
let botsAndFriends = dialogueChatBots.map((v) => v.getChatBot());
if (!core.features.chatbotFeatures.commandoEnabled) {
botsAndFriends = botsAndFriends.filter((u) => u._id != "sptCommando");
}
Expand Down

0 comments on commit 7afae29

Please sign in to comment.