Add guide for slash commands #6008
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!6008
Loading…
Reference in a new issue
No description provided.
Delete branch "pr/docs/cc-slash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the changes
Add a primer guide for Red 3.5 and Slash commands.
Have the changes in this PR been tested?
Tested for buildability, but not spell checked.
@ -0,0 +1,333 @@.. Slash Commands and InteractionsI would probably prefer it be made more explicit that this is a command by including the prefix, while still linking to the docs for it. I'm not sure if this will work, but maybe formatted like this example?
[p]slash(Applies to future cases that reference command docs like this)
At a minimum it needs to explicitly say both steps, though it might be helpful to add more explanation on top of this to walk them through enabling and syncing for the first time.
Keep the variable names consistent with how text command groups are usually done.
Calling the command the same thing as the argument makes it a little confusing that the
name="Desc"in the describe deco applies to the parameter name, not the function name. The previous example doesn't have this issue, so I don't think it's a huge deal, but something to consider for this and following examples.Just to include an example of
ephemeralin the hybrids.Yeah... this is a little late lol. The other examples don't point out syncing. Like I said above, add a brief explanation of the enable/sync process for the first command, then assume they know it for the rest.
This should either be removed, or rephrased to say that these commands only accept one argument, the contextual
userormessagethat was right clicked, and no more.Not sure why this is here, outside of a cog class
If teardown is here, and not in
__init__.py, it needs to be imported. Better yet, it too should be in__init__.py.MyCogwas not defined.Again, this is late and repeated.
@ -0,0 +66,4 @@async def hello(self, interaction: discord.Interaction):await interaction.response.send_message("Hello World!", ephemeral=True)One of the more useful decorators is the :func:`app.commands.choices` decorator.I don't think your example uses this decorator, rather it uses the
enummethod of specifying choices. There's like 3 different ways that all work for specifying choices, this is just one of them.The two remaining unresolved review comments from the last review still need to be addressed, but this otherwise looks good to go.
@ -0,0 +1,333 @@.. Slash Commands and Interactions