Space-Banane d835f4a931
Some checks failed
CI / build-and-publish (push) Has been cancelled
add CI workflow for automated build and deployment
2026-02-22 15:02:29 +01:00
2026-02-22 14:55:10 +01:00
2026-02-22 14:55:10 +01:00
2026-02-22 14:55:10 +01:00
2026-02-22 14:55:10 +01:00
2026-02-22 14:55:10 +01:00
2026-02-22 14:55:10 +01:00

SHSF Discord Bot

A modular TypeScript Discord bot for SHSF, designed for clarity, extensibility, and easy maintenance.

Features

  • Command Handling: Add commands in src/commands/ and register them via src/handlers/registerCommands.ts.
  • Event Listeners: Handle Discord events in src/listeners/, grouped by event type.
  • Startup Routines: Add startup logic in src/handlers/startup/ and load via src/lib/loadStartupHandlers.ts.
  • Web Endpoints: Serve bot-related endpoints from src/web/ using src/webserver.ts.
  • Centralized Configuration: Manage settings in src/config.ts.

Project Structure

src/
  commands/           # Bot commands (e.g., ping.ts)
  handlers/           # Command registration & startup routines
    startup/          # Startup logic (e.g., rotatingActivity.ts)
  listeners/          # Discord event handlers (e.g., messageCreate/logMessage.ts)
  lib/                # Shared utilities (e.g., commandRegistry.ts)
  web/                # Web endpoints (e.g., gitCommit.ts)
  config.ts           # Bot configuration
  types.ts            # Type definitions
  webserver.ts        # Web server entry point
  index.ts            # Bot entry point

Getting Started

  1. Install dependencies:
    pnpm install
    
  2. Configure the bot: Edit src/config.ts with your Discord bot token and settings.
  3. Run the bot:
    pnpm start
    # or
    node src/index.ts
    

Adding Features

  • New Command: Create a file in src/commands/, register in src/handlers/registerCommands.ts.
  • New Event Handler: Add a handler in the relevant src/listeners/<Event>/ folder.
  • Startup Routine: Implement in src/handlers/startup/, register via src/lib/loadStartupHandlers.ts.
  • Web Endpoint: Add to src/web/, served by src/webserver.ts.

Development Notes

  • Uses pnpm for dependency management.
  • No tests or linting scripts by default; add as needed in package.json.
  • Modular structure allows easy debugging and targeted development.

References


For questions or improvements, see .github/copilot-instructions.md.

Description
No description provided
Readme 170 KiB
Languages
TypeScript 100%