[PR #979] [MERGED] Discord Bot mk. 3 #986

Closed
opened 2026-02-15 15:57:25 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/RPCS3/discord-bot/pull/979
Author: @13xforever
Created: 3/25/2025
Status: Merged
Merged: 3/25/2025
Merged by: @clienthax

Base: masterHead: feature/dsp5


📝 Commits (10+)

  • 5f039d3 add global usings
  • 491b12a update collection initialization syntax
  • 207f7dc clean up usings
  • 43c7251 set langversion to latest, and enable nullable types in all projects
  • 70651bb use ellipses instead of three dots whenever appropriate
  • 001dd88 upgrade to D#+ v5 and migrate client initialization code
  • 29c2bef update namespaces and some enums
  • 1781c0e remove custom command error handler for now
  • 956ead8 updating more stuff
  • e068a78 update command check attribute code

📊 Changes

228 files changed (+5666 additions, -6569 deletions)

View changed files

📝 .gitignore (+0 -1)
📝 Clients/CirrusCiClient/CirrusCiClient.csproj (+5 -4)
📝 Clients/CompatApiClient/CompatApiClient.csproj (+1 -1)
📝 Clients/CompatApiClient/Compression/CompressedContent.cs (+1 -2)
📝 Clients/CompatApiClient/Compression/DecompressedContent.cs (+1 -2)
📝 Clients/GithubClient/GithubClient.csproj (+1 -1)
📝 Clients/IrdLibraryClient/IrdFormat/IrdParser.cs (+0 -1)
📝 Clients/IrdLibraryClient/IrdLibraryClient.csproj (+1 -1)
📝 Clients/IrdLibraryClient/POCOs/SearchResult.cs (+0 -1)
📝 Clients/MediafireClient/Client.cs (+4 -6)
📝 Clients/MediafireClient/MediafireClient.csproj (+1 -0)
📝 Clients/OneDriveClient/Client.cs (+2 -2)
📝 Clients/OneDriveClient/OneDriveClient.csproj (+1 -0)
📝 Clients/PsnClient/POCOs/App.cs (+1 -1)
📝 Clients/PsnClient/PsnClient.cs (+1 -1)
📝 Clients/PsnClient/PsnClient.csproj (+2 -1)
📝 Clients/YandexDiskClient/Client.cs (+3 -3)
📝 Clients/YandexDiskClient/YandexDiskClient.csproj (+1 -0)
CompatBot/Commands/Attributes/CheckAttributeWithReactions.cs (+24 -0)
CompatBot/Commands/Attributes/CheckBaseAttributeWithReactions.cs (+0 -38)

...and 80 more files

📄 Description

Most of the bot was re-written for Discord Application Commands.

Remember: no rebase, only merge commit.

Main goals:

  • Easier command discoverability by your average discord user
  • Reducing bot spam (errors, commands in random channels, etc) by utilizing ephemeral messages wherever possible
  • Reducing command argument validation and state management complexity in some cases (content filters, events, etc)
  • Easier access to most popular commands through context menus, and also auto complete for some command arguments
  • Pure UI/UX upgrade, no underlying data is changing, so it could be cleanly upgraded/downgraded at any time

Changelog highlights:

  • Migrated to DSharp+ v5 nightly
  • Enabled zstd compression for gateway communication
  • Removed Watchdog as D#+ does properly handle dirty socket disconnects (allegedly)
  • Enabled nullable types for all projects (some warnings are not fixed yet)
  • Implemented some Roslyn Analyzers for common Discord API limitations on command annotations (issues with emojis in names, length limits, etc)
  • All commands are now implemented as slash commands (CHAT_INPUT)
    • Exceptions are: audit *, bot import *, latest clear, latest set, sudo fix *, sudo say, sudo react, much, rate, compare
    • There is no equivalent to help for the remaining text commands, so they're completely undiscoverable for now
    • sudo bot * commands moved one level up to bot * commands (app commands have limitation of 3 levels for subcommands)
    • Vision is completely disabled as we don't have access to it anyway
    • New convenience context commands for user and message menus (limited to 5 commands per menu)
  • Specific command behavior changes:
    • Only some commands could be used in bot DMs now (marked with AllowDMUsage attribute): bot *, latest *, filter *, psn check *, sudo *, warnings *
    • All commands will respond with ephemeral messages (only visible to the user using the command)
      • Exceptions: sensitive data for mods (warning lists, etc), commands used in DMs or spam channels, mods using commands intended for users in help (explain, latest, etc)
    • bot configuration has auto complete for bot config parameters
    • bot shutdown was removed
    • filters and events have id auto complete for relevant subcommands
      • filters and events no longer have custom form editors, instead using optional arguments for update subcommands
    • compatibility, psn check updates, and psn rename have product code auto complete
    • explain has auto complete with content preview
      • explain list no longer pretty prints table of contents as embeds, instead dumping all terms as a text attachment (for now)
    • rename group commands were moved to user context menu (except for rename clean, dump, and list, which are currently disabled)
    • fortune import is now multi-threaded, and runs much faster
    • meme was enhanced
    • minesweeper now opens all safe cells on minefield generation instead only one 0 cell
    • pr commands got merged into one with more optional arguments
    • psn check content was removed as I doubt Sony will ever re-introduce web version of PSN Store for PS3
    • syscalls have auto complete for function names
    • warnings have been reworked the most:
      • All warning lists are now ephemeral
      • Users only see the message that they were warned, and how many recent/total warnings the have
      • Message context menu command now saves original message content as additional context, similar to log parsing
      • Warning ids have auto complete with user name and reason preview, optionally filtered by user id when the user argument is filled in (wonky, because Discord client caches auto complete lists based on the input in the auto complete argument only)
      • Warning list is now limited to 6 messages only (one response + five followup messages) as per interaction limitations (but honestly, no user should have so many warnings anyway)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/RPCS3/discord-bot/pull/979 **Author:** [@13xforever](https://github.com/13xforever) **Created:** 3/25/2025 **Status:** ✅ Merged **Merged:** 3/25/2025 **Merged by:** [@clienthax](https://github.com/clienthax) **Base:** `master` ← **Head:** `feature/dsp5` --- ### 📝 Commits (10+) - [`5f039d3`](https://github.com/RPCS3/discord-bot/commit/5f039d3939da1fcf2094cc76d2de11af7f8747b9) add global usings - [`491b12a`](https://github.com/RPCS3/discord-bot/commit/491b12a121b82e675e663d3daf43e125b063447c) update collection initialization syntax - [`207f7dc`](https://github.com/RPCS3/discord-bot/commit/207f7dc57a84ae8c031ff6442da42ef30d227886) clean up usings - [`43c7251`](https://github.com/RPCS3/discord-bot/commit/43c7251a57ed2113eb1016c38cc1f4df037fb064) set langversion to latest, and enable nullable types in all projects - [`70651bb`](https://github.com/RPCS3/discord-bot/commit/70651bb8dae87143e88fdb828a11a330894192ec) use ellipses instead of three dots whenever appropriate - [`001dd88`](https://github.com/RPCS3/discord-bot/commit/001dd8840b0696ca703f65dc98da2cbe61ad40a7) upgrade to D#+ v5 and migrate client initialization code - [`29c2bef`](https://github.com/RPCS3/discord-bot/commit/29c2bef51a1e09719ced0f391db64b7923165bb1) update namespaces and some enums - [`1781c0e`](https://github.com/RPCS3/discord-bot/commit/1781c0ef949ee1b6317318bc3290926a793897ad) remove custom command error handler for now - [`956ead8`](https://github.com/RPCS3/discord-bot/commit/956ead85f74c37bd5d69a0262c1b5f88ba008648) updating more stuff - [`e068a78`](https://github.com/RPCS3/discord-bot/commit/e068a7870bd039345dfd7b8f28f89887fd54626a) update command check attribute code ### 📊 Changes **228 files changed** (+5666 additions, -6569 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+0 -1) 📝 `Clients/CirrusCiClient/CirrusCiClient.csproj` (+5 -4) 📝 `Clients/CompatApiClient/CompatApiClient.csproj` (+1 -1) 📝 `Clients/CompatApiClient/Compression/CompressedContent.cs` (+1 -2) 📝 `Clients/CompatApiClient/Compression/DecompressedContent.cs` (+1 -2) 📝 `Clients/GithubClient/GithubClient.csproj` (+1 -1) 📝 `Clients/IrdLibraryClient/IrdFormat/IrdParser.cs` (+0 -1) 📝 `Clients/IrdLibraryClient/IrdLibraryClient.csproj` (+1 -1) 📝 `Clients/IrdLibraryClient/POCOs/SearchResult.cs` (+0 -1) 📝 `Clients/MediafireClient/Client.cs` (+4 -6) 📝 `Clients/MediafireClient/MediafireClient.csproj` (+1 -0) 📝 `Clients/OneDriveClient/Client.cs` (+2 -2) 📝 `Clients/OneDriveClient/OneDriveClient.csproj` (+1 -0) 📝 `Clients/PsnClient/POCOs/App.cs` (+1 -1) 📝 `Clients/PsnClient/PsnClient.cs` (+1 -1) 📝 `Clients/PsnClient/PsnClient.csproj` (+2 -1) 📝 `Clients/YandexDiskClient/Client.cs` (+3 -3) 📝 `Clients/YandexDiskClient/YandexDiskClient.csproj` (+1 -0) ➕ `CompatBot/Commands/Attributes/CheckAttributeWithReactions.cs` (+24 -0) ➖ `CompatBot/Commands/Attributes/CheckBaseAttributeWithReactions.cs` (+0 -38) _...and 80 more files_ </details> ### 📄 Description Most of the bot was re-written for [Discord Application Commands](https://discord.com/developers/docs/interactions/application-commands). Remember: no rebase, only merge commit. Main goals: * Easier command discoverability by your average discord user * Reducing bot spam (errors, commands in random channels, etc) by utilizing ephemeral messages wherever possible * Reducing command argument validation and state management complexity in some cases (content filters, events, etc) * Easier access to most popular commands through context menus, and also auto complete for some command arguments * Pure UI/UX upgrade, no underlying data is changing, so it could be cleanly upgraded/downgraded at any time Changelog highlights: * Migrated to [DSharp+ v5 nightly](https://github.com/DSharpPlus/DSharpPlus) * Enabled zstd compression for gateway communication * Removed `Watchdog` as D#+ does properly handle dirty socket disconnects (allegedly) * Enabled nullable types for all projects (some warnings are not fixed yet) * Implemented some Roslyn Analyzers for common Discord API limitations on command annotations (issues with emojis in names, length limits, etc) * All commands are now implemented as slash commands (`CHAT_INPUT`) * Exceptions are: `audit *`, `bot import *`, `latest clear`, `latest set`, `sudo fix *`, `sudo say`, `sudo react`, `much`, `rate`, `compare` * There is no equivalent to `help` for the remaining text commands, so they're completely undiscoverable for now * `sudo bot *` commands moved one level up to `bot *` commands (app commands have limitation of 3 levels for subcommands) * `Vision` is completely disabled as we don't have access to it anyway * New convenience context commands for user and message menus (limited to 5 commands per menu) * Specific command behavior changes: * Only some commands could be used in bot DMs now (marked with `AllowDMUsage` attribute): `bot *`, `latest *`, `filter *`, `psn check *`, `sudo *`, `warnings *` * All commands will respond with ephemeral messages (only visible to the user using the command) * Exceptions: sensitive data for mods (warning lists, etc), commands used in DMs or spam channels, mods using commands intended for users in help (`explain`, `latest`, etc) * `bot configuration` has auto complete for bot config parameters * `bot shutdown` was removed * `filters` and `events` have id auto complete for relevant subcommands * `filters` and `events` no longer have custom form editors, instead using optional arguments for `update` subcommands * `compatibility`, `psn check updates`, and `psn rename` have product code auto complete * `explain` has auto complete with content preview * `explain list` no longer pretty prints table of contents as embeds, instead dumping all terms as a text attachment (for now) * `rename` group commands were moved to user context menu (except for `rename clean`, `dump`, and `list`, which are currently disabled) * `fortune import` is now multi-threaded, and runs much faster * `meme` was enhanced * `minesweeper` now opens all safe cells on minefield generation instead only one `0` cell * `pr` commands got merged into one with more optional arguments * `psn check content` was removed as I doubt Sony will ever re-introduce web version of PSN Store for PS3 * `syscalls` have auto complete for function names * `warnings` have been reworked the most: * All warning lists are now ephemeral * Users only see the message that they were warned, and how many recent/total warnings the have * Message context menu command now saves original message content as additional context, similar to log parsing * Warning ids have auto complete with user name and reason preview, optionally filtered by user id when the `user` argument is filled in (wonky, because Discord client caches auto complete lists based on the input in the auto complete argument only) * Warning list is now limited to 6 messages only (one response + five followup messages) as per interaction limitations (but honestly, no user should have so many warnings anyway) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 15:57:25 -05:00
yindo closed this issue 2026-02-15 15:57:25 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: RPCS3/discord-bot#986