This repository has been archived by the owner on Aug 16, 2024. It is now read-only.
Command Design #77
VincentRPS
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Commands are one of the biggest parts of a Discord library today. It determines the user base and other such aspects.
It is important then that we establish a good and well-fleshed-out base for commands, and that's what this discussion does.
This is a more fleshed-out version of my old Pycord Book and explains commands in deeper sentiment.
Firstly, there will be a base command class that features the basic aspects of a class:
_invoke
- The command has been invoked_event_proc
- The event this command processes, data will be sent to_invoke
.name
- The command's namegroup
- The Group this command belongs to, should subclassBaseGroup
._callback
- The callback the command should call when invokedThese will all tie into a system that is adversely versatile and extensible. You can hook anything into it and it would work.
Now onto groups, groups are as the name suggests a group of commands, so it averagely just groups together
BaseCommand
s and even holds groups in itself.It would look something like this:
command
- create a new command in this group.group
- create a new group in this group.name
- The Group's name.While developers can add extra parameters to these bases, they have to be optional unless otherwise stated.
And that's mostly all of the systems a command baseline would need. Else than expansion, and maybe stuff like command concurrency this design should be nearly perfect in every aspect and will aspire to the next generation of Discord bots on Python.
Beta Was this translation helpful? Give feedback.
All reactions