-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
This a feature request for adding a __main__.py file to wumpy-interactions that would be used to manually synchronize and migrate application commands based on registered callbacks in code. This is meant as a tool for more stable bot updates.
One might argue that migrations of application commands should be managed by a third party but that has the downside of not integrating as closely to the library and being unable to generate migrations from the code.
Description
Usage
The CLI tool should be housed in the __main__.py file such that it can be invoked with:
python -m wumpy.interactionsFor now, this file should only have one command migrate. This command only has one argument being where to find the InteractionApp that houses all commands, with the same format as extensions and ASGI (folder.file:variable). A typical invocation may look like this:
python -m wumpy.interactions migrate src.main:appFunctionality
After being involved the CLI should load the app requested and try to find its commands. It should then fetch all commands upstream (from Discord) and compare locally. This way, a confirmation dialogue showing everything that will be changed can be outputted. To bypass this confirmation the -y flag can be added to the migrate command.
If confirmed, the CLI tool should then make the bulk-update request and respond with a summarized changelog.
Implementation
I do not want this CLI tool to be the reason that another dependency is added. Therefore it should either be implemented directly, or using a module from the standard library. It'll be implement with async and wumpy-rest to make the requests since that is already a dependency.
Tasks
This is a summarized step-by-step list of changes that need to be made:
- Create the
__main__.pyfile and setup a basic CLI - Add the file loading functionality and be able to find the
InteractionAppinstance - Fetch registered commands from Discord and generate informative output about what's different to what the
InteractionApphas registered - Wait for confirmation and make the final request, also implementing the
-yflag to skip this prompt
Metadata
Metadata
Assignees
Labels
Type
Projects
Status