@boubouw/discord-selfbot-v14
v1.0.0
Published
An unofficial discord.js fork for creating selfbots with v14 support - WebSocket + Polling system for real-time message handling with user accounts
Maintainers
Readme
@boubouw/discord-selfbot-v14
An unofficial discord.js fork for creating selfbots with v14 support
Features • Installation • Quick Start • Documentation • Contributing
⚠️ Disclaimer
This package is for educational purposes only. Using user tokens (selfbots) is against Discord's Terms of Service and may result in account bans. Use at your own risk.
Features
- 🚀 Full discord.js v14 API compatibility for user accounts
- 🔄 Hybrid WebSocket + Polling system for real-time message handling
- 📡 Intelligent polling that automatically receives and responds to messages
- 🎯 Built-in deduplication to prevent duplicate message processing
- 🔐 User account authentication via token
- 🛠️ Complete manager system (Guilds, Users, Relationships, etc.)
- 📝 TypeScript support with included type definitions
- ⚡ High performance with minimal rate limit issues
Installation
Via npm
npm install @boubouw/discord-selfbot-v14Via yarn
yarn add @boubouw/discord-selfbot-v14Via GitHub
git clone https://github.com/boubouw/discord.js-selfbot-v14.git
cd discord.js-selfbot-v14
npm installQuick Start
Basic Example
const { Client } = require('@boubouw/discord-selfbot-v14');
// Create client instance
const client = new Client({
intents: ['Guilds'],
});
// Listen for ready event
client.once('ready', () => {
console.log(`Connected as ${client.user.tag}`);
});
// Listen for messages
client.on('messageCreate', async (message) => {
// Ignore own messages
if (message.author.id === client.user.id) return;
console.log(`${message.author.username}: ${message.content}`);
// Respond to commands
if (message.content === '!ping') {
await message.channel.send('Pong!');
}
});
// Login with user token
client.login('YOUR_USER_TOKEN');Advanced Example with Commands
const { Client } = require('@boubouw/discord-selfbot-v14');
const client = new Client({
intents: ['Guilds', 'GuildMessages'],
});
// Command system
client.commands = new Map();
client.commands.set('ping', {
description: 'Test latency',
async execute(message, args) {
const sent = await message.channel.send('Pinging...');
await sent.edit(`Pong! (${sent.createdTimestamp - message.createdTimestamp}ms)`);
},
});
client.on('messageCreate', async (message) => {
if (message.author.id === client.user.id) return;
if (message.content.startsWith('!')) {
const [commandName, ...args] = message.content.slice(1).split(/\s+/);
const command = client.commands.get(commandName);
if (command) {
await command.execute(message, args);
}
}
});
client.login('YOUR_USER_TOKEN');Documentation
Main Differences from discord.js
User Account Authentication
- Uses user tokens instead of bot tokens
- No need for bot prefix in token
- Automatic WebSocket + Polling system setup
Message Reception
- Hybrid WebSocket + Polling system for real-time messages
- Automatic deduplication of messages
- Intelligent channel caching
Rate Limit Handling
- Built-in rate limit awareness
- Automatic retry mechanisms
- Smart polling intervals
API Reference
The API follows discord.js v14 conventions with these main exports:
const {
Client, // Main client class
Collection, // Data collection
GatewayIntentBits, // WebSocket intents
REST, // REST client
Events, // Discord events
} = require('@boubouw/discord-selfbot-v14');Key Classes
Client
Main class for connecting to Discord with user accounts.
const client = new Client({
intents: ['Guilds'], // Optional intents
rest: {
api: 'https://discord.com/api',
version: '10',
timeout: 30000,
},
});
await client.login('USER_TOKEN');Managers
- GuildManager - Manage guilds
- UserManager - Manage users
- RelationshipManager - Manage friends/blocked users
- ChannelManager - Manage channels
Architecture
Hybrid WebSocket + Polling System
This package uses a unique hybrid approach:
- WebSocket Connection - Initial connection and sync
- Intelligent Polling - Real-time message reception
- Smart Deduplication - Prevents duplicate processing
- Automatic Channel Loading - Discovers and caches channels
This approach ensures:
- ✅ Real-time message handling
- ✅ Minimal rate limit issues
- ✅ Reliable message delivery
- ✅ Efficient resource usage
Examples
Command Handler
const fs = require('fs');
const { Client } = require('@boubouw/discord-selfbot-v14');
const client = new Client();
client.commands = new Map();
// Load commands
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.on('messageCreate', async (message) => {
if (!message.content.startsWith('!') || message.author.id === client.user.id) return;
const args = message.content.slice(1).trim().split(/ +/);
const commandName = args.shift().toLowerCase();
const command = client.commands.get(commandName);
if (command) {
try {
await command.execute(message, args);
} catch (error) {
console.error(error);
await message.channel.send('Error executing command!');
}
}
});
client.login('YOUR_USER_TOKEN');Event Handler
const fs = require('fs');
const { Client } = require('@boubouw/discord-selfbot-v14');
const client = new Client();
const eventFiles = fs.readdirSync('./events').filter(file => file.endsWith('.js'));
for (const file of eventFiles) {
const event = require(`./events/${file}`);
if (event.once) {
client.once(event.name, (...args) => event.execute(...args));
} else {
client.on(event.name, (...args) => event.execute(...args));
}
}
client.login('YOUR_USER_TOKEN');Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Development
# Clone the repository
git clone https://github.com/boubouw/discord.js-selfbot-v14.git
# Install dependencies
npm install
# Run linting
npm run lint
# Run tests
npm test
# Start development mode
npm startRequirements
License
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
Acknowledgments
- discord.js - The original discord.js framework
- discord.js-selfbot-v13 - Inspiration for this project
- Discord - The platform we're building for
Support
- 📧 Issues - Bug reports and feature requests
- 📚 Documentation - Full documentation
- 💬 Discord - Community support (coming soon)
Warning
⚠️ Using user tokens (selfbots) is against Discord's Terms of Service.
This package is provided for educational purposes only. The authors are not responsible for any account bans or legal consequences resulting from the use of this software.
Always use official Discord bots for legitimate applications. This package should only be used for:
- Educational purposes
- Personal automation tasks
- Understanding Discord's API
- Testing and development
Made with ❤️ by the community
