Skip to content

New avatarmod command [name subject to change] #710

@vcokltfre

Description

@vcokltfre

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?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendRelated to internal functionality and utilitiescategory: funRelated to fun and gamesstatus: approvedThe issue has received a core developer's approvaltype: featureRelating to the functionality of the application.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions