以前看到的解释是,点击发送键时识别到了多次。
但是,我在做小说的订阅功能时,用了如下代码:
async function f(u, s) {
await fetch("https://www.luogu.com.cn/api/chat/new", {
headers: [["content-type", "application/json"], ["referer", "https://www.luogu.com.cn/"], ["x-csrf-token", document.querySelector("meta[name=csrf-token]").content], ],
body: JSON.stringify({
user: u,
content: s,
}),
method: "POST",
});
}
(function() {
var str="【自动发送】OI 之路更新啦!快来看看吧!\n>-- https://www.luogu.com.cn/article/lv15w0ny --<";
f(1334245, str)
}
)();
(由 cff_0102 的炸铃程序改编。如果想要测试,请把倒数第三行的 1334245(订阅的人的 UID)改为 911054(我),不要炸 Han_Si_Ying)
然而还是出现了:

(有概率出来,如果不行多试几遍。刷新就好了。)
说明不是 Enter 键或者点击“发送”的问题。