CactusDev / CactusBot

An open source, community-written service-agnostic chat bot
MIT License
30 stars 6 forks source link

Magic command targeted responses #299

Closed Innectic closed 6 years ago

Innectic commented 7 years ago

Adding target=True to the @Command.command decorator, should make the command whisper the response back, and delete the original message.

2Cubed commented 7 years ago

Good call! While you can use the following, target=True would be far cleaner.

@Command.command()
async def thing(self, *, packet: "packet"):
    return MessagePacket("Hi!", target=packet.user)
@Command.command(target=True)
async def thing(self):
    return "Hi!"