Skip to content

Instantly share code, notes, and snippets.

@shugen002
Created May 22, 2021 18:17
Show Gist options
  • Save shugen002/9e7b4c17ed2b4c7439996c63708c10bc to your computer and use it in GitHub Desktop.
Save shugen002/9e7b4c17ed2b4c7439996c63708c10bc to your computer and use it in GitHub Desktop.
开黑啦伪禁言
function deleteMessage(id) {
fetch("https://www.kaiheila.cn/api/v2/messages/0/" + id,
{
"credentials": "include",
"headers": {
"accept": "*/*",
"accept-language": "zh-CN",
"content-type": "application/json; charset=utf-8",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "cross-site"
},
"referrer": "https://www.kaiheila.cn/app/channels/3542195235225538/1249326663618367", "referrerPolicy": "no-referrer-when-downgrade",
"body": null,
"method": "DELETE",
"mode": "cors"
});
}
var deleteList=["2832266498","1934063269"]
var handler = function (e) {
if (e.type == "CHANNEL_MSG") {
if (deleteList.indexOf(e.fromUserId) != -1) {
deleteMessage(e.msgId)
} else {
console.log(e)
}
}
}
KaiheiIMSDK.client.addListener("message", (...args) => { handler(...args) })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment