Skip to content

FernaandoJr/fernn

Repository files navigation

fernn

A simple, scalable Discord bot starter built with Bun, TypeScript, and discord.js.

Docs

Setup

  1. Install dependencies:
bun install
  1. Create a local env file from the example:
cp .env.example .env
  1. Fill in:
  • DISCORD_TOKEN
  • DISCORD_CLIENT_ID
  • MONGODB_URI (MongoDB connection string; local or Atlas)
  • ENVIRONMENT: P = slash commands globally (production); G = DISCORD_GUILD_ID only (development)
  • DISCORD_GUILD_ID — required when ENVIRONMENT=G; optional when P
  1. Server logging (/server-log): In the Discord Developer Portal → your app → Bot, enable Privileged Gateway Intents that match the features you need (at minimum Server Members Intent for join/leave, and ensure intents align with the bot code — see docs/PROJECT_OVERVIEW.md). Misconfigured intents cause a disallowed intents gateway error.

  2. Dynamic voice (/voice-chat): Admins pick a hub voice channel; members who join get a personal room (rename, user limit, role visibility via the command panel). The bot needs Manage Channels and Move Members. MongoDB collections: voicechatsettings, voicechatchannels, voicechatevents (activity timeline, kept after channels are deleted).

Scripts

bun run start
bun run start:all
bun run dev
bun run deploy:commands
bun run typecheck

Workflow

  1. Register slash commands:
bun run deploy:commands
  1. Start the bot:
bun run start
  1. Use /ping in Discord.

Or run deploy + bot startup together:

bun run start:all

Docker

Build the image:

docker build -t fernn-bot .

Run the bot with your local env file:

docker run --rm --env-file .env fernn-bot

Register commands from the container:

docker run --rm --env-file .env fernn-bot bun run deploy:commands

Project structure

src/
  commands/
  types/
  config.ts
  deploy-commands.ts
  index.ts

Each command lives in its own file and exports:

  • data built with SlashCommandBuilder
  • execute() to handle the interaction

This keeps adding new slash commands straightforward without rewriting the bot bootstrap or deploy flow.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors