MCPcopy Create free account
hub / github.com/dajie111/nodeseek-userscript / editReplyText

Function editReplyText

quickReply.js:235–250  ·  view source on GitHub ↗
(categoryName, oldText, newText)

Source from the content-addressed store, hash-verified

233
234 // 编辑回复文本
235 function editReplyText(categoryName, oldText, newText) {
236 if (!newText || newText.trim() === '' || oldText === newText) return false;
237
238 const replies = getQuickReplies();
239 if (!replies[categoryName]) return false;
240
241 const trimmedNewText = newText.trim();
242 const index = replies[categoryName].indexOf(oldText);
243
244 if (index > -1 && !replies[categoryName].includes(trimmedNewText)) {
245 replies[categoryName][index] = trimmedNewText;
246 setQuickReplies(replies);
247 return true;
248 }
249 return false;
250 }
251
252 // 重新排序分类中的回复
253 function reorderRepliesInCategory(categoryName, newOrder) {

Callers 1

editQuickReplyFunction · 0.85

Calls 2

getQuickRepliesFunction · 0.85
setQuickRepliesFunction · 0.85

Tested by

no test coverage detected