Cumsocket is a "simple" Discord module based selfbot written in TypeScript that has features such as permissions management, Discord api, and more. Also worth mentioning is fact that selfbots are against Discord's ToS and can get you banned, even if you don't do anything harmful. If you really want to use selfbots, please don't do it on your main account. Enjoy my trashy code!
- Websocket handling
- Rich permissions management
- Discord API wrapper
- Module flexibility
- Database support
- Almost undetectable
- Rate limit handling
- Client like data handling (only prototype for now)
- Clone the repository
git clone https://github.com/0x7030676e31/cumsocket
- Install dependencies
npm install
(see nerdy stuff for more info) - Provide env vars in
.env
file (see .env.examples) - Run via
npm run start
!
egg
- Reacting to message containing eggs, and soon to images too! (Why? Idk)pong
- Simple ping pong modulebridge
- Used for copying attachments from multiple channels to one specified channel using webhooksmath
- Simple math module that can evaluate simple math expressionspermissions
- Permissions management module, used for managing permissions for other modulespresence
- Animated rich presence module, used to disaply rich presence on bot's profile
- Fixed permissions append function
- Fixed bridge avatar not showing
isImportant
module property
// Import core and types
import Core, { types, env } from "../core/index.js";
export default class ExampleModule {
// Reference to Core instance, set by Core on load
public readonly ctx!: Core;
// Id is a unique identifier for the module which is mainly used for permissions management
public readonly id: string = "example";
// List of env vars that are required for the module to work
public readonly env: string[] = ["EXAMPLE"];
// OR
public readonly env: env = {
example1: "string",
example2: "number",
example3: "boolean",
};
// If load and ready methods should be awaited
public readonly isImportant: boolean = true;
// If set to true, module won't be loaded, default set to false
public readonly ignore: boolean = false;
// Called when module is loaded
public async load(ctx: Core): Promise<void> {
ctx.log("example", "Module loaded!");
}
// Called when everything is ready - all modules are loaded, websocket connection is established, etc.
public async ready(ctx: Core): Promise<void> {
ctx.log("example", "Bot is ready!");
}
// Called on every "MESSAGE_CREATE" event
@Core.listen("MESSAGE_CREATE")
public async onMessageCreate(msg: types.MESSAGE_CREATE): Promise<void> {
ctx.log("example", "Message created!");
}
}
import Core, { types } from "../core/index.js";
// Used to calculate timestamp from snowflake
const EPOCH = 1420070400000n;
export default class Pong {
public readonly id: string = "pong";
public readonly ctx!: Core;
// How bot's mention looks like
private mention!: string;
public async load(ctx: Core): Promise<void> {
this.mention = `<@${ctx.getIdFromToken()}>`;
}
@Core.listen("MESSAGE_CREATE")
public async onMessageCreate(msg: types.MESSAGE_CREATE): Promise<void> {
// Check if message is mention
if (msg.content !== this.mention) return;
// Respond to message, if failed - return
const reply = await this.ctx.api.messages.respond(msg.channel_id, msg.id, "🏓 Ping!").assume();
if (reply === null) return;
// Calculate ping
const timestamp1 = (BigInt(msg.id) >> 22n) + EPOCH;
const timestamp2 = (BigInt(reply.id) >> 22n) + EPOCH;
const diff = timestamp2 - timestamp1;
// Edit message to show ping
this.ctx.api.messages.edit(msg.channel_id, reply.id, {
content: `🏓 Pong! ${diff}ms`,
allowed_mentions: { parse: ["everyone", "roles", "users"], replied_user: false },
});
}
}
- Selfbottign Article and why it's forbidden
- API wrapper is based on discord official docs and private experiments with discord API so it may be not 100% accurate
- Bot is active 24/7, hosted on Heroku and uses Heroku Postgres for database
- Bot is automatically deployed on every push to
main
branch - Bot doesn't make anything harmful to anyone, it's just a fun project (ok maybe copying attachments may be considered as potential safety harm, but it's listening only to specific channels where the main content is mostly memes and other stuff that doesn't require any privacy)
My goal was to create something like environment for module based selfbot. Over time maybe I will add more modules and features like client like data manager. I'll maintain this project as long as I can but discord likes to change api in a rather strange way. As long as I can, I'll try to keep this project up to date and alive.