import { DialogLanguageModule } from '../@types/dialogLanguage' ; import { SendMessageData , UIManagmentData } from '../@types/uiEvents' ; import { msgPrepare } from './regExp' ; export const resultControl = async ( module , result ) => { if ( result ?. text ?. value && result ?. context ) { const text = msgPrepare ( result . text . value , result . context ) ; const data = { text : text , sender : 'request' , showRate : result ?. text ?. showRate , module : module . name , } ; const wflagHideReply = result . context ?. wflag_hide_reply !== '1' ; wflagHideReply && text && ( await module . uiDispatcher ( 'sendMessage' , data ) ) ; } if ( result ?. text ?. showRate ) { const data = { uiManagmentEvent : 'showRate' , data : true , } ; await module . uiDispatcher ( 'uiManagment' , data ) ; } } ;