Skip to content

Instantly share code, notes, and snippets.

@DearTanakorn
Last active May 12, 2021 19:15
Show Gist options
  • Save DearTanakorn/1dab0b6e6ad13112243ec4178f35b7e4 to your computer and use it in GitHub Desktop.
Save DearTanakorn/1dab0b6e6ad13112243ec4178f35b7e4 to your computer and use it in GitHub Desktop.

Revisions

  1. DearTanakorn revised this gist May 12, 2021. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion script.js
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,21 @@
    var token = "";
    var channel_id = "";
    var activities_id = "";

    /*
    Youtube = 755600276941176913
    Poker Night = 755827207812677713
    Betrayal.io = 773336526917861400
    Fishington.io = 814288819477020702
    */

    var myHeaders = new Headers();
    myHeaders.append("Content-Type", "application/json");
    myHeaders.append("Authorization", token);
    var raw = JSON.stringify({
    "max_age": 86400,
    "max_uses": 0,
    "target_application_id": "755600276941176913",
    "target_application_id": activities_id,
    "target_type": 2,
    "temporary": false
    });
  2. DearTanakorn created this gist May 12, 2021.
    24 changes: 24 additions & 0 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    var token = "";
    var channel_id = "";

    var myHeaders = new Headers();
    myHeaders.append("Content-Type", "application/json");
    myHeaders.append("Authorization", token);
    var raw = JSON.stringify({
    "max_age": 86400,
    "max_uses": 0,
    "target_application_id": "755600276941176913",
    "target_type": 2,
    "temporary": false
    });
    var requestOptions = {
    method: 'POST',
    headers: myHeaders,
    body: raw,
    redirect: 'follow'
    };

    fetch(`https://discord.com/api/v8/channels/${channel_id}/invites`, requestOptions)
    .then(response => response.json())
    .then(result => console.log(`https://discord.gg/${result.code}`))
    .catch(error => console.log('error', error));