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.

On first startup, the bot also creates data/permissions.yaml with empty users and roles mappings. Add Discord user or role IDs with lists of permission nodes, then restart the bot:

users:
  "123456789012345678":
    - commands.ping
roles:
  "234567890123456789":
    - commands.smp.admin

Command nodes use commands.<slash-command-path>; dots separate nested commands. A node grants its descendants, so commands.smp.admin grants both /smp admin run and /smp admin statistics. User IDs and role IDs are alternative grants. Server owners and members with Discord Administrator bypass this file; Manage Server alone does not. Everyone else is denied unless a user or one of their roles matches.

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 notification-channel, /settings owner, and /settings clear configure per-server values. /oxide channel sets the destination for Oxide notifications. Access is controlled by data/permissions.yaml.
  • Settings are independent per Discord server. Without a notification channel, the bot skips its ready notification; without an Oxide channel, it skips Oxide notifications. The alert owner is only mentioned in critical alerts and does not bypass command permissions.
  • 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 are controlled by their commands.smp.admin permission node.
  • /github link, /github unlink, /github list, and /github route manage repository destinations and use their respective commands.github.* nodes.
  • /post <name> publishes a configured .md or .yaml file to the channel where it is invoked and uses the commands.post node.
  • /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, supported message flags, and URL buttons. YAML is declarative; it cannot run code or define custom button callbacks. Mentions use Discord mention syntax or IDs, not bare usernames.

content: 'A new community update is available.'
allowed_mentions:
  everyone: false
  users: true
  roles: false
  replied_user: false
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'

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. allowed_mentions supports independent everyone (including @here), users, roles, and replied_user booleans. Any omitted value retains Discord's default behavior; omit the whole mapping to leave mention handling unchanged.

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.0a18

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

Built distribution (wheel)

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

Total release size: 100.8 kB

Release files / hungernetbot-1.0a18.tar.gz

Download URL hungernetbot-1.0a18.tar.gz
Size 51.2 kB
Tags Source
SHA-256 checksum
How to use checksums
40ec1d863252d4fb84ef914a125e63dcd8ae1864641835776d75fa757d03cc4b
BLAKE2b-256 checksum
How to use checksums
9d2ae39fb8f4a7ee4803ef507b88cf7a313d02c7ea5079df53497703fd26fc02
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 6, 2026.

Transparency log

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

Download URL hungernetbot-1.0a18-py3-none-any.whl
Size 49.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93b7ff6148f340db11fbf18bf2299b4633b250daad5fed7202aa23cad0d99ec0
BLAKE2b-256 checksum
How to use checksums
f14f802ed37823e239243b426418765a38aea677d3262b136938769eb83f898e
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 6, 2026.

Transparency log

Security for hungernetbot 1.0a18

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.0a18.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 6, 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