Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

disself

TypeScript library for the Discord user-account API. Composer-style middleware, contexts, scenes, multi-account orchestrator, captcha pipeline, proxy pool.

Disclaimer

Automating user accounts violates Discord's Terms of Service. Accounts can be terminated. Use only on accounts you can afford to lose.

Install

npm install disself

Quick start

import { Client } from "disself";

const bot = new Client({ token: process.env.DISCORD_TOKEN! });

bot.on("ready", (user) => console.log(`logged in as ${user.tag}`));

bot.command("!ping", (ctx) => ctx.reply("pong"));
bot.hear(/^hello/i, (ctx) => ctx.reply(`hi, ${ctx.message.author.username}`));

await bot.start();

Highlights

  • REST client: bucket rate limits, super-properties, captcha retry pipeline.
  • Gateway shard: heartbeat with jitter, RESUME, optional zlib-stream, smart reconnect with exponential backoff.
  • Composer with hear() / command() and middleware chain.
  • Contexts: MessageContext (send, reply, delete, startTyping), GuildContext.
  • Scenes / FSM with memory and Redis-compatible storage.
  • Client.waitFor("message", filter, timeout) for awaitable flows.
  • Component interactions: button clicks, select menus, modal submits, slash command invocation as a user.
  • Multi-account Hub with shared proxy pool, captcha solver, rotating client_build_number.
  • ProxyPool with health checks; BuildNumberFetcher for fresh fingerprints.
  • Captcha solvers (2captcha, CapMonster/Capsolver) and a CaptchaSolver interface for custom services.
  • Member list aggregator (op 14 lazy guild walking).
  • MessageCollector, ReactionCollector.
  • Builders: embed, file uploads, paginator, cooldowns, scheduler, logger, permissions, markdown helpers.
  • Anti-detect helpers: UA pool, token validator, dcfduid cookie loader.
  • CLI: disself token-info, disself gateway-ping, disself build-number.

Multi-account with proxies and captcha

import { Hub, ProxyPool, TwoCaptchaSolver } from "disself";

const proxies = new ProxyPool({
  proxies: ["http://user:pass@p1:8000", "http://user:pass@p2:8000"],
});
await proxies.checkAll();

const solver = new TwoCaptchaSolver({ apiKey: process.env.TWOCAPTCHA_KEY! });

const hub = new Hub({
  accounts: [{ token: "..." }, { token: "..." }],
  proxyPool: proxies,
  captchaSolver: solver,
});

await hub.init();
await hub.start();

for (const m of hub.clients) {
  m.client.command("!ping", (ctx) => ctx.reply("pong"));
}

Scenes

import { Scenes } from "disself";

const scenes = new Scenes().add({
  id: "ask-name",
  steps: [
    async (ctx) => {
      await ctx.send("What's your name?");
      await ctx.scene.next();
    },
    async (ctx) => {
      await ctx.send(`Hi, ${ctx.text}`);
      await ctx.scene.leave();
    },
  ],
});

bot.use(scenes.middleware());
bot.command("!start", (ctx) => ctx.scene.enter("ask-name"));

Component interactions

import { clickButton, submitSelectMenu } from "disself";

await clickButton(bot, message, "row0_button1");
await submitSelectMenu(bot, message, "row0_select0", ["option_a"]);

Decorators

import { Client, command, hear, attachClass } from "disself";

class Handlers {
  @command("!ping")
  async ping(ctx) { await ctx.reply("pong"); }

  @hear(/^!echo (.+)/i)
  async echo(ctx) { await ctx.reply(ctx.text.replace(/^!echo /, "")); }
}

attachClass(bot, new Handlers());

Build

npm install
npm run build

License

MIT.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages