discord - 通过控制台进入 Discord 频道
问题描述
是否可以使用开发控制台(Ctrl + Shift + I)进入不和谐频道?
像“client.openChannel(“channel_id”)”之类的东西还是会加载频道的获取?
更具体地说,这
但不必让用户成为朋友或拥有用户 ID。
使用用户 ID,您可以使用它
fetch("https://discord.com/api/v8/users/@me/channels", {
"headers": {
"accept": "*/*",
"accept-language": "en-US",
"authorization": "mfa.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"x-context-properties": "",
"x-super-properties": ""
},
"referrer": "https://discord.com/channels/@me",
"referrerPolicy": "no-referrer-when-downgrade",
"body": "{\"recipients\":[\"USER_ID\"]}",
"method": "POST",
"mode": "cors",
"credentials": "include"
});
它会打开该用户的 DM,但对于某些人来说,我只有频道 ID。
解决方案
这不是一个确切的答案,而是在某些情况下应该有效的解决方法。
我从“隐私和安全”的“请求我的数据”中获得了所有频道 ID。
一旦我获得了频道 ID,file.zip/messages/index.json
我就抓住了所有这些 ID 并打电话给
let channels = ['54623165841324165','54623165841324165','54623165841324165']
async function get_Channel_Data() {
let channel_id = channels.pop();
await sleep(2000);
let response = await fetch("https://discord.com/api/v8/channels/" + channel_id, {
"headers": {
"accept": "*/*",
"accept-language": "en-US",
"authorization": "mfa.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
"referrer": "https://discord.com/channels/@me",
"referrerPolicy": "no-referrer-when-downgrade",
"body": null,
"method": "GET",
"mode": "cors",
"credentials": "include"
});
let data = await response.json();
// data.type 1 is a DM, data.type 0 is server
if (data.type == 1) {
// This is the user ID of the person you DM
console.log(data.recipients[0].id);
}
get_Channel_Data();
}
然后对于每个用户 ID 调用
let user_ids = ['54623165841324165','54623165841324165','54623165841324165']
async function open_dms() {
let user_id = user_ids.pop();
if (user_id === undefined) {
console.log("END");
return false;
}
await sleep(2000);
let response = await fetch("https://discord.com/api/v8/users/@me/channels", {
"headers": {
"accept": "*/*",
"accept-language": "en-US",
"authorization": "mfa.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"content-type": "application/json",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
},
"referrer": "https://discord.com/channels/@me",
"referrerPolicy": "no-referrer-when-downgrade",
"body": "{\"recipients\":[\""+user_id+"\"]}",
"method": "POST",
"mode": "cors",
"credentials": "include"
});
let data = await response.json();
open_dms();
}
使用该用户 ID 打开 DM
推荐阅读
- ruby - 将十六进制字符串添加到二进制文件的内容中
- reactjs - 为什么没有注入门户内容?
- java - 如何在员工详细信息中添加“url”作为数据字段?
- c# - .Net Application SideBySide 加载失败 COMException (0x80040154)
- kubernetes - 如何在 Kubernetes 中注册和查找 Deployment 中的单个 pod 主机名?
- go - 尝试在 golang 中获取具有截止日期的锁?
- matlab - MATLAB 隔离并将变量分配给矩阵中的特定元素
- angular - OpenLayers 5,Angular 7 行未显示
- data-visualization - Tableau - 根据它们所属的月份计算维度中的项目
- python - 尝试导入 matplotlib 时出错:“导入未被识别为内部或外部命令”