sir-lancebot icon indicating copy to clipboard operation
sir-lancebot copied to clipboard

New avatarmod command [name subject to change]

Open vcokltfre opened this issue 4 years ago • 10 comments

Description

I'll preface this by saying that the command name is subject to change, I don't like the current one (avatarmod) a great deal, but I can't currently think of a better name. Essentially the command would do similar transformations to current commands like spookify, and other commands that play with the avatar image, but in a more convenient way.

Reasoning

It would mean that all avatar imagery stuff was in one place, which would make it easy to just add a new transformation function without needing a whole new cog or command, instead, you only need to worry about implementing the actual logic, which should make it easier for people to develop new cool avatar transformations.

Proposed Implementation

As opposed to the current system where there's an ever-growing list of new commands for each avatar operation, this would instead have two commands:

  • avatarmod [*options]
    • This would apply the given options to the image, for example, .avatarmod flip invert would flip the image vertically (horizontal is mirror), then take that flipped image and invert it, then return the image. This would of course need to be limited to a set number of operations you could perform on one thing to stop people from doing 10 image operations taking a long time.
  • avatarmod list
    • This would list the available operations that could be performed on the avatars.

The way this would work is that there'd be a base cog with the commands that essentially just acts as an interface - showing available options and communicating with helper functions, which brings me to the implementation of the actual feature. To create a new transformation of some sort you define a function that takes a PIL.Image.Image and returns a PIL.Image.Image, which is run in an executor by the avatarmod command function.

Would you like to implement this yourself?

  • [x] I'd like to implement this feature myself
  • [ ] Anyone can implement this feature

vcokltfre avatar Apr 30 '21 08:04 vcokltfre

I'd suggest waiting until https://github.com/python-discord/sir-lancebot/pull/597 is merged and building on top of that :D

ChrisLovering avatar Apr 30 '21 09:04 ChrisLovering

Yep, that was my intent, I just wanted to make the issue so i didn't forget :P

vcokltfre avatar Apr 30 '21 09:04 vcokltfre

Sounds good! Also, hope you didn't mind but I stole the name for the cog already and put it in the PR, since pfp_modify sounded terrible compared to avatarmod :)

ChrisLovering avatar Apr 30 '21 09:04 ChrisLovering

Haha, that's all good

vcokltfre avatar Apr 30 '21 09:04 vcokltfre

Yea, this sounds good to me, after the PR is merged, all of the effects are in the same file too, so should make it easier to get a list of options :)

ChrisLovering avatar Apr 30 '21 09:04 ChrisLovering

@ChrisLovering @vcokltfre #597 is now merged, this can be done.

Xithrius avatar Aug 23 '21 08:08 Xithrius

is this open?

Kronifer avatar Oct 07 '21 18:10 Kronifer

id be interested in doing this

Kronifer avatar Oct 07 '21 18:10 Kronifer

@vcokltfre Are you still wanting to do this yourself? If not, it seems Kronifer is interested.

ChrisLovering avatar Oct 08 '21 08:10 ChrisLovering

@vcokltfre would it be okay if i take this one

Kronifer avatar Jan 02 '22 17:01 Kronifer