Skip to content

wickedyoda/Glinet_discord_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

521 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GL.iNet UnOfficial Discord Bot

GL.iNet Bot Logo (Round) GL.iNet Bot Logo (Full)

Discord bot for GL.iNet community operations under the public GL.iNet UnOfficial Discord Bot name, with invite/code role access, moderation tools, search helpers, firmware/YouTube/LinkedIn/beta-program monitoring, member-activity analytics, utility commands, and a secured multi-guild web admin GUI.

Documentation

Detailed feature behavior, deployment options, environment variables, proxy variations, and security guidance are maintained in the wiki.

Quick Start (Docker)

  1. Copy env template:
cp .env.example .env
  1. Set required values in .env:
  • DISCORD_TOKEN
  • GUILD_ID
  • WEB_ADMIN_DEFAULT_PASSWORD (required when no web users exist yet)
  1. Start:
docker compose up -d --build
  1. Open web admin:
http://localhost:8080
https://localhost:8081

If no certificate is present, the bot generates a default self-signed certificate in ${DATA_DIR}/ssl/. Replace the generated files with your own certificate and key if you want a browser-trusted deployment.

Architecture Support

  • Native local builds (docker compose up -d --build) run on the host architecture (Apple Silicon arm64 or Intel/AMD amd64).
  • Published GHCR images are built as a multi-arch manifest for:
    • linux/amd64
    • linux/arm64
  • Optional multi-arch publish command:
docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t ghcr.io/<owner>/discord_invite_bot:multiarch-test \
  --push \
  .
  • Optional host-native local test image command:
docker compose build

What It Includes

  • Role access via invite links and 6-digit access codes
  • Bulk CSV role assignment
  • Guild-scoped tag responses (!tag + /tag selector)
  • Source-specific search commands for GL.iNet forums, OpenWrt forums, Reddit, GL.iNet docs, and AstroWarp docs
  • Utility commands for ping, uptime/status, URL shortening/expansion, quick image/greeting helpers, and fun commands like coin flip, 8-ball, meme, and dad joke
  • Country nickname suffix commands
  • Extended moderation commands and event logging
  • Moderator-only random member selection command that excludes staff roles and enforces a 7-day per-guild cooldown before the same member can be picked again
  • Firmware monitor (baseline + delta notifications)
  • YouTube subscription monitor with channel-to-Discord posting
  • LinkedIn public profile monitor with channel-to-Discord posting
  • GL.iNet beta program page monitor with add/remove notifications into Discord
  • Web-managed Reddit feed posting for new subreddit submissions
  • Member activity tracking with private /stats output, web top-20 views for rolling 90/30/7/1-day windows, and ZIP export from the web GUI
  • Guild-scoped welcome automation with optional channel post, optional DM, and optional uploaded image attachment with validated file type, byte-size limit, and dimension metadata
  • Web admin GUI with server selection, guild-scoped management pages, action history, member activity, YouTube subscriptions, LinkedIn profile subscriptions, GL.iNet beta-program monitoring, per-guild channel/tag settings, and role-access invite/code management
  • Optional guild allowlist mode for multi-guild deployments and public invites
  • Guild-scoped data quarantine on bot removal with 14-day restore window on same-ID rejoin before permanent purge
  • SQLite persistence with legacy merge import on startup
  • Local verification tooling for lint, tests, security checks, and Docker builds

Where To Find Details

Runtime Data and Logs

  • Primary DB: ${DATA_DIR}/bot_data.db
  • App log: ${LOG_DIR}/bot.log
  • Bot channel mirror log: ${LOG_DIR}/bot_log.log
  • Error log used by /logs: ${LOG_DIR}/container_errors.log
  • Web GUI interaction audit log: ${LOG_DIR}/web_gui_audit.log

Defaults:

  • DATA_DIR=data
  • LOG_DIR=/logs
  • LOG_HARDEN_FILE_PERMISSIONS=true (enforces 0700 on log dir and 0600 on log files when possible)
  • LOG_RETENTION_DAYS=90
  • LOG_ROTATION_INTERVAL_DAYS=1

Member Activity Backfill

To backfill member activity history once at startup, set:

  • MEMBER_ACTIVITY_BACKFILL_ENABLED=true
  • MEMBER_ACTIVITY_BACKFILL_GUILD_ID=<target guild id> or leave blank to use GUILD_ID
  • MEMBER_ACTIVITY_BACKFILL_SINCE=2026-02-01

Behavior:

  • Scans readable channel history from the selected guild starting at the given UTC date
  • Reuses completed backfill coverage so reruns only scan missing time ranges instead of rereading already indexed periods
  • Uses a one-time state record so the same completed backfill range does not rerun every restart
  • Only keeps the last 90 days of activity data
  • Feeds the same /stats command and /admin/member-activity web views used for live collection

Security

Contributing

Use complete commit and PR descriptions for all changes.

License

Maintainer

Created and maintained by WickedYoda

Support Discord: https://discord.gg/m6UjX6UhKe

About

No description, website, or topics provided.

Resources

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE
Unknown
LICENSE.md

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages