Commands
- class Command[source]
Base class for all Commands.
Subclass this and add the necessary fields to communicate the command to its
Receiver.Commands should simply carry data to their Receiver, they don’t do anything.
Using
@defineandfieldfrom attrs is recommended to keep it short.
- class Receiver(command: Command)[source]
Abstract base class for
Commandimplementations.Note
Command receivers are located the first time a
Commandis used by searching through all subclasses ofReceiverto find the one that accepts the command. It is cached after the first use.Note
If any of your Receivers are not being used when they should be, make sure they are imported when your application starts up. Usually, importing them in an
__init__.pyfile or keeping them in the same file with theirCommandwill fix it.