MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / sendBotCommand

Function sendBotCommand

web/js/chat.js:130–152  ·  view source on GitHub ↗
(cmdText)

Source from the content-addressed store, hash-verified

128}
129
130export async function sendBotCommand(cmdText) {
131 const chatArea = document.getElementById("chat-area");
132 if (chatArea.classList.contains("mode-welcome")) {
133 chatArea.classList.remove("mode-welcome");
134 chatArea.classList.add("mode-chat");
135 }
136
137 appendMessage("user", cmdText);
138 chatHistory.push({ role: "user", content: cmdText });
139
140 const sendBtn = document.getElementById("send-btn");
141 sendBtn.disabled = true;
142
143 currentAssistantMsg = appendMessage("assistant", "");
144 showLoadingIndicator();
145
146 try {
147 const socket = await getOrCreateWs();
148 socket.send(JSON.stringify({ text: cmdText }));
149 } catch (err) {
150 handleError(err.message);
151 }
152}
153
154// ========== Internal Rendering & WS logic ==========
155

Callers

nothing calls this directly

Calls 5

appendMessageFunction · 0.85
showLoadingIndicatorFunction · 0.85
getOrCreateWsFunction · 0.85
handleErrorFunction · 0.85
sendMethod · 0.45

Tested by

no test coverage detected