-
-
Notifications
You must be signed in to change notification settings - Fork 29
feat: add example cog with hybrid and slash command implementations #720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Reviewer's Guide by SourceryThis pull request introduces an example cog demonstrating hybrid and slash command implementations. It showcases the usage of Sequence diagram for hybrid command interactionsequenceDiagram
actor User
participant Discord
participant Tux
participant Example
participant EmbedCreator
Note over User: Can use either slash or prefix command
alt Slash Command
User->>Discord: /example
else Prefix Command
User->>Discord: !example
end
Discord->>Tux: Process command
Tux->>Example: example_hybrid_or_prefix()
Example->>EmbedCreator: create_embed()
EmbedCreator-->>Example: Return embed
Example-->>User: Send embed message
Sequence diagram for slash-only command interactionsequenceDiagram
actor User
participant Discord
participant Tux
participant Example
participant EmbedCreator
User->>Discord: /example-app-command
Discord->>Tux: Process interaction
Tux->>Example: example_app_command()
Example->>EmbedCreator: create_embed()
EmbedCreator-->>Example: Return embed
Example-->>User: Send embed message
Class diagram for Example cog implementationclassDiagram
class Example {
+bot: Tux
+example_hybrid_or_prefix(ctx: Context[Tux])
+example_app_command(interaction: Interaction)
}
class commands.Cog {
<<interface>>
}
class EmbedCreator {
+create_embed()
}
Example --|> commands.Cog
Example ..> EmbedCreator: uses
note for Example "Implements both hybrid and slash commands"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @electron271 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Please provide a more detailed PR description explaining the purpose of adding this example cog and clarify whether the current location (tux/cogs/utility/) is the intended final location for this file.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@kzndotsh needs to be figured out, you said would be added to the pre-0.1 documentation |
6abffdc
to
abe5239
Compare
Introduce a new `demos.py` file under the `admin` cog to showcase various discord.py features. This file serves as a comprehensive demonstration of best practices, including cog organization, command types (prefix, slash, hybrid), error handling, checks, database interaction, and UI elements like embeds. The demo commands are grouped under the `demo` command group for clarity and organization. refactor(utility): remove outdated example cog Remove the `example.py` file from the `utility` cog as its functionality is now covered by the new `demos.py` file. The new demo examples provide a more comprehensive and organized approach to demonstrating discord.py features, making the old example redundant.
make sure to move the example.py file somewhere else
Summary by Sourcery
New Features: