npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

discordtoken-tool

v1.0.2

Published

A simple and easy package to create and manage Discord bots using user accounts' tokens and the Discord API

Downloads

11

Readme

discordtoken-tool

Install discordtoken-tool

npm i discordtoken-tool
  • Simple & easy to use 🎗️
  • Event-based system 📡
  • Bypass Discord's deletion of the bot after creation and ratelimits 🚀
  • Automatically get 2FA code if enabled in the user account 📟
  • Create bots using user account tokens 🤖
  • Custom name format for the bots 📝
  • Save tokens to a file 📁
  • Proxy support 🛡️

At first install the discordtoken-tool package

const TokenCreateor = require("discordtoken-tool");
(async () => {
    const creator = new TokenCreateor({
        tokens: [ // the array of the user accounts tokens
            {
            /* [IMPORTANT] */
            // If the user account doesn't have 2FA enabled, you need to add the password.
            // If 2FA is enabled, you can add only the twoFactorKey.

                token: "user account token",
                twoFactorKey: "", // if the user account has 2FA enabled - add the key here
                password: "", // if there are no 2FA enabled !
            },

            // token with 2FA enabled
            {
                token: "user account token",
                twoFactorKey: "2FA key",
            },
            // token without 2FA
            {
                token: "user account token",
                password: "user account password",
            }
        ],
        proxy: "", // the proxy to use - i use ipRoyal proxies
        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.1 Safari/537.36", // the user agent to use - important to bypass discord security
        enableIntents: true, // enable the intents - by default is true
        nameFormat: "jamil_{0}", // the name format of the bots - {0} will be replaced with a random number between 1 and 9999
    }, true);

    var startedAt = Date.now();
    creator.on("tokenCreated", data => {
        // the token is created - you can do anything with the token
        // for example save the token in database
    });
    creator.on("tokenInvalid", tokenData => {
        // the user token is invalid - maybe the twofactor key is wrong or the password is wrong or the user banned
    });

    await creator.start({
        loopCount: 20, // the count of the tokens to create, for example if you have 10 tokens and you want to create 100 bots you need to set this to 100, it will loop over the 10 tokens and create 100 bots
        pathToSaveTokens: `./test.js`, // if you want to save the tokens in file
        loopWait: 1000 * 10, // by default is 1000*10 ms - the time to wait between each loop
    });
    console.log(`Time elapsed: ${Date.now() - startedAt}ms`);
})();
const TokenCreateor = require("discordtoken-tool");
(async () => {
    const createor = new TokenCreateor({
        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.1 Safari/537.36",
    });
    const userData = {
        token: "",
        twoFactorKey: "",
        password: "" // if there are no 2FA enabled !
    } // the owner of the bot id you want to manage
    const botID = "bot_id"; // the bot id you want to manage
    createor.setSelectedToken(userData); // set the user data (IMPORTANT)

    // get bot data
    var bot = await createor.performApplicationAction({ botID, type: "get" });
    console.log(bot);

    // enable intents for the bot
    await createor.enableIntents(botID);

    // reset the bot token
    var token = await createor.getBotToken(botID);
    console.log(token);

    // delete the bot
    await createor.performApplicationAction({ botID, type: "delete" });
})()

Documentation

  • userData object =>
{
    "token": "", // the user account token
    "twoFactorKey": "", // if the user account has 2FA enabled - add the key here
    "password": "", // if there are no 2FA enabled !
}

  • example of the created bot object =>
{
   "token": "botToken",
   "botID": "id of the bot",
   "name": "name of the bot",
   "userToken": "the user token who created the bot",
   "haveTwoFactor": false // if the user account have 2FA enabled this will be true
}

  • start({ pathToSaveTokens, loopCount, loopWait }) method - to create the bots using accounts tokens

    • pathToSaveTokens - if you want to save the tokens in file after creating the bots add the path here - not required
    • loopCount - the count of the tokens to create - for example if you have 10 tokens and you want to create 100 bots you need to set this to 100, it will loop over the 10 tokens and create 100 bots
    • loopWait - the time to wait between each loop - by default is 10sec / 1000*10 ms
  • performApplicationAction({ botID, type }) method - to perform an action on the bot

    • botID - the bot id you want to manage - not required if the action type is create
    • type - the action type
      • get to get the bot data,
      • delete to delete the bot,
      • create to create a bot You can use it only in start() method
  • enableIntents(botID) method - to enable intents for the bot

    • botID - the bot id you want to enable intents for
  • getBotToken(botID) method - to get the bot token or reset it

    • botID - the bot id you want to get the token for
  • setSelectedToken(userData) method - to set the user data (only use if you are not used start() method)

    • userData - the user data object
  • on("tokenCreated", data => {}) event - to listen to the token created event it will work when the bot is created and only work if you are using the start() method

    • data the created bot object
  • on("tokenInvalid", tokenData => {}) event - to listen to the token invalid event it will work when the user token is invalid and only work if you are using the start() method

    • tokenData the user data object

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

MIT

Contact

Thank you for using discordtoken-tool 🎉