Skip to content

Fix resilient Discord event logging#153

Draft
itay123458 wants to merge 275 commits into
codebymitch:mainfrom
itay123458:agent/fix-static-bot-status
Draft

Fix resilient Discord event logging#153
itay123458 wants to merge 275 commits into
codebymitch:mainfrom
itay123458:agent/fix-static-bot-status

Conversation

@itay123458

Copy link
Copy Markdown

What changed

  • centralize safe Discord event logging with explicit failure results
  • validate log-channel visibility, send, and embed permissions
  • add Hebrew logs for member, message, ban, nickname, and command-error events
  • preserve legacy log-channel configuration and cap embed values to Discord limits

Why

Logging was fragmented and several Discord events were not registered. Missing or inaccessible channels could silently prevent logs, while legacy configuration could incorrectly disable the logging service.

Impact

Commands continue to load and execute independently of logging failures. Server owners receive broader audit coverage once the configured logs channel is accessible.

Validation

  • syntax checked all 163 source files
  • all 17 automated tests passed
  • all 48 slash commands loaded with zero failures or duplicate names
  • logging event modules imported successfully
  • migration check attempted but PostgreSQL was unavailable locally (ECONNREFUSED); this change adds no migrations

itay123458 and others added 30 commits May 2, 2026 16:49
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All moderation commands now reply privately so only the moderator
sees the response. Admin/config commands (logging, goodbye, counter,
reactroles setup, verification remove) are also now ephemeral.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New /antinsfw command: enable/disable, config (action/log/threshold),
  exempt channels & roles, custom keyword management, status view
- AntiNsfwService: domain blocking, keyword filtering, Sightengine
  nudity-2.0 API scanning for images/videos
- Hooks into messageCreate — flagged messages are deleted before
  autoresponder/leveling run
- Actions: delete, warn (DM), timeout, kick, ban
- Added SIGHTENGINE_API_USER / SIGHTENGINE_API_SECRET to .env.example

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Lists all servers the bot is in with member counts and IDs,
sorted by size. Restricted to OWNER_IDS; returns an ephemeral
error for anyone else.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clicking the 🚪 button opens a modal to enter a server ID.
On submit the bot leaves that guild and confirms with the
server name and member count. Owner-only at both button and
modal level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d Unexpected Error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
play-dl fails with Invalid URL on YouTube streams due to API changes.
yt-dlp is actively maintained and handles YouTube bot detection properly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ode runtime

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
/music now searches YouTube and returns up to 5 results with
clickable links, duration, and channel info. Removes the voice
player system which had unresolvable UDP connectivity issues in Docker.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- /gorilla setup: creates a read-only #🦍・server-status channel that
  auto-edits every 5 minutes with live server status and Steam player count
- /gorilla status: manual on-demand status check
- /gorilla cosmetics: searchable browser of 35+ cosmetics by name/category
- /gorilla rooms add/remove/list: track up to 10 room codes; each update
  shows live player counts per room using the PlayFab community API
- Alerts in the status channel when server status degrades

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PlayFab blocks anonymous authentication (403 NotAuthorizedByTitle),
making room count lookups impossible without a real in-game session.
Removed the /gorilla rooms subcommand and PlayFab code entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- /gorilla patchnotes [count] — fetch latest 1-5 GT updates from Steam
- Auto-posts new patch notes to the gorilla status channel whenever
  a new update is detected (checks every 30 minutes)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GT updates every ~27 days, checking every 30 minutes was wasteful.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
itay123458 and others added 15 commits June 13, 2026 09:18
- /afk [reason]: set AFK status; bot notifies users who ping you and auto-removes on your next message
- /starboard setup: pins messages with enough ⭐ reactions to a dedicated channel (live count updates, removes if stars drop)
- Poll: End Poll button shows bar-chart results with vote counts, percentages and winner
- Add Partials (Message/Channel/Reaction) so starboard works on older cached messages
- Remove /uptime (redundant with /stats), /unixtime (niche), duplicate Moderation/autorole (Welcome/autorole already handles this)
- Fix: command count back to exactly 100

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…f re-setting it

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codebymitch

Copy link
Copy Markdown
Owner

If you intended to make these changes to your own bot then you need to push these changes to your forked repo, not the public one.

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.

3 participants