Skip to content

Prefixes Addon


addon

logger = logging.getLogger('scurrypy') module-attribute

C = TypeVar('C', bound=PrefixCommandContext) module-attribute

AddonHandler: TypeAlias = _AddonHandler[Any] module-attribute

AddonDecorator: TypeAlias = Callable[[AddonHandler], AddonHandler] module-attribute

PrefixAddon

Bases: Addon


              flowchart TD
              scurrypy.ext.prefixes.addon.PrefixAddon[PrefixAddon]
              scurrypy.bases.addon.Addon[Addon]

                              scurrypy.bases.addon.Addon --> scurrypy.ext.prefixes.addon.PrefixAddon
                


              click scurrypy.ext.prefixes.addon.PrefixAddon href "" "scurrypy.ext.prefixes.addon.PrefixAddon"
              click scurrypy.bases.addon.Addon href "" "scurrypy.bases.addon.Addon"
            

Addon that implements automatic registering and decorating prefix commands.

Parameters:

  • client (Client) –

    the Client object

  • application_id (Snowflake) –

    ID of the bot

  • prefix (str) –

    message prefix for commands

bot = client instance-attribute

application_id = application_id instance-attribute

listen

Listen for a prefix command.

Parameters:

  • name (str) –

    name of the command

    Important

    Prefix commands are CASE-INSENSITIVE.

  • handler (AddonHandler, default: None ) –

    callback for the command (if not a decorator)

dispatch async

Dispatch event to user-defined handler. Ignore bot responding to self and messages without the desired prefix.

Parameters: