Skip to content

feat: Create Slash Commands For Avatar Modify Module - #1769

Open
Icebluewolf wants to merge 5 commits into
python-discord:mainfrom
Icebluewolf:feat/app_commands/avatar_modify
Open

feat: Create Slash Commands For Avatar Modify Module#1769
Icebluewolf wants to merge 5 commits into
python-discord:mainfrom
Icebluewolf:feat/app_commands/avatar_modify

Conversation

@Icebluewolf

Copy link
Copy Markdown
Contributor

Relevant Issues

Closes #1768

Description

Created a group of app commands under the name avatar_modify. The commands mirror the existing avatar modify commands: 8bitify, reverse, easterify, pride, spooky, mosaic.

The reverse command accepted text as an argument and returned the text reversed. This was moved to a separate top level reverse command to avoid overloading commands.
The pride list subcommand was removed in favor of fuzzy matching autocomplete.

Did you:

@jb3 jb3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use hybrid commands instead of adding a whole new cog for this migration.

The slash command switch should be ultimately change-neutral because we should for the most part just be switching out the command decorators and associated processing. We have prior art for this on most of our bots where we currently accept slash commands.

This makes the ultimate switch to slash-commands only simple, as we just make a final update to the decorator to make it no longer a text command.

Right now this PR introduces a lot of complexity and duplication re-implenenting logic and functionality we already have.

@Icebluewolf

Copy link
Copy Markdown
Contributor Author

My reasoning for creating a new cog is so that if/when it is decided to remove prefix commands all that would be required is to delete the old cog and potentially rename the app command cog. The docs for hybrid commands say

Following are currently not supported by hybrid commands:
- Variable number of arguments. e.g. *arg: int
- Group commands with a depth greater than 1.
- Most typing.Union types.

In this PR that would disqualify easterify, reverse, and pride without making changes to the existing prefix based commands. In addition a switch from hybrid to slash only would require ctx to be switched from Context to Interaction which would require all sent messages to be switched from ctx.send to ctx.response.send_message. This is not a large change but I am not sure what other considerations would have to take place for hybrid commands to work.

@Icebluewolf

Copy link
Copy Markdown
Contributor Author

root_aliases will not work, but this needs to be fixed in bot-core not here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Slash Commands For Avatar Modify Extension.

2 participants