MCPcopy Create free account
hub / github.com/NsLearning/LangHelper / Helper_SendMessage

Function Helper_SendMessage

ChatGPT/src-tauri/src/scripts/chat.js:360–379  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

358 }
359}
360function Helper_SendMessage(text){
361 // Put message in textarea
362 var textarea = document.querySelector("textarea");
363 if (!textarea) return;
364 textarea.focus();
365 // fix the send message can't be clicked due to recognition input without keybord input.
366 textarea.parentNode.querySelector("button").disabled =false;
367 var existingText = textarea.value;
368
369 // Is there already existing text?
370 if (!existingText) textarea.value = text;
371 else textarea.value = existingText + " " + text;
372
373 // Change height in case
374 var fullText = existingText + " " + text;
375 var rows = Math.ceil(fullText.length / 88);
376 var height = rows * 24;
377 textarea.style.height = height + "px";
378
379}
380// Check for new messages the ChatGPT bot has sent.
381// If a new message is found, it will be read out loud.
382function Helper_CheckNewMessages(){

Callers 2

Speech_AssessmentFunction · 0.85
SpeechRecognitionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected