A powerful TypeScript wrapper for Discord.js that simplifies bot development with complete type-safety and intuitive APIs.
A scalable, fully customizable TypeScript-based framework for building modular, modern Discord bots using discord.js.
- Slash Commands, Message Commands, Context Menus, and Components
- Registry system for tracking commands and UI elements
- Built-in Middleware and Cooldown logic
- Developer-only, NSFW, and Permission-based command restrictions
- Centralized bot startup and configuration with
SuperClient
npm install distone.tsAll the folder paths can be configured through the main.ts file
src/
├── main.ts # Bot entry point
├── commands/ # Message commands (!hello)
│ └── /slash/
│ └── /type/
│ └──sayHi.js
│ └── /message/
│ └── /type/
│ └──help.js
├── events/ # Discord events (on ready, etc.)
│ └── /type/
│ └──/ready.js
├── components/ # UI components (buttons, modals, selects)
│ └── type/
│ └──/button.js
├── context_menus/ # User/Message context menus
│ └── user/
│ └──/Report.js
│ └── message/
│ └──/delete.js
├── middlewares/ # Global middlewares
│ └── logMiddleware.jsMain entry class. Handles config, presence, command loading, and lifecycle.
| Key | Type | Description |
|---|---|---|
| token | string |
Required bot token |
| prefix | string |
Default prefix (e.g., !) |
| developers | string[] |
Array of developer user IDs |
| guild_id | string |
Dev guild for testing commands |
| client_id | string |
Discord Application Client ID |
| dev_mode | boolean |
Whether to register commands locally |
| activity_name | string |
Bot status text |
| activity_type | ActivityType |
Playing / Streaming / Watching / etc. |
import { SuperClient } from "distone.ts"
import path from "path"
import { fileURLToPath } from "url"
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const client = new SuperClient({
token: "YOUR_BOT_TOKEN",
guild_id: "YOUR_GUILD_ID",
prefix: ".c",
client_id: "YOUR_CLIENT_ID",
location: {
base: __dirname,
commands: 'commands',
events: 'events',
},
})
client.start()inside your commands/slash/[type]/sayHi.ts
import { SuperSlashCommand } from "distone.ts";
import { SlashCommandBuilder } from "discord.js";
export default new SuperSlashCommand({
command: new SlashCommandBuilder()
.setName('hi')
.setDescription('say hi to everyone'),
cooldown: 5000, # 5 seconds
run: async (client, interaction) => {
await interaction.reply('hi everyone')
}
})inside your commands/message/[type]/help.js
import { SuperMessageCommand } from 'distone.js';
export default new SuperMessageCommand({
name: 'hello',
aliases: ['hi', 'yo'],
run: async (message) => {
await message.reply('Hello there!');
},
});inside your events/[type]/ready.js
import { SuperEvent } from "discord.ts";
export default new SuperEvent({
event: 'ready',
once: false,
run: (client) => {
console.log('logged in as', client.user.username)
}
})-
✅ Context Menu Commands (message, user)
-
✅ Command Cooldowns
-
✅ NSFW Checks
-
✅ Permission Error Handlers
-
✅ Aliases for Message Commands
-
✅ Middleware Chaining
-
✅ Component Registry (Buttons, Modals, Selects)
-
✅ Centralized Error Handling
Set dev_mode: true to register slash commands instantly to your guild_id. Use false for global deployment (can take up to 1 hour).
MIT — Free to use, modify, or build on top of.
Found a bug? Need help? Open an issue or DM on Discord.