Build Discord apps faster, cleaner, and smarter.
Disfox is a framework that enhances and organizes discord.js development, making building Discord applications faster, cleaner, and more structured.
Examples and documentation available in Official Documentation Site
npm install disfoxyarn add disfoxpnpm add disfoxbun add disfox- Result Pattern for consistent and predictable handling
- Centralized Client and Application management
- Simplified path and directory handling
- Simplified file system utilities
- Dedicated Slash Command service
- Scalable and flexible configuration system
Disfox is currently not compatible with CommonJS.
Only ES Modules (ESM) are supported.
import { SlashOptions, SlashService, SlashTag } from "disfox";
const command = new SlashService.Command("ping1")
.description("replies")
// .mark(SlashTag.AdminOnly) // Optional method to enable command tags, defining behavior within the Discord API.
.action(interaction => {
interaction.reply("Pong!");
});
export default command;
import { Client, GatewayIntentBits, ActivityType, Events } from "discord.js";
import { Application, SlashService } from "disfox";
const client = new Client({
intents: [GatewayIntentBits.MessageContent]
});
const app = new Application({
token: process.env.TOKEN,
client: client
});
await app.connect();
await app.actions.setPresence(
ActivityType.Playing,
"⭐ Ready! /help",
"online"
);
app.client.on(Events.ClientReady, async () => {
// convert Disfox model to Discord.js SlashCommand structure
const command = await SlashService.extractFile("./commands/ping.js");
// deploy globally
await app.slash.deployGlobal([command]);
// listen for interactions
app.slash.listen({
onError: {
message: "Error occurred. Try again later.",
flags: 64
}
});
});The framework is still under development. All suggestions and ideas are very welcome.
Join our Discord for support, questions, and suggestions:
https://discord.gg/UuZnAuhhP6