Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

HungerNet Bot

HungerNet's official Discord bot.

Installation

python -m pip install hungernetbot

Run the bot with hungernetbot or python -m hungernetbot after configuring the environment.

For container deployment, see the Calagopus egg guide.

Configuration

The bot reads configuration from environment variables. Secrets are never stored in the package.

Variable Required Purpose
DISCORD_TOKEN Yes Discord bot token.
PANEL_URL Yes Calagopus panel base URL.
PANEL_API_KEY Yes Calagopus API key.
BRIDGE_WEBHOOK_TOKEN Yes Shared token for HungerCore's webhook receiver.
GITHUB_WEBHOOK_SECRET Yes GitHub webhook signing secret.
WEBHOOK_HOST No Bind address for the shared webhook listener; defaults to 0.0.0.0.
WEBHOOK_PORT No Shared GitHub/HungerBridge webhook port; defaults to Calagopus's SERVER_PORT, or 8000 outside Calagopus.
DATABASE_PATH No New SQLite database path; defaults to ./data/hungernetbot.sqlite3.
POSTS_DIRECTORY No Named post directory; defaults to ./posts.
DEV_GUILD_IDS No Comma-separated guild IDs for immediate slash command sync.

Set these variables in the process environment or your deployment platform. On first startup, MapRes loadConfig creates data/config.yaml from defaultconfigs/config.yaml. It does not overwrite an existing file. Edit that file and restart the bot.

servers:
  - name: smp
    description: Survival Multiplayer Server
    display-name: SMP
    calagopus:
      server-id: 75e88326-0ace-4866-af62-845493ccdced
    hungerbridge:
      url: https://smp.example.com
      token-id: root
      token-secret: replace-with-hungerbridge-secret

The name is the Discord command root and must be lowercase, unique, 1-32 characters, and valid Discord command syntax. The description is shown in Discord, display-name is used in embeds, and address is optional. Bot startup fails if the generated data/config.yaml is invalid.

For Calagopus, allocate one SERVER_PORT. Both webhook routes share it: /github/webhook for GitHub and /webhook for HungerBridge.

Commands

  • /settings show, /settings staff-role, /settings notification-channel, /settings owner, and /settings clear configure per-server values. They require Manage Server permission.
  • Settings are independent per Discord server. Without a notification channel, the bot skips channel notifications. Unset staff-role and alert-owner values display as STAFF and OWNER; the owner is only mentioned in critical alerts and does not bypass staff authorization.
  • Each configured YAML server name becomes a top-level command group, such as /smp status, /smp players, and /smp power.
  • /smp admin run and /smp admin statistics require the configured staff role.
  • /github link, /github unlink, /github list, and /github route manage repository destinations. These require Manage Server permission.
  • /post <name> publishes a configured .md or .yaml file to the channel where it is invoked. This requires Manage Server permission.
  • /ping and /help provide bot status and command guidance.

The shared webhook server handles GitHub at /github/webhook and HungerBridge at /webhook. Configure the GitHub URL and GITHUB_WEBHOOK_SECRET in each organization or repository webhook; HungerBridge requests use the X-Webhook-Token header.

Post Files

The configured posts directory is created on startup. /post update resolves update.md or update.yaml; specify an extension when both exist. Every invocation posts again. The bot does not keep a posting history or suppress duplicates.

Use .md for regular Discord Markdown message content. Use .yaml for structured messages with content, embeds, polls, attachments, mention rules, supported message flags, and URL buttons. YAML is declarative; it cannot run code or define custom button callbacks. User mentions must use Discord mention syntax or IDs, not bare usernames.

content: 'A new community update is available.'
embeds:
  - title: 'What changed'
    description: 'Read the [update notes](https://example.com/updates).'
    color: '#C82828'
    fields:
      - name: 'Highlights'
        value: 'New maps and server improvements'
        inline: false
buttons:
  - label: 'Read more'
    url: 'https://example.com/updates'
allowed_mentions:
  everyone: false
  users: true
  roles: true

Attachments are relative to the posts directory. Embed colors accept an integer or hex string. Polls accept a question, 2–10 answers, a duration from 1–32 hours, and an optional multiple boolean. tts, silent, and suppress_embeds control supported Discord message flags.

Development

python -m pip install -e '.[dev]'
pytest

The bot starts with a fresh SQLite database; it does not import data from previous versions.

Metadata

Release files for hungernetbot 1.0a5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hungernetbot 1.0a5
File Size Uploaded Provenance Actions
hungernetbot-1.0a5.tar.gz 46.5 kB With provenance Details for hungernetbot-1.0a5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hungernetbot 1.0a5
File Interpreter ABI Platform Actions
hungernetbot-1.0a5-py3-none-any.whl Python 3 none any Details for hungernetbot-1.0a5-py3-none-any.whl

Total release size: 93.1 kB

Release files / hungernetbot-1.0a5.tar.gz

Download URL hungernetbot-1.0a5.tar.gz
Size 46.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1b287c304c68b290dd6f9587451ba30c9fe553516f65a6030dd8490fca93c6bd
BLAKE2b-256 checksum
How to use checksums
16a97e4f3b3818c4768ce5eb073af3c7ad2a1d223008fb0514c6d77cc7ff70b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / hungernetbot-1.0a5-py3-none-any.whl

Download URL hungernetbot-1.0a5-py3-none-any.whl
Size 46.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
daa1553ba5c8015e1a45bbaf7a0fee304330ad59dc7ff7c37bb60eb5d4b3ce7b
BLAKE2b-256 checksum
How to use checksums
dbfde5ebaf6065c1c3ab229b7e68c29e6b3b50000da8cfe6714e0adccd05ec30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Security for hungernetbot 1.0a5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for hungernetbot-1.0a5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page