| 4467 | // TODO: Make all extension prompts use an array/splice method | 4467 | // TODO: Make all extension prompts use an array/splice method |
| 4468 | const lengthDiff = mesSend.length - cfgPrompt.depth; | 4468 | const lengthDiff = mesSend.length - cfgPrompt.depth; |
| 4469 | const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0; | 4469 | const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0; |
| 4470 | if (!Array.isArray(finalMesSend[cfgDepth].extensionPrompts)) { | 4470 | const cfgMessage = finalMesSend[cfgDepth]; |
| 4471 | finalMesSend[cfgDepth].extensionPrompts = []; | 4471 | if (cfgMessage) { |
| | 4472 | if (!Array.isArray(finalMesSend[cfgDepth].extensionPrompts)) { |
| | 4473 | finalMesSend[cfgDepth].extensionPrompts = []; |
| | 4474 | } |
| | 4475 | finalMesSend[cfgDepth].extensionPrompts.push(`${cfgPrompt.value}\n`); |
| 4472 | } | 4476 | } |
| 4473 | finalMesSend[cfgDepth].extensionPrompts.push(`${cfgPrompt.value}\n`); | | |
| 4474 | } | 4477 | } |
| 4475 | } | 4478 | } |
| 4476 | } | 4479 | } |