首页 > 解决方案 > 通过控制台进入 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。

标签: discord

解决方案


这不是一个确切的答案,而是在某些情况下应该有效的解决方法。

我从“隐私和安全”的“请求我的数据”中获得了所有频道 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


推荐阅读