A slash command definition: a name and at most one text argument.
description and argument are what registration needs (Slack
reads its own from the app manifest).
Attributes#
| Attribute | Type | Description |
|---|---|---|
id | I_co | |
description | str | |
argument | CommandArgument | None | |
kind | Literal['command'] = field(default='command', init=False) |
Functions#
__init__#
__init__(id, description, argument) -> None| Parameter | Type | Description |
|---|---|---|
id | I_co | |
description | str | |
argument | CommandArgument | None |
handler#
handler[RR = Never](fn) -> Handled[I_co, RR]This command's handler: it answers respond, a modal to open
or defer, never ack.
| Parameter | Type | Description |
|---|---|---|
fn | Callable[[CommandInvoked], Effect[Respond | OpenModal | Defer, Never, RR]] |
Returns Handled[I_co, RR]
def handler[RR = Never](
self, fn: Callable[[CommandInvoked], Effect[Respond | OpenModal | Defer, Never, RR]]
) -> Handled[I_co, RR]:
"""This command's handler: it answers ``respond``, a modal to open
or ``defer``, never ``ack``."""
return Handled(cast("Definition", self), fn)