@@ -54,7 +54,9 @@ export class DifyController extends ChatbotController implements ChatbotControll
5454 ! data . stopBotFromMe ||
5555 ! data . keepOpen ||
5656 ! data . debounceTime ||
57- ! data . ignoreJids
57+ ! data . ignoreJids ||
58+ ! data . splitMessages ||
59+ ! data . timePerChar
5860 ) {
5961 const defaultSettingCheck = await this . settingsRepository . findFirst ( {
6062 where : {
@@ -71,6 +73,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
7173 if ( ! data . keepOpen ) data . keepOpen = defaultSettingCheck ?. keepOpen || false ;
7274 if ( ! data . debounceTime ) data . debounceTime = defaultSettingCheck ?. debounceTime || 0 ;
7375 if ( ! data . ignoreJids ) data . ignoreJids = defaultSettingCheck ?. ignoreJids || [ ] ;
76+ if ( ! data . splitMessages ) data . splitMessages = defaultSettingCheck ?. splitMessages || false ;
77+ if ( ! data . timePerChar ) data . timePerChar = defaultSettingCheck ?. timePerChar || 0 ;
7478
7579 if ( ! defaultSettingCheck ) {
7680 await this . settings ( instance , {
@@ -83,6 +87,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
8387 keepOpen : data . keepOpen ,
8488 debounceTime : data . debounceTime ,
8589 ignoreJids : data . ignoreJids ,
90+ splitMessages : data . splitMessages ,
91+ timePerChar : data . timePerChar ,
8692 } ) ;
8793 }
8894 }
@@ -168,6 +174,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
168174 triggerOperator : data . triggerOperator ,
169175 triggerValue : data . triggerValue ,
170176 ignoreJids : data . ignoreJids ,
177+ splitMessages : data . splitMessages ,
178+ timePerChar : data . timePerChar ,
171179 } ,
172180 } ) ;
173181
@@ -349,6 +357,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
349357 triggerOperator : data . triggerOperator ,
350358 triggerValue : data . triggerValue ,
351359 ignoreJids : data . ignoreJids ,
360+ splitMessages : data . splitMessages ,
361+ timePerChar : data . timePerChar ,
352362 } ,
353363 } ) ;
354364
@@ -438,6 +448,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
438448 debounceTime : data . debounceTime ,
439449 difyIdFallback : data . difyIdFallback ,
440450 ignoreJids : data . ignoreJids ,
451+ splitMessages : data . splitMessages ,
452+ timePerChar : data . timePerChar ,
441453 } ,
442454 } ) ;
443455
@@ -452,6 +464,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
452464 debounceTime : updateSettings . debounceTime ,
453465 difyIdFallback : updateSettings . difyIdFallback ,
454466 ignoreJids : updateSettings . ignoreJids ,
467+ splitMessages : updateSettings . splitMessages ,
468+ timePerChar : updateSettings . timePerChar ,
455469 } ;
456470 }
457471
@@ -468,6 +482,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
468482 difyIdFallback : data . difyIdFallback ,
469483 ignoreJids : data . ignoreJids ,
470484 instanceId : instanceId ,
485+ splitMessages : data . splitMessages ,
486+ timePerChar : data . timePerChar ,
471487 } ,
472488 } ) ;
473489
@@ -482,6 +498,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
482498 debounceTime : newSetttings . debounceTime ,
483499 difyIdFallback : newSetttings . difyIdFallback ,
484500 ignoreJids : newSetttings . ignoreJids ,
501+ splitMessages : newSetttings . splitMessages ,
502+ timePerChar : newSetttings . timePerChar ,
485503 } ;
486504 } catch ( error ) {
487505 this . logger . error ( error ) ;
@@ -520,6 +538,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
520538 stopBotFromMe : false ,
521539 keepOpen : false ,
522540 ignoreJids : [ ] ,
541+ splitMessages : false ,
542+ timePerChar : 0 ,
523543 difyIdFallback : '' ,
524544 fallback : null ,
525545 } ;
@@ -534,6 +554,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
534554 stopBotFromMe : settings . stopBotFromMe ,
535555 keepOpen : settings . keepOpen ,
536556 ignoreJids : settings . ignoreJids ,
557+ splitMessages : settings . splitMessages ,
558+ timePerChar : settings . timePerChar ,
537559 difyIdFallback : settings . difyIdFallback ,
538560 fallback : settings . Fallback ,
539561 } ;
@@ -763,6 +785,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
763785 let keepOpen = findBot ?. keepOpen ;
764786 let debounceTime = findBot ?. debounceTime ;
765787 let ignoreJids = findBot ?. ignoreJids ;
788+ let splitMessages = findBot ?. splitMessages ;
789+ let timePerChar = findBot ?. timePerChar ;
766790
767791 if ( ! expire ) expire = settings . expire ;
768792 if ( ! keywordFinish ) keywordFinish = settings . keywordFinish ;
@@ -771,8 +795,10 @@ export class DifyController extends ChatbotController implements ChatbotControll
771795 if ( ! listeningFromMe ) listeningFromMe = settings . listeningFromMe ;
772796 if ( ! stopBotFromMe ) stopBotFromMe = settings . stopBotFromMe ;
773797 if ( ! keepOpen ) keepOpen = settings . keepOpen ;
774- if ( ! debounceTime ) debounceTime = settings . debounceTime ;
798+ if ( debounceTime === undefined || debounceTime === null ) debounceTime = settings . debounceTime ;
775799 if ( ! ignoreJids ) ignoreJids = settings . ignoreJids ;
800+ if ( splitMessages === undefined || splitMessages === null ) splitMessages = settings ?. splitMessages ?? false ;
801+ if ( timePerChar === undefined || timePerChar === null ) timePerChar = settings ?. timePerChar ?? 0 ;
776802
777803 const key = msg . key as {
778804 id : string ;
@@ -819,6 +845,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
819845 keepOpen,
820846 debounceTime,
821847 ignoreJids,
848+ splitMessages,
849+ timePerChar,
822850 } ,
823851 debouncedContent ,
824852 msg ?. pushName ,
@@ -841,6 +869,8 @@ export class DifyController extends ChatbotController implements ChatbotControll
841869 keepOpen,
842870 debounceTime,
843871 ignoreJids,
872+ splitMessages,
873+ timePerChar,
844874 } ,
845875 content ,
846876 msg ?. pushName ,
0 commit comments