The Slack side of the adapter, for what the core has no op for.
bot_user_idcomes fromauth.test, read once. A failed read is tried again next time.usercallsusers.infoeach time.interactionis the entry for a decoded Interactivity payload (block_actionsorview_submission) and for a slash command's fields. It normalises withnormalize_interaction, calls the handler throughchat_interaction.handleinsidedeadline(2.5 seconds by default, the handler's share of Slack's 3), opens a modal withviews.openand callsHandler.refusedwhen it can't. It succeeds with the body to answer Slack with;Noneis an empty answer, andLate(a submit or command past the deadline) is no answer at all:layer_interactivityanswers 503 for it. It checks no signature and no app id: that is the transport's job.
Attributes#
| Attribute | Type | Description |
|---|---|---|
team_id | str | The workspace. |
bot_user_id | Effect[str, ChatError] | The bot's user id, from |
Functions#
__init__#
__init__(*, team_id, bot_user_id, adapter, interaction) -> None| Parameter | Type | Description |
|---|---|---|
team_id | str | |
bot_user_id | Effect[str, ChatError] | |
adapter | SlackAdapter | |
interaction | Callable[[object, Duration], Effect[Body, Never, Handler]] |
def __init__(
self,
*,
team_id: str,
bot_user_id: Effect[str, ChatError],
adapter: SlackAdapter,
interaction: Callable[[object, Duration], Effect[Body, Never, Handler]],
) -> None:
self._team_id = team_id
self._bot_user_id = bot_user_id
self._adapter = adapter
self._interaction = interactionuser#
user(id) -> Effect[SlackUser, ChatError]A user from users.info, with team, guest and Slack Connect status.
| Parameter | Type | Description |
|---|---|---|
id | str |
Returns Effect[SlackUser, ChatError]
def user(self, id: str) -> Effect[SlackUser, ChatError]:
"""A user from ``users.info``, with team, guest and Slack Connect status."""
return self._adapter.user(id)interaction#
interaction(payload, *, deadline=_interactions.DEFAULT_DEADLINE) -> Effect[Body, Never, Handler]Handles one interactivity payload or slash command; see the class.
| Parameter | Type | Description |
|---|---|---|
payload | object | |
deadline | DurationInput = _interactions.DEFAULT_DEADLINE |
Returns Effect[Body, Never, Handler]
def interaction(
self, payload: object, *, deadline: DurationInput = _interactions.DEFAULT_DEADLINE
) -> Effect[Body, Never, Handler]:
"""Handles one interactivity payload or slash command; see the class."""
return self._interaction(payload, from_input_unsafe(deadline))