Skip to content

Add server-aware moderation, automation, Apple, games, and music suites - #216

Open
sahmoee wants to merge 44 commits into
DiscordGIR:mainfrom
sahmoee:sowens-server
Open

Add server-aware moderation, automation, Apple, games, and music suites#216
sahmoee wants to merge 44 commits into
DiscordGIR:mainfrom
sahmoee:sowens-server

Conversation

@sahmoee

@sahmoee sahmoee commented Sep 6, 2026

Copy link
Copy Markdown

Problem and resulting behavior

GIRRewrite is closely coupled to one server's static channels, roles, workflows, and manual command-sync process. This PR adds a configurable community layer while preserving GIR's database, permission model, moderation commands, and Discord.py extension layout.

Current main compared with this PR

Area Current main This PR
Server configuration Static mappings and source assumptions Dashboard-managed community and feature files with portable runtime paths
Command deployment Manual !sync Optional guild-scoped automatic sync and dashboard command toggles
Discord limits Commands removed from source Full command catalog with an active set kept within Discord limits
Reports and moderation Separate legacy paths Report context action, configurable access and pings, evidence images, Ban/Dismiss controls, and trigger details
Scam handling Existing filter sources Unicode-normalized hidden invites, focused campaign patterns, and rate-limited grouped review
Member history Current member records Bounded Discord-ID identity history for names, roles, avatars, leave, and ban state
Channel behavior Built-in assumptions Monitored and ignored channels, threads, users, roles, and messages
Community tools Existing GIR utilities Welcome, autorole, starboard, suggestions, reaction roles, automatic replies, and engagement tools
Free games No combined provider Direct provider checks, filters, deduplication, and scheduled channel posts; no RSS
Music links Legacy optional Spotify behavior /music link, /music search, and optional channel link conversion
Validation No focused suite for these additions Command uniqueness/capacity and detection regression tests

Review changes

  • Restored /roblox and its registry coverage.
  • Staff-ban cases now record the second moderator who pressed Yes, while public logs continue to show the staff label.
  • Replaced macOS-only paths with GIR_DATA_DIR, defaulting to ~/.gir/data on all platforms. Individual file overrides remain available.
  • Raised the default starboard threshold from three to five.
  • Removed broad scam terms such as discord, apple, airdrop, password, and qr code; added false-positive tests for normal Apple-server discussion.
  • Restored the raid-phrase and filtered-word cache TTLs to 3600 seconds. Mutation paths still clear their caches immediately.
  • Removed redundant /tss and /apple groups. The existing AppleDB-backed /firmware implementation remains the source for firmware information.
  • Removed GIR's Last.fm account/profile commands so the established Last.fm bot can keep handling scrobbles and leaderboards. Cross-service music links remain.
  • Unexpected command failures are logged exactly once with a private reference ID and are not re-raised.
  • Consolidated this work in PR Add server-aware moderation, automation, Apple, games, and music suites #216; PR Add portable community, safety, and utility suites #215 is superseded.

Major additions

  • Four-image enforcement for members below the configured Member+ boundary.
  • Report cards include reporter identity, direct message links, preserved evidence images, exact trigger details, and rate-aware Ban/Dismiss actions.
  • Moderator and administrator ping options plus explicit reporter role/user access.
  • Ignored users, roles, messages, channels, and threads.
  • Multiple automatic text replies and emoji reactions per trigger.
  • Dashboard editing and full lists for tags, filters, raid phrases, command selection, and other community settings.
  • Persistent Discord identity history for cautious alt review.
  • Free and discounted game monitoring through direct providers, with no RSS sources.
  • Cross-service music discovery and links without storing a listening-service account.

Configuration

Existing required values remain unchanged: GIR_TOKEN, MAIN_GUILD_ID, OWNER_ID, and MongoDB settings.

Optional additions:

  • GIR_DATA_DIR: directory for runtime dashboard data; defaults to ~/.gir/data.
  • GIR_COMMUNITY_FILE: exact community settings file.
  • GIR_FEATURE_FILE: exact enabled-extension file.
  • GIR_SYNC_COMMANDS=False: disables automatic guild command sync.
  • GIR_LEGACY_JAILBREAK_FEATURES=True: enables server-specific legacy monitors.

Feature and community files fall back safely when absent. Server Members and Message Content privileged intents must be enabled, and GIR's role must sit above roles it moderates.

Validation

  • PYTHONPATH=. python3 -m unittest discover -s tests -v — 9 tests passed.
  • Python compilation passed for cogs, community_rules.py, data, extensions.py, main.py, and utils.
  • git diff --check passed.

sowens and others added 30 commits September 6, 2026 05:16
@sahmoee

sahmoee commented Sep 6, 2026

Copy link
Copy Markdown
Author

Refreshed against the latest sowens-server head (e44d6c4). The newest update adds Unicode-normalized hidden-invite detection, focused 1.* campaign-image detection, bounded evidence capture before source-message deletion, dashboard switches for both rules, and regression coverage. The deployed branch and PR head match; 9 tests pass and the live selected command set synchronizes successfully.

@bradleytechman bradleytechman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not a maintainer of GIR, but here's my review of it

i am also curious on why lastfm support is being integrated directly into GIR, since there aren't really any upsides, because the lastfm bot provides a shit ton on functionality, like scoreboards and stuff, additionally, it requires everything to be re connected which can be annoying

also what's #215? is it a duplicate of this but in one commit? if you're making a pr for one thing then just keep it on one pr, when being merged it can get combined into one commit if chosen

Comment thread cogs/commands/mod/modactions.py
Comment thread cogs/commands/mod/modactions.py
Comment thread cogs/community_suite.py Outdated
Comment thread cogs/community_suite.py Outdated
Comment thread cogs/community_suite.py Outdated
Comment thread tests/test_command_registry.py Outdated
Comment thread data/services/guild_service.py
Comment thread data/services/guild_service.py Outdated
Comment thread extensions.py Outdated
Comment thread main.py
@sahmoee

sahmoee commented Sep 9, 2026

Copy link
Copy Markdown
Author

Addressed all review comments in 1374634: restored /roblox, fixed staff-ban approver attribution, removed macOS-only paths, raised starboard defaults, narrowed scam signals, restored one-hour caches, removed redundant Apple/TSS and Last.fm account commands, and kept unexpected errors to one private log entry. PR #215 has been closed as superseded. The 9 focused tests, compilation checks, and diff validation pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants