Skip to content

Nuit-Bot/Nuit

Repository files navigation

Nuit

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.

Features

  • 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

Prerequisites

Installation

Development

  1. Clone the repository
  2. Install dependencies:
bun install
  1. Set up your environment variables (see section Environment Variables)

  2. Run the bot in development mode:

bun run dev

![WARNING] On first boot and when developing commands, use bun run dev --register.

Production

For production environments, we recommend using bun ci to install only production dependencies:

  1. Clone the repository
  2. Install dependencies for production:
bun ci
  1. Set up your environment variables (see section Environment Variables)

  2. 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.

Adding Commands

To add a new slash command:

  1. Create a new file in the src/discord/commands/[category]/ directory
  2. Follow the structure of the ping command as a template
  3. Export a default object with data (SlashCommandBuilder) and execute (interaction handler)

Contributing

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.

Environment Variables

Put the following environment variables in your .env file:

  • DISCORD_TOKEN: Your Discord bot token from the Discord Developer Portal
  • SUPABASE_URL: Your Supabase project URL
  • SUPABASE_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

About

The free multi-purpose Discord bot

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors