Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Tenclea committed Apr 1, 2024
0 parents commit 2f90913
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 0 deletions.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Discord Loot Box Opener 🎁

This project automates the process of opening loot boxes on Discord using a user's token. Follow these steps to set up and run the script.

## Disclaimer ⚠️

This project is a Proof of Concept (POC) and is for educational purposes only. Using selfbot tools or scripts to automate actions on Discord, including opening loot boxes, is prohibited by Discord's Terms of Service. Utilizing this script on live Discord accounts can lead to account suspension or termination. Always use responsibly and ethically, and never use it in a way that violates Discord's Terms of Service.


## Pre-requisites 📋
- [Node.js](https://nodejs.org/en/download) installed on your computer.
- Your Discord token. (⚠️ **Never share your token with others**)

## Running the Script 🚀

1. **Start the Script**

In the project directory, open your terminal or command prompt and run:

```
node index.js
```

This will start the script.

2. **Input Your Token**

The script will prompt you to 'Input your token: '. Paste your Discord token here and press Enter.

⚠️ The script does not store your token anywhere, but always be cautious with your token to avoid misuse.

3. **Profits!**

The script will now start opening loot boxes once every 5 seconds for you. Enjoy!

## How it Works 🧩

- The script uses your token to make authorized requests to Discord for opening loot boxes.
- It automatically handles rate limits imposed by Discord and retries opening a loot box after the specified wait time.
- Upon successfully opening a loot box, it will log the item you received to the console.

## Troubleshooting 🛠

- **Invalid Token**: If you receive a 'The provided token seems to be invalid.' message, double-check your token and try again.
- **Rate Limits**: If rate-limited, the script will automatically wait and retry. No action is needed from your side.
- If your issue persists, feel free to open up an issue, describing as precisely as possible what is going wrong.

## Security Note 🔐

- Your token is like a key to your Discord account. Never share it and only use it in trusted applications.

## Contributing 🤝

Feel free to fork the project, make improvements, and submit pull requests. We're always looking to make our projects better!

---

Happy Loot Box Opening! 🎉
56 changes: 56 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import * as readline from 'readline';

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

const token = await new Promise(r => rl.question('Input your token: ', r));

async function openBox() {
return fetch("https://discord.com/api/v9/users/@me/lootboxes/open", {
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0",
"Accept": "*/*",
"Authorization": token,
"X-Super-Properties": "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRmlyZWZveCIsImRldmljZSI6IiIsInN5c3RlbV9sb2NhbGUiOiJlbi1VUyIsImJyb3dzZXJfdXNlcl9hZ2VudCI6Ik1vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjA7IFdpbjY0OyB4NjQ7IHJ2OjEyNC4wKSBHZWNrby8yMDEwMDEwMSBGaXJlZm94LzEyNC4wIiwiYnJvd3Nlcl92ZXJzaW9uIjoiMTI0LjAiLCJvc192ZXJzaW9uIjoiMTAiLCJyZWZlcnJlciI6Imh0dHBzOi8vdGV0cmF6ZXJvLmNvbS8iLCJyZWZlcnJpbmdfZG9tYWluIjoidGV0cmF6ZXJvLmNvbSIsInJlZmVycmVyX2N1cnJlbnQiOiJodHRwczovL2Rpc2NvcmQuY29tLyIsInJlZmVycmluZ19kb21haW5fY3VycmVudCI6ImRpc2NvcmQuY29tIiwicmVsZWFzZV9jaGFubmVsIjoic3RhYmxlIiwiY2xpZW50X2J1aWxkX251bWJlciI6MjgwNDU4LCJjbGllbnRfZXZlbnRfc291cmNlIjpudWxsfQ==",
},
"referrer": "https://discord.com/shop",
"method": "POST",
}).then(r => r.json()).catch(() => { });
}

function wait(ms) {
return new Promise(r => setTimeout(r, ms));
}

for (; ; await wait(5000)) {
const res = await openBox();
if (!res) {
console.error('Request failed.');
continue;
}

if (res.code == 0) {
console.error('The provided token seems to be invalid.');
process.exit(1);
}

if (res.retry_after) {
console.error(`Rate limited for: ${res.retry_after}s`);
await wait(res.retry_after * 1000 - 5000);
continue;
}

const prize = res.opened_item;
if (!prize) {
console.error('An unknown error has occureed:', res);
continue;
}

console.log('Congrats! You just got a: ' + {
'1214340999644446726': 'Quack!!', '1214340999644446724': '⮕⬆⬇⮕⬆⬇', '1214340999644446722': 'Wump Shell',
'1214340999644446720': 'Buster Blade', '1214340999644446725': 'Power Helmet', '1214340999644446723': 'Speed Boost',
'1214340999644446721': 'Cute Plushie', '1214340999644446728': 'Dream Hammer', '1214340999644446727': 'OHHHHH BANANA',
}[prize]);
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type": "module"}

0 comments on commit 2f90913

Please sign in to comment.