Skip to content

HardCarryClub/bald-man-bot

Repository files navigation

Bald Man Bot

A custom Discord bot for the Hard Carry Club, built with Bun, Dressed, and TypeScript.

Quick Start

Prerequisites

You'll need one of the following development environments:

Option 1: GitHub Codespaces (Recommended)

Option 2: Local Dev Containers

Discord Application Setup

  1. Create a new Discord application
  2. Copy the bot token (from the bot section), application ID, and public key
  3. Set up a test Discord server with:
    • A channel for user notes
    • A role for staff members
    • A role for banned users

Development Setup

Environment Configuration

It should be automatically created but you should have a .env that looks similar to this:

DISCORD_TOKEN="your_bot_token_here"

GUILD_ID="your_test_server_id"
PUG_BANNED_ROLE_ID="banned_role_id"
PUG_STAFF_ROLE_ID="staff_role_id"
PUG_NOTES_CHANNEL_ID="notes_channel_id"

Installation

The dev container should automatically run setup, but if needed, run manually:

bun install && bun run lefthook install

After pulling new changes, always run:

bun install

Running the Bot

  1. Register Discord commands (required for new/changed commands):

    bun run bot:register-commands
  2. Start the development server:

    bun run dev
  3. Configure Discord webhook (one-time setup):

    • Forward port in VS Code
    • Right-click the port → Port VisibilityPublic
    • Copy the public URL
    • Paste into Interactions Endpoint URL in your Discord application settings
    • Note: The bot must be running when you save this setting as Discord will validate it's working correctly

Committing Code

When making commits you should always follow conventional commit format. If you wanna quick cheat sheet checkout this post. There will be a check automatically ran as you stage and commit code to GitHub to ensure it follows this format.

If you use Copilot you can autogenerate a commit and it should follow this standard as well.

Development Tools

Included Extensions

The dev container includes these helpful extensions:

  • SQLite Viewer - Double-click db.sqlite to view the database
  • GitHub Copilot - AI code assistance (if you have access)
  • Biome - Automatic formatting and linting
  • Additional: Icons, spell check, and inline error viewing

Frameworks & Libraries

Dressed Framework

Discord Formatting

  • Uses discord-fmt package

  • Example usage:

    import { bold, h1 } from "discord-fmt";
    
    sendMessage(bold("this is bold")); // **this is bold**
    sendMessage(h1("Header")); // # Header
    sendMessage(bold("sh*t")); // **sh\*t**

Code Quality

Formatting & Linting

  • Biome handles formatting and linting
  • Lefthook runs checks automatically on commit
  • Format on save enabled if you're using Codespaces or VSCode

Assets & Resources

If you want to include images, it's highly recommended to upload them to something like Imgur, if you worry about it disappearing then contact me in Discord and I'll throw it on the HCC CDN.

Troubleshooting

Common Issues:

  • Commands not updating: Run bun run bot:register-commands after changes
  • Webhook errors: Ensure port is public and bot is running when configuring Discord
  • Permission errors: Check bot permissions in your test server
  • Environment issues: Verify all required environment variables are set

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 5