Nuit is a Discord bot built with TypeScript and Discord.js. The bot features a modular architecture with dynamic command and event loading capabilities. It supports slash commands and is designed to be easily extensible.
- Modular architecture with dynamic command and event loading
- Support for slash commands
- Built with TypeScript for type safety
- Uses Bun runtime for fast execution
- Supabase integration for database operations
- Chalk for colorful console logging
- Bun runtime
- Clone the repository
- Install dependencies:
bun install-
Set up your environment variables (see section Environment Variables)
-
Run the bot in development mode:
bun run dev![WARNING] On first boot and when developing commands, use
bun run dev --register.
For production environments, we recommend using bun ci to install only production dependencies:
- Clone the repository
- Install dependencies for production:
bun ci-
Set up your environment variables (see section Environment Variables)
-
Start the bot in production mode:
bun run start![WARNING] If a slash command was added but not registered by the bot, use
bun run start --register.
To add a new slash command:
- Create a new file in the
src/discord/commands/[category]/directory - Follow the structure of the ping command as a template
- Export a default object with
data(SlashCommandBuilder) andexecute(interaction handler)
We welcome contributions from the community. Please read our contributing guidelines for more information on how to get involved with this project.
Note that we may take longer to review pull requests depending on their size - larger PRs require more time to properly evaluate.
Put the following environment variables in your .env file:
DISCORD_TOKEN: Your Discord bot token from the Discord Developer PortalSUPABASE_URL: Your Supabase project URLSUPABASE_KEY: Your Supabase secret key (MUST BE SECRET KEY, found in Supabase dashboard > Settings > API Keys)
They must be formatted like the following:
DISCORD_TOKEN=your-discord-bot-token-here
SUPABASE_URL=https://your-supabase-project
SUPABASE_KEY=your-supabase-service-role-key