Last active
May 12, 2021 19:15
-
-
Save DearTanakorn/1dab0b6e6ad13112243ec4178f35b7e4 to your computer and use it in GitHub Desktop.
Youtube Script Discord Activities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": activities_id, | |
"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)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment