Skip to content

SamTheDevDE/Herion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Herion

A modern, extensible Discord bot template built with TypeScript, featuring a robust command system, event handling, and database integration using Drizzle ORM.

Features

  • TypeScript: Full type safety and modern JavaScript features
  • Discord.js v14+: Latest Discord API support with components and interactions
  • Drizzle ORM: Type-safe database operations with PostgreSQL
  • Command Systems:
    • Slash commands with autocomplete
    • Message commands with aliases and permissions
    • Dynamic help command with paginated UI
  • Interactive Components: Buttons, modals, and select menus
  • Event System: Client and guild event handling
  • Utilities: Paginator for text displays, structured logging
  • Hot Reload: Development with Bun for fast iteration
  • Extensible Architecture: Modular loader system for easy expansion

Prerequisites

Installation

  1. Click "Use this template" to create your own repository

  2. Clone your new repository:

    git clone https://github.com/your-username/your-repo-name.git
    cd your-repo-name
  3. Install dependencies:

    bun install
    # or
    npm install

Setup

Run the automated setup script to configure your environment:

bun run init

This will:

  • Install packages
  • Prompt for your Discord bot token and database URL
  • Create the database if it doesn't exist
  • Set up the schema

Alternatively, set up manually:

  1. Copy example.env to .env and fill in your values:

    BOT_TOKEN=your_discord_bot_token
    DATABASE_URL=postgresql://user:password@localhost:5432/your_database
    
  2. Copy src/example.config.ts to src/config.ts and customize as needed

  3. Create the database and push the schema:

    bun run create-db
    bunx drizzle-kit push

Usage

Development

Start the bot in development mode with hot reload:

bun run dev

Production

Build and start the bot:

bun run start

Available Scripts

Script Description
start Start the bot in production mode
dev Start the bot in development mode with hot reload
init Run the full setup process
create-db Create the database if it doesn't exist
db:push Push the schema to the database

Project Structure

src/
├── classes/          # Core classes (Database, Logger, etc.)
├── commands/         # Command handlers
│   ├── message/      # Message commands
│   └── slash/        # Slash commands
├── events/           # Event handlers
├── helpers/          # Utility functions
├── interactions/     # Interactive components
├── structures/       # Base classes and types
├── triggers/         # Message triggers
├── types/            # TypeScript type definitions
├── utils/            # Utility classes
├── client.ts         # Discord client setup
├── config.ts         # Configuration (copy from example)
├── db/               # Database schema and setup
└── startup.ts        # Application entry point

Commands

Message Commands

  • ;help - Display all commands with pagination
  • ;ping - Check bot latency
  • ;invite - Get bot invite link
  • ;clear <amount> - Clear messages (requires permissions)
  • ;eval <code> - Execute JavaScript (developer only)

Slash Commands

  • /ping - Check bot latency
  • /invite - Get bot invite link
  • /eval - Execute JavaScript (developer only)

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This template is designed for learning, prototyping, and small-scale projects. It may not be suitable for large production bots without additional optimizations and security measures.

About

a modern, extensible discord bot template written in typescript

Topics

Resources

Stars

Watchers

Forks

Contributors