Active Core · tinybot.py & Field Logging

Right now, tinybot.py operates as a focused discord.py worker running under systemd at /opt/tinyfiles/worker/tinybot.py. It responds to both legacy prefix commands and direct mentions, writing append-only operational field notes straight to disk at tinybot_events.log.

!status
Confirms the bot process is online and listening, reporting live Discord WebSocket latency in milliseconds.
!log <entry>
Appends a timestamped note along with your Discord username directly into tinybot_events.log on disk.
!read
Reads back the last 5 entries from the server log inside a formatted code block without needing an SSH session.
!joke
Pulls a random programming joke from a built-in roster during server standby.

Systemd Service Model

The worker runs inside the /root/bot-env virtual environment on our IONOS VPS. Managed directly by systemd, it restarts automatically within 5 seconds on failure and pipes journal output straight to the system log:

[Unit] Description=tinyfiles.tv Discord Bot After=network.target [Service] Type=simple User=root WorkingDirectory=/opt/tinyfiles/worker Environment="DISCORD_BOT_TOKEN=********" ExecStart=/root/bot-env/bin/python3 /opt/tinyfiles/worker/tinybot.py Restart=always RestartSec=5 StandardOutput=journal StandardError=journal [Install] WantedBy=multi-user.target

Soon Planned · Two-File Pipeline Expansion

As the PHP and MySQL API endpoints come fully online, tinybot.py will scale its architecture into a dedicated two-file pipeline helper to automate creator submissions and moderator review flows:

Planned Module 1

pipeline_worker.py

Monitors incoming creator submissions from #submissions and the /submit modal, enforces size limits (5 MB max for HTML, 16 KB max for Python scripts), strips third-party trackers, and stages clean items into review.

Planned Module 2

mod_bridge.py

Links Discord moderator actions (✅ approve / ❌ reject reactions in #mod-queue) directly to the backend API — instantly pushing approved works live, broadcasting #releases updates, and pinging #status on health changes.

Planned Slash Commands & Background Loops

/ping
Measures and reports raw WebSocket connection latency.
/status
Issues a HEAD request to /healthz to verify live site availability.
/recent [count]
Fetches the last N published works directly from /api/works?sort=new.
/submit
Opens an interactive submission modal for creators to log metadata, titles, and attachments safely.
/queue
Restricted to moderators (Manage Messages permission) to inspect pending submissions and review reaction rules.
/about
Displays active uptime metrics since the last systemd daemon restart and confirms target API bindings.

Background Loops

  • Uptime (every 5 min): Pings /healthz and posts state changes to #status only on actual transitions (up/down) to avoid spam.
  • Community boards (every 2 min): Polls /api/community/posts and pushes new thread alerts to #community.
  • Releases (every 10 min): Polls /api/works?sort=new&limit=20 and announces unseen slugs to #releases.

Guardrails & What It Won't Do

  • No auto-publishing: Every submission requires human verification or moderator sign-off before reaching the public index.
  • No DM scraping: The bot operates strictly within designated server channels and public slash commands.
  • Zero third-party telemetry: No external trackers, webhooks, or cross-platform relays outside local API calls.

See Also

Check Captain's Log for live build updates, Language Models for automated screening notes, or Submit for current manual review guidelines.