arasseo. f16187cc03 Add staff thread controls and help embed customization
Introduces new staff commands (.close, .open, .lock, .unlock) for thread management and updates permission checks to include ManageThreads. Adds customizable help embed fields (help_title, help_repo_url, help_examples) in config. All bot replies now reference the triggering message for clarity. Updates README and config.yaml with documentation for new features.
2025-11-03 16:00:07 +07:00
2025-10-30 04:08:01 +07:00
2025-10-28 15:02:19 +07:00
2025-10-28 15:21:21 +07:00
2025-10-28 15:02:19 +07:00
2025-10-28 15:21:21 +07:00

Emanon-GO (the Totoro bot)

Discord

Emanon-GO (the Totoro bot) is a lightweight Discord bot written in Go that provides AniList-based searching (anime/manga) and forum thread tagging helpers for communities using Discord Forums. It is a Go port of the original Emanon Python bot with improvements to embed styling and Docker support.

Emanon embed preview
Example embed produced by Emanon-GO

Features

  • Auto-search AniList when users post wrapped names (e.g., My Favorite Manga or <My Manga>)
  • Pretty Discord embed with genres, shortened description and "(more)" link
  • Stylized cover image using AniList media artwork
  • Forum thread commands for staff to apply standard tags and prefixes (.solved, .duplicate, etc.)
  • Forum thread commands for staff to apply standard tags and prefixes (.solved, .duplicate, etc.)
  • Additional thread controls for staff: .close, .open, .lock, .unlock (archive/unarchive and lock/unlock threads)
  • Config-driven: enable/disable search, restrict channels, and set allowed moderator roles

Requirements

  • Go 1.20+ (for manual build)
  • Docker (optional, for containerized deployment)

Getting started

Manual build

  1. Clone the repository:
git clone https://github.com/KotatsuApp/Emanon-GO.git && cd Emanon-GO
  1. Build the binary:
go build -o emanon-go
  1. Open config.yaml and fill in your Discord bot token and other options.

  2. Run the bot:

./emanon-go

Docker

Build the image:

docker build -t emanon-go:latest .

Run the container:

docker run --name emanon-go emanon-go:latest

Notes:

  • The container expects config.yaml at /app/config.yaml. You can also supply configuration via environment variables if supported.

Configuration

  • Copy example_config.yaml to config.yaml and edit the values. Important options:
    • discord_token: your bot token (or set via environment variables in your deployment)
    • search_enabled: enable or disable automatic AniList scanning
    • search_channels: optional list of channel IDs the bot will scan
    • allowed_role_ids / allowed_permissions: restrict which users can run thread commands
    • New optional help embed customization (optional):
      • help_title: custom title for the .help embed (string)
      • help_repo_url: repository URL shown in the .help embed (string)
      • help_examples: free-form examples or usage text shown under the AniList examples field in .help (string)

Usage

AniList searching

  • Non-command messages (not starting with .) are scanned for patterns matching anime/manga titles. Examples:

    • # inline code: Emanon Wanderer
    • Curly braces: {Emanon Wanderer}
    • Angle brackets for manga:
  • If the bot finds matches it will reply with a styled embed containing:

    • Title and site link
    • Genre list (deduplicated)
    • Shortened description with a "(more)" link to AniList
    • Stylized media image (sourced from AniList media endpoint)
    • Footer showing format and release date (e.g., "Manga • October 28, 2025")

Forum thread commands (staff only)

  • Commands are prefixed with . and must be used in a thread channel. Example commands:
    • .solved — mark thread title with [Solved] and apply the .Solved forum tag
    • .aware — mark thread title with [Devs aware] and apply the .Devs aware tag
    • Other available commands: .duplicate, .false, .known, .wrong

Additional staff controls:

  • .close — immediately archive (close) the thread
  • .open — unarchive (reopen) the thread
  • .lock — lock the thread to prevent new messages
  • .unlock — unlock the thread

Behavior note:

  • When staff run tag-applying commands such as .solved, .aware, .duplicate, etc., the bot will set the thread's "Hide After Inactivity" / auto-archive duration to 1 hour automatically. This helps posts be hidden after inactivity without requiring a separate .close command.

.help command:

  • .help replies to the triggering message with a nicely formatted embed listing available commands, usage hints (including AniList search examples), and a link to the project's GitHub repository. The .help embed content can be customized via help_title, help_repo_url, and help_examples in config.yaml.

The bot will only allow staff to run thread commands. Permissions are configurable via allowed_role_ids or allowed_permissions in the config.

Developer notes

  • The code uses AniList GraphQL to fetch media data and then constructs a Discord embed that mirrors the original Python bot formatting.
  • Image source: https://img.anili.st/media/{id} is used to get the stylized artwork similar to the Python implementation.

Testing and contributing

  • Run go build locally and test in a private server before deploying.
  • Open PRs for improvements. Include unit tests where applicable.

Troubleshooting

  • If embeds look wrong, ensure the AniList response contains coverImage.color and startDate.
  • If forum tag changes fail, check the bot's Manage Threads/Manage Channels permissions and that the forum has the expected tag names.

License

This project follows the existing LICENSE in the repository.

Languages
Go 99%
Dockerfile 1%