pen-bot

module
v0.0.0-...-95c383c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT

README

pen-bot

Pen bot is a community-built Discord bot for the Neon Genesis Linux community, written in Go. It leverages Disgo for Discord integration.

Architecture

The repository structure follows the practices outlined in golang-standards/project-layout. It is a monorepo with a single root Go module and multiple bot binaries.

  • cmd/ contains main.go entrypoints for all the resulting bot binaries:
    • pen-fun/: the first bot, using the community package
  • internal/ contains reusable library packages:
    • community/: community engagement and fun commands
    • core/: shared bot startup and common utilities
    • moderation/: moderation actions

This design keeps shared code in one repository while letting each bot import only the packages it needs. Modules register their commands with the core registry for centralized dispatch.

Installation

Prerequisites
  • Go (see Learning Go for resources)
  • Docker and Docker Compose (for deployment)
    • Podman and Podman Compose can also be used
  • Nix (optional, for development environment)
Development Setup
  1. Clone the repository:

    git clone https://github.com/Neon-Genesis-Linux/pen-bot.git
    cd pen-bot
    
  2. (Optional) Use Nix for a consistent development environment:

    nix develop
    
  3. Install dependencies for the repository:

    go mod tidy
    

Usage

Configuration

Create a .env file in the root directory with your bot token:

BOT_TOKEN=your_bot_token_here

Note: Bot tokens are sensitive information. Manage them securely at the Discord Developer Portal.

Deployment

Deploy the pen-fun bot using Docker Compose:

docker compose up

Or build the bot directly:

go build -o pen-fun ./cmd/pen-fun

The compose.yaml file handles the build and deployment process with hot-reload for development.

The bot stores its data in a SQLite file, so there is no database server to run and no credentials to configure. The compose file mounts a volume that holds the file. See the database documentation for where the file lives, how to back it up and how to inspect it.

Contributing

Contributions are welcome! Please follow the established code style and include tests for new features.

See CONTRIBUTING.md for what to read before editing, which checks to run and report, and the commit message format. If your change was written with AI or LLM tooling, AI_POLICY.md adds what to disclose and who stays responsible for it.

  • DOCUMENTATION.md - how documentation is written and where each kind belongs
  • docs/ - setup, architecture and operations

License

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

Resources

Directories

Path Synopsis
cmd
pen-fun command
internal
db
Package db stores the bot's data in a SQLite database.
Package db stores the bot's data in a SQLite database.
logger
Package logger installs the process-wide slog handler on import, writing logfmt records to stdout at INFO when ENV is "production" and DEBUG otherwise.
Package logger installs the process-wide slog handler on import, writing logfmt records to stdout at INFO when ENV is "production" and DEBUG otherwise.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL