pinhook icon indicating copy to clipboard operation
pinhook copied to clipboard

Add a decorator for "pipe"able commands

Open RussellChamp opened this issue 6 years ago • 1 comments

One thing I've seen some bot creators do is create commands that can "chain" or "pipe" into each other. This would use the output of one command as the input for the next one. As an example, a bot may support the commands "!rainbow" and "!superhero". Chaining the two commands together (like "!superhero | !rainbow") would result in a random super hero printed in a rainbow color; the output from "!superhero" would be used to call "!rainbow ". The decorator would go on any plugin that is allowed to be "piped" into another. In this case, it would be on "!superhero" and the decorator would mean that only the user input up to the first pipe '|' would be sent to that command. I'd be interested in doing this at some point ~in the future!~

RussellChamp avatar Feb 22 '19 15:02 RussellChamp

This might actually have to be done in the bot class rather than as a decorator, but I love the idea!

archangelic avatar Feb 22 '19 18:02 archangelic