From cc782ba3d503d7d6685a76043608df02ca4c3c8f Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 31 Oct 2024 22:07:31 +0000 Subject: [PATCH] Updated chatbots to use Monogo_Ids --- project/assets/configs/core.json | 6 +++++- project/src/controllers/DialogueController.ts | 6 ++++-- project/src/helpers/Dialogue/CommandoDialogueChatBot.ts | 2 +- project/src/helpers/Dialogue/SptDialogueChatBot.ts | 2 +- project/src/models/spt/config/ICoreConfig.ts | 1 + 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/project/assets/configs/core.json b/project/assets/configs/core.json index 1b8f40b8..51704025 100644 --- a/project/assets/configs/core.json +++ b/project/assets/configs/core.json @@ -30,7 +30,11 @@ }, "commandUseLimits": { "StashRows": 15 - } + }, + "ids": { + "commando": "6723fd51c5924c57ce0ca01e", + "spt": "6723fd51c5924c57ce0ca01f" + } }, "createNewProfileTypesBlacklist": [] }, diff --git a/project/src/controllers/DialogueController.ts b/project/src/controllers/DialogueController.ts index 925f54aa..582ee197 100644 --- a/project/src/controllers/DialogueController.ts +++ b/project/src/controllers/DialogueController.ts @@ -35,12 +35,14 @@ export class DialogueController { // if give command is disabled or commando commands are disabled if (!coreConfigs.features?.chatbotFeatures?.commandoEnabled) { const sptCommando = this.dialogueChatBots.find( - (c) => c.getChatBot()._id.toLocaleLowerCase() === "sptcommando", + (c) => c.getChatBot()._id.toLocaleLowerCase() === coreConfigs.features?.chatbotFeatures.ids.commando, ); this.dialogueChatBots.splice(this.dialogueChatBots.indexOf(sptCommando), 1); } if (!coreConfigs.features?.chatbotFeatures?.sptFriendEnabled) { - const sptFriend = this.dialogueChatBots.find((c) => c.getChatBot()._id.toLocaleLowerCase() === "sptFriend"); + const sptFriend = this.dialogueChatBots.find( + (c) => c.getChatBot()._id.toLocaleLowerCase() === coreConfigs.features?.chatbotFeatures.ids.spt, + ); this.dialogueChatBots.splice(this.dialogueChatBots.indexOf(sptFriend), 1); } } diff --git a/project/src/helpers/Dialogue/CommandoDialogueChatBot.ts b/project/src/helpers/Dialogue/CommandoDialogueChatBot.ts index ecb68874..c339edb7 100644 --- a/project/src/helpers/Dialogue/CommandoDialogueChatBot.ts +++ b/project/src/helpers/Dialogue/CommandoDialogueChatBot.ts @@ -18,7 +18,7 @@ export class CommandoDialogueChatBot extends AbstractDialogueChatBot { public getChatBot(): IUserDialogInfo { return { - _id: "sptCommando", + _id: "6723fd51c5924c57ce0ca01e", aid: 1234567, Info: { Level: 1, diff --git a/project/src/helpers/Dialogue/SptDialogueChatBot.ts b/project/src/helpers/Dialogue/SptDialogueChatBot.ts index a844082a..737af204 100644 --- a/project/src/helpers/Dialogue/SptDialogueChatBot.ts +++ b/project/src/helpers/Dialogue/SptDialogueChatBot.ts @@ -32,7 +32,7 @@ export class SptDialogueChatBot implements IDialogueChatBot { public getChatBot(): IUserDialogInfo { return { - _id: "sptFriend", + _id: "6723fd51c5924c57ce0ca01f", aid: 1234566, Info: { Level: 1, diff --git a/project/src/models/spt/config/ICoreConfig.ts b/project/src/models/spt/config/ICoreConfig.ts index 562253d1..0fdc727a 100644 --- a/project/src/models/spt/config/ICoreConfig.ts +++ b/project/src/models/spt/config/ICoreConfig.ts @@ -92,6 +92,7 @@ export interface IChatbotFeatures { commandoEnabled: boolean; commandoFeatures: ICommandoFeatures; commandUseLimits: Record; + ids: Record; } export interface ICommandoFeatures {