Skip to content

Discord: Replace text commands with Slash Commands - #233

Open
kwsch wants to merge 22 commits into
masterfrom
slash
Open

Discord: Replace text commands with Slash Commands#233
kwsch wants to merge 22 commits into
masterfrom
slash

Conversation

@kwsch

@kwschkwsch commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Issue:

Discord's restrictions on bots for servers with >=10k members is impacting a few hosts. Bot hosts are currently mitigating this by having users mention their bot in every request, but this isn't a long-term solution. The proper fix is to migrate to slash commands. Slash commands have relatively matured and are now well supported by Discord.NET, the class library that SysBot.NET uses to interact with Discord.

Even though many hosts are not above 10k server members, Discord will likely tighten the limit in the coming months to further deter AI scraping bots/etc, so I expect this migration will need to be done eventually.

Interaction:

Slash commands are pretty nice to interact with as a user; the trade joining commands will have a modal popup for pasting in a set and entering a trade code, rather than users cramming it all into their textbar.
image

Command List

Discord automatically suggests commands based on when the user begins typing a slash, and indicates description tips for each parameter input.
image

Ephemeral

Ephemeral interactions result in less channel spam. The majority of bot replies are now ephemeral, as are the user's slash command input. Only a few commands are visible replies (mostly for transparency to the rest of the channel's viewers).
image
image
image
image

Impact:

Quite a few bot hosts are using custom forks where they've tweaked messages and formats of embeds. Tough luck; you can maintain that fork, or you can rebuild from here. A ton of commands were reworked and improved. I promise it won't be too difficult to replace strings or insert custom features.

  • Subtle bugs like DMs being closed at queue join no longer has an idle bot spin up a trade to a user who thought their trade wasn't created.
  • Teams (owner/team members) are now supported by the Owner commands.
  • The modals and extra commands I've added are nice Quality of Life for end users, and helps with command discovery.
  • Help command hides commands they can't use/see
  • Set parsing now supports all languages (not that anything really exports other language sets unless they're configured within PKHeX); set outputs can now be easily reprogrammed to display for other languages.
  • Users joining the queue no longer leak their trade requests/codes in the moments it takes the trade bot to delete their queue join request message. It's all ephemeral now! (This is a massive positive if they screw up entering in their request).
  • USB connectivity updated to the latest LibUSB library. Other SysBot.Base API signatures improved slightly.

Footnote:

  • As always, bots should be sequestered into specific channels rather than given full reign to a server; this limits the slash command visibility in the event you have multiple bots running different PKM formats.
  • The Manage Messages permission is no longer required (since we don't need to delete user queue join messages) -- you don't have to kick & reinvite your bot, but it might be a good thing to do so (security wise).
  • Sudo users will need to have the "Priority Voice" permission granted via any of their roles to be able to see sudo-specific commands.

kwsch added 21 commits August 9, 2026 00:43
Completely replaces message reading and the old style of commands.
Confine your bots to specific channels to reduce clutter in bot channels.
Be sure any sudo users have access to bypass slow mode so they can use the sudo commands; not sure if it is a great way to do that, but idk.
it doesn't like responding more than twice, so reuse the DeferAsync message with our update once we've thought about it.
Can probably make a custom attribute or something but I guess this reduces clutter.
- Ungroup `legality`; only a single command which is weird usage like `legality legality`
- Make Batch edit command info checks ephemeral (less channel spam)
- Add utility `transfer` command to convert a pkm attachment from one format to another
- Make Owner module accessible anywhere to the owner (such as DMs).
- Split Trade command in two, as group. Can potentially make it a modal?
- Add `convert` to target a specific version rather than game origin when converting a showdown set.
- Extract showdown set formatting logic, consistent yml usage and Language (can be easily changed by owners adjusting the code).
Logging: indicate actual channel count restored
Logging: indicate which modules were loaded, along with count of commands/modals/etc.
Make trade-set a modal command for better user interactions
Modals: correctly instantiate, indicate count in Info command
Queue status: ephemeral to reduce clutter
Update SysCord.cs
Was in group, needed to be treated as top level.
Screen command usage thru precondition checker before showing in Help. Extract the methods to make it a little cleaner.
Remove unnecessary manual precondition checking.
Specific commands may need it, but we can't look before we leap. Leave it as a developer tag.
Handle the specific error code for DM send fail in the Queue join
Fix the Uptime showing incorrect days uptime if running for longer than 31
Use datetime format (dash separating date and time, using periods for date separators) consistent with command push time. The version build-date format now matches the file-date format.
build time match discord dll (parent)
print as short datetime local timestamps within discord
revise the send messages ask to ping the owner to fix their setup
Autodetect dark mode if unconfigured; restyle controls same as PKHeX.
Handle error-after-join such as DMs off; need to ensure they're not in the queue if we handled any error.
Adds friendship to recognized Twitch lines
Adds "trade text" base64 input: With the rise of web implementations of PKHeX-like editors, users might want to copypaste a base64 set instead of dragdrop a file. This is a more web-friendly method of trading. Currently, no web editors support it, but could support it soon.
Cleans up trade join flow parameter passing
Handle DM closed enqueue, where bot tries to trade with a DMs-closed user (silent failure).
add Team name to bot info
Sign up for freeto 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.

1 participant

@kwsch