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.
SERVER_ID Yes Minecraft server UUID or short ID.
SERVER_STAFF_ROLE_ID Yes Role allowed to use server admin commands.
NOTIFICATION_CHANNEL_ID Yes Ready and HungerBridge event notifications.
OWNER_ID Yes Owner account for critical alerts and server access.
BRIDGE_URL Yes HungerBridge endpoint for the Minecraft server.
BRIDGE_TOKEN_ID Yes HungerBridge token ID.
BRIDGE_TOKEN_SECRET Yes HungerBridge token secret.
BRIDGE_WEBHOOK_TOKEN Yes Shared token for HungerCore's webhook receiver.
GITHUB_WEBHOOK_SECRET Yes GitHub webhook signing secret.
SERVER_NAME No Display name; defaults to Hunger SMP.
SERVER_DOMAIN No Public server address; defaults to localhost.
MINECRAFT_SERVER_PORT No Public Minecraft server port; defaults to 25565.
WEBHOOK_HOST No Bind address for both webhook servers; defaults to 0.0.0.0.
BRIDGE_WEBHOOK_PORT No HungerBridge webhook port; defaults to 8081.
GITHUB_WEBHOOK_PORT No GitHub webhook port; defaults to the container'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. Rotate credentials that were present in the legacy source before deploying; removing source files does not remove values from Git history.

For Calagopus, allocate the primary SERVER_PORT for GitHub webhooks and a second port for the HungerBridge webhook. Set BRIDGE_WEBHOOK_PORT to the second allocation. The panel must expose both ports publicly or through your reverse proxy.

Commands

  • /server status and /server players report server state.
  • /server admin run, /server admin power, and /server admin statistics require the configured owner or 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 GitHub receiver listens at /github/webhook. Configure that URL and GITHUB_WEBHOOK_SECRET in each GitHub repository's webhook settings. The HungerBridge receiver listens at /webhook and checks 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.0.dev2

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.0.dev2
File Size Uploaded Provenance Actions
hungernetbot-1.0.dev2.tar.gz 39.9 kB With provenance Details for hungernetbot-1.0.dev2.tar.gz

Built distribution (wheel)

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

Total release size: 80.3 kB

Release files / hungernetbot-1.0.dev2.tar.gz

Download URL hungernetbot-1.0.dev2.tar.gz
Size 39.9 kB
Tags Source
SHA-256 checksum
How to use checksums
581b440ab183f1ee6a23b5853c5b759a210e39ea73b4c1dfba6f273e347b4d3b
BLAKE2b-256 checksum
How to use checksums
c7a391a331f149e0e6506235b7e958f96c378815ffadc679b96a28ecbf033b7c
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 2, 2026.

Transparency log

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

Download URL hungernetbot-1.0.dev2-py3-none-any.whl
Size 40.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d081cd08e0a00da8bf4341510b976287caa3216fbe9df0d38838d516d344a61
BLAKE2b-256 checksum
How to use checksums
c181c87eaf070a9e0653bf9a070187ff4a58e833a18c20d884b26cfc8e3b479d
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 2, 2026.

Transparency log

Security for hungernetbot 1.0.dev2

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.0.dev2.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 2, 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