This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Port command system to discord.ext.commands
#380
Merged
Mega-JC
merged 21 commits into
pygame-community:snakecore_port
from
Mega-JC:dpy_ext_commands
May 21, 2022
Merged
Port command system to discord.ext.commands
#380
Mega-JC
merged 21 commits into
pygame-community:snakecore_port
from
Mega-JC:dpy_ext_commands
May 21, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…mprovements and fixes
ankith26
reviewed
Apr 19, 2022
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.
we can probably drop the OOP structure if we are using ctx
in all methods anyways
The OOP based separation is still used by our command help system and commands that use separate methods for implementing command code, which are shared by different commands along the inheritance tree of the command cogs, I think it still has its use. |
Mega-JC
added
PR: Needs Core Review
A PR that is substantial, and needs more review
Code: Base Commands
Something related to base.py and/or command handling base code
Difficulty: Hard 😭
This will be hard to do for most contributors
enhancement ✨
Improvements to existing features
labels
Apr 20, 2022
Mega-JC
added
Code: Commands
For non-specific command related functionality
Priority: Medium ☕️
This is interesting and worth tackling when the chance arises
and removed
Difficulty: Hard 😭
This will be hard to do for most contributors
labels
May 12, 2022
Mega-JC
added
the
Difficulty: Hard 😭
This will be hard to do for most contributors
label
May 14, 2022
Mega-JC
added a commit
that referenced
this pull request
Aug 7, 2022
* begin porting PygameCommunityBot to discord.py v2.0 * run black * add snakecore as a dependency from GitHub repository * fix missing attribute from port * add thread messaging support, fix bugs relating to avatar/icon Asset objects * add support for receiving messages from threads in bot commands * fix embed refresh bug, sort requirements.txt * Fully port codebase to use `snakecore.utils` (#378) * begin porting to snakecore utils modules * partial port of snakecore.embed_utils * finish porting to snakecore utility modules * fix relocated constant typo * fix string typo for message browse command * add inactivity timeout parameter in EmbedPaginator * replace removed Messageable.trigger_typing with Messageable.typing * Port command system to `discord.ext.commands` (#380) * begin porting to discord.ext.commands * begin porting to discord.ext.commands 2 * finish porting command codebase to discord.ext.commands, many heavy improvements and fixes * revamp code for controlling the deletion of repsonse messages using reaction * add some extra references for globally used asyncio task objects (port) * improved command refresh command * add more module docstrings * fix typos, simplify decorator code * improve command error handling, improvements * fix imports and change command decorators * fix imports and change command decorators * remove CustomContext, improvements * more import cleanups * more import cleanups * prefer self.bot over common.bot in cogs * tweak clock command * abstract away common.global_task_set * tweak command refreshing code * modularize commands module into extensions, use pseudo DB from snakecore, delete emotion-related functionality and unused modules, implement bootstrap.json, various refactorings * run black * remove unused files * rename constants, remove more unneeded code * add bootstrap runtime override code * add missing assets * fully restructure entire codebase, turn command modules into extensions fixes and improvements * more fixes and improvments * update README * Major Codebase Refactoring: Adhere to `bot-template` repository structure (#383) * modularize commands module into extensions, use pseudo DB from snakecore, delete emotion-related functionality and unused modules, implement bootstrap.json, various refactorings * remove unused files and modules, rename constants * more fixes and improvments * update README and project requirements to Python 3.9 * correct some string inconsistencies * add optional uvloop dependency for optimization * add discord logging configuration, fixes and improvements * fix malfunctioning discord bot console * improve RedirectTextIOWrapper class * fix output bug in 'sudo' command * fix error in 'sudo edit' command * add group_by_author_timedelta kwarg to 'archive' command * fix error in previous commit * fix error in previous commit 2 * use snakecore 0.1.0 as a dependency version * change code formatter line-length to 88, improve command enabling/disabling, update runtime.txt * update setup.cfg * fix 'sudo edit' command bug
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Code: Base Commands
Something related to base.py and/or command handling base code
Code: Commands
For non-specific command related functionality
Difficulty: Hard 😭
This will be hard to do for most contributors
enhancement ✨
Improvements to existing features
PR: Needs Core Review
A PR that is substantial, and needs more review
Priority: Medium ☕️
This is interesting and worth tackling when the chance arises
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR ports the entire backbone of the current command system to
discord.py
'sdiscord.ext.commands
. This port is an addition to the changes in thesnakecore_port
branch.There are a few reasons for this:
1. Portable
The command framework is built right into
discord.py
and is bot-agnostic and server-agnostic by design, meaning that porting commands from one bot to another should be a lot easier.2. Popular
The framework itself is used by a large amount of
discord.py
users, and large projects (like the bots in the Python Discord) make use of it without many problems. It would also make it easy for others to provide external contributions to command-related code.3. Extensible, Feature-Rich
The framework is designed in a way that allows you to write commands and parse them using a built-in powerful system, as well as to allow for custom parsing of raw command input, should it be necessary. With enough time, one can work around limitations that might show at first.
Regarding
3.
: Commands still preserve the entirety of their input syntax, as the custom parser used in the command code is being ported intosnakecore
.This PR will hopefully allow for a more robust system to build command functionality on.