Slack API
Every handle of the Slack fake: the slack fixture, the people and objects a test creates on it, and what they read and wait for. How to test a Slack app or agent, step by step, is in the Slack guide.
Each call is shown in every SDK's language, with its required options (the table under it lists them all). Arguments go first; options are TypeScript's trailing object, Python's keyword arguments and Rust's builder setters. The variable names are the ones the calls return elsewhere on these pages, so user is a SlackUser handle.
Besides the errors listed with each method, most methods can fail with action_requires, cross_workspace_credential, fake_actor_in_live_world, internal, invalid_argument, live_misconfigured, live_not_allowlisted, not_found, session_not_found, unauthorized, unsupported_in_live: a bad request, a closed session, or live mode refusing or misconfigured.
SlackFixture#
Returned by Session.slack().
| Field | Python / Rust | Type |
|---|---|---|
app | app | SlackApp |
apiUrl | api_url | string |
team | team | SlackTeam |
socketConnections | socket_connections | number |
createUser()#
Create a person in the workspace.
const user = await slack.createUser({ name: "…" });user = await slack.create_user(name="…")let user = slack.create_user().name("…").await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
name | name | string | yes | option |
id | id | string | no | option |
displayName | display_name | string | no | option |
realName | real_name | string | no | option |
email | email | string | no | option |
timezone | timezone | string | no | option |
admin | admin | boolean | no | option |
owner | owner | boolean | no | option |
guest | guest | boolean | no | option |
bot | bot | boolean | no | option |
token | token | string | no | option; read from CHANNELSTACK_SLACK_USER_{name}_TOKEN when left out |
browser | browser | { storageState: string } | no | option |
Returns SlackUser.
Errors invalid_auth, account_inactive.
users()#
The people this session created.
const users = await slack.users();users = await slack.users()let users = slack.users().await?;Returns SlackUsers.
createApp()#
Make another app in the workspace, with its own bot user, tokens and signing secret (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_SLACK_APP_<NAME>_WEBHOOK_URL, or over its own Socket Mode connection.
const app = await slack.createApp({ name: "…" });app = await slack.create_app(name="…")let app = slack.create_app().name("…").await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
name | name | string | yes | option |
scopes | scopes | string[] | no | option |
botEvents | bot_events | string[] | no | option |
Returns SlackApp.
Live: refused with unsupported_in_live: not yet: live, the workspace holds only the app channelstack has credentials for.
apps()#
The apps this session used: the built-in one first, then each it got from createApp, in the order it first did. Another session's are not_found here.
const apps = await slack.apps();apps = await slack.apps()let apps = slack.apps().await?;Returns SlackApps.
Live: refused with unsupported_in_live: not yet: live, the workspace holds only the app channelstack has credentials for.
conversations()#
The session's conversations, the one with the newest message last.
const conversations = await slack.conversations();conversations = await slack.conversations()let conversations = slack.conversations().await?;Returns SlackConversations.
createChannel()#
Create a channel. Only the listed participants are members; include the app for it to receive events.
const conversation = await slack.createChannel({ name: "…" });conversation = await slack.create_channel(name="…")let conversation = slack.create_channel().name("…").await?;| Parameter | Type | Required | |
|---|---|---|---|
name | string | no | option |
private | boolean | no | option |
participants | Array<SlackUser | SlackApp> | no | option |
topic | string | no | option |
purpose | string | no | option |
shared | boolean | no | option |
Returns SlackConversation.
Errors name_taken, unsupported_in_fake.
deliveries()#
Every event channelstack sent the agent for this session, with every attempt.
const deliveries = await slack.deliveries({ app });deliveries = await slack.deliveries(app=app)let deliveries = slack.deliveries().app(&app).await?;| Parameter | Type | Required | |
|---|---|---|---|
app | SlackApp | no | option |
Returns SlackDeliveries.
Live: refused with unsupported_in_live: Live, the platform delivers to the agent itself and channelstack isn't in the path (delivery chaos is fake-only).
calls()#
The Web API calls the agent made about this session's conversations, people and files. Calls about nothing a session owns (auth.test, users.list) are in no session.
const apiCalls = await slack.calls({ operation: "…" });api_calls = await slack.calls(operation="…")let api_calls = slack.calls().operation("…").await?;| Parameter | Type | Required | |
|---|---|---|---|
operation | string | no | option |
error | true | string | no | option |
Returns SlackApiCalls.
Live: needs proxy mode: no Slack API reads this back; proxy mode sees the agent's own calls. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
uninstallApp()#
The workspace uninstalls an app: the built-in one, or the one given. Undone when this session closes; run such tests on their own.
const uninstallDeliveries = await slack.uninstallApp({ app });uninstall_deliveries = await slack.uninstall_app(app=app)let uninstall_deliveries = slack.uninstall_app().app(&app).await?;| Parameter | Type | Required | |
|---|---|---|---|
app | SlackApp | no | option |
Returns SlackUninstallDeliveries.
Errors account_inactive.
Live: refused with unsupported_in_live: it revokes the app's tokens, and reinstalling needs the OAuth consent flow in a browser (a dedicated job, not every run).
fault()#
Inject a fault: into the agent's Web API calls (removed when this session closes), or drop its Socket Mode connection once.
const fault = await slack.fault({ type });fault = await slack.fault(type=type)let fault = slack.fault().r#type(r#type).await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
type | type · r#type | "rate_limit" | "latency" | "error" | "drop_socket" | yes | option |
operation | operation | string | no | option |
retryAfter | retry_after | Duration | no | option |
delay | delay | Duration | no | option |
after | after | Duration | no | option |
error | error | string | no | option |
times | times | number | no | option |
app | app | SlackApp | no | option |
Returns SlackFault.
Live: needs proxy mode: a fault changes what the agent's own calls get back, and only proxy mode sits between the agent and Slack. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
waitForCall()#
Waits for the next API call from the agent after the last one this handle returned: it polls calls() and never sleeps longer than it must.
const apiCall = await slack.waitForCall({ operation: "…" });api_call = await slack.wait_for_call(operation="…")let api_call = slack.wait_for_call().operation("…").await?;| Parameter | Type | Required | |
|---|---|---|---|
operation | string | no | filter |
error | true | string | no | filter |
timeout | Duration | no | default 10s |
Returns SlackApiCall. When the time is up, it fails with what it was waiting for.
SlackApp#
Returned by SlackFixture.createApp().
| Field | Python / Rust | Type |
|---|---|---|
id | id | string |
name | name | string |
kind | kind | "app" |
botUserId | bot_user_id | string |
botId | bot_id | string |
botToken | bot_token | string |
appToken | app_token | string |
signingSecret | signing_secret | string |
scopes | scopes | string[] |
say()#
An app a test made writes a top-level message, as its own chat.postMessage would: in a conversation it is a member of, or in a DM with the people in to.
const message = await app.say("…", { channel });message = await app.say("…", channel=channel)let message = app.say("…").channel(&channel).await?;| Parameter | Type | Required | |
|---|---|---|---|
message | string | SlackMessageInput | yes | positional |
channel | SlackConversation | no | option |
to | SlackUser | SlackApp | Array<SlackUser | SlackApp> | no | option |
Returns SlackMessage.
Errors not_in_channel, cannot_dm_bot, no_text, msg_too_long.
Live: refused with unsupported_in_live: not yet: live, the workspace holds only the app channelstack has credentials for.
reply()#
An app a test made replies in a thread: pass the message that starts it, or any reply in it.
const message = await app.reply("…", { thread });message = await app.reply("…", thread=thread)let message = app.reply("…").thread(&thread).await?;| Parameter | Type | Required | |
|---|---|---|---|
message | string | SlackMessageInput | yes | positional |
thread | SlackThread | SlackMessage | yes | option |
Returns SlackMessage.
Errors not_in_channel, no_text, msg_too_long.
Live: refused with unsupported_in_live: not yet: live, the workspace holds only the app channelstack has credentials for.
react()#
An app a test made reacts to a message.
const delivery = await app.react("…", { message });delivery = await app.react("…", message=message)let delivery = app.react("…").message(&message).await?;| Parameter | Type | Required | |
|---|---|---|---|
emoji | string | yes | positional |
message | SlackMessage | yes | option |
Returns SlackDelivery | undefined.
Errors not_in_channel, already_reacted.
Live: refused with unsupported_in_live: not yet: live, the workspace holds only the app channelstack has credentials for.
unreact()#
An app a test made takes its reaction back.
const delivery = await app.unreact("…", { message });delivery = await app.unreact("…", message=message)let delivery = app.unreact("…").message(&message).await?;| Parameter | Type | Required | |
|---|---|---|---|
emoji | string | yes | positional |
message | SlackMessage | yes | option |
Returns SlackDelivery | undefined.
Errors not_in_channel, no_reaction.
Live: refused with unsupported_in_live: not yet: live, the workspace holds only the app channelstack has credentials for.
SlackUser#
Returned by SlackFixture.createUser().
| Field | Python / Rust | Type |
|---|---|---|
id | id | string |
name | name | string |
kind | kind | "user" |
displayName | display_name | string |
realName | real_name | string |
email | email | string | undefined |
isAdmin | is_admin | boolean |
isBot | is_bot | boolean |
say()#
Post a top-level message in a conversation, or in a DM with the people in to.
const message = await user.say("…", { channel });message = await user.say("…", channel=channel)let message = user.say("…").channel(&channel).await?;| Parameter | Type | Required | |
|---|---|---|---|
message | string | SlackMessageInput | yes | positional |
channel | SlackConversation | no | option |
to | SlackUser | SlackApp | Array<SlackUser | SlackApp> | no | option |
files | string | FileInput[] | no | option |
Returns SlackMessage.
Errors not_in_channel, no_text, msg_too_long.
reply()#
Reply in a thread: pass the message that starts it, or any reply in it.
const message = await user.reply("…", { thread });message = await user.reply("…", thread=thread)let message = user.reply("…").thread(&thread).await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
message | message | string | SlackMessageInput | yes | positional |
thread | thread | SlackThread | SlackMessage | yes | option |
alsoSendToChannel | also_send_to_channel | boolean | no | option |
files | files | string | FileInput[] | no | option |
Returns SlackMessage.
Errors not_in_channel, no_text, msg_too_long.
edit()#
Edit one of this person's own messages.
const result = await user.edit("…", { message });result = await user.edit("…", message=message)let result = user.edit("…").message(&message).await?;| Parameter | Type | Required | |
|---|---|---|---|
text | string | SlackMessageInput | yes | positional |
message | SlackMessage | yes | option |
Returns SlackMessage.
Errors not_in_channel, cant_update_message, no_text.
delete()#
Delete a message: this person's own, or anyone's for an admin.
await user.delete({ message });await user.delete(message=message)user.delete().message(&message).await?;| Parameter | Type | Required | |
|---|---|---|---|
message | SlackMessage | yes | option |
Returns nothing.
Errors not_in_channel, cant_delete_message.
click()#
Click a button, found by its label or action_id: on a message, or on the app's latest message that has it in a thread or a conversation.
const delivery = await user.click("…", { message });delivery = await user.click("…", message=message)let delivery = user.click("…").message(&message).await?;| Parameter | Type | Required | |
|---|---|---|---|
button | string | SlackButtonRef | yes | positional |
message | SlackMessage | no | option |
thread | SlackThread | SlackMessage | no | option |
channel | SlackConversation | no | option |
Returns SlackDelivery | undefined. While refused with not_found, it tries again until the wait's timeout.
Errors not_in_channel, dispatch_failed.
select()#
Choose from a select menu on a message: options by their text or value, the menu by its placeholder or action_id.
const delivery = await user.select(option, { menu: "…", message });delivery = await user.select(option, menu="…", message=message)let delivery = user.select(option).menu("…").message(&message).await?;| Parameter | Type | Required | |
|---|---|---|---|
option | string | string[] | yes | positional |
menu | string | SlackMenuRef | yes | option |
message | SlackMessage | yes | option |
Returns SlackDelivery. While refused with not_found, it tries again until the wait's timeout.
Errors not_in_channel, dispatch_failed.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
shortcut()#
Run an app's message shortcut on a message: it goes to that app alone.
const delivery = await user.shortcut("…", { message });delivery = await user.shortcut("…", message=message)let delivery = user.shortcut("…").message(&message).await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
callbackId | callback_id | string | yes | positional |
message | message | SlackMessage | yes | option |
app | app | SlackApp | no | option |
Returns SlackDelivery.
Errors not_in_channel, dispatch_failed.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
runCommand()#
Run an app's slash command in a conversation, e.g. /deploy web staging: it goes to that app alone.
const delivery = await user.runCommand("…", { channel });delivery = await user.run_command("…", channel=channel)let delivery = user.run_command("…").channel(&channel).await?;| Parameter | Type | Required | |
|---|---|---|---|
command | string | yes | positional |
channel | SlackConversation | yes | option |
app | SlackApp | no | option |
Returns SlackDelivery.
Errors not_in_channel, dispatch_failed.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
stop()#
Press Stop on the app's work in a thread: what is streaming there ends, and the app is told.
const delivery = await user.stop({ thread });delivery = await user.stop(thread=thread)let delivery = user.stop().thread(&thread).await?;| Parameter | Type | Required | |
|---|---|---|---|
thread | SlackThread | SlackMessage | yes | option |
Returns SlackDelivery.
Errors not_in_channel, stop_unavailable.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
openAgentThread()#
Open an app's split view: a new thread in this person's DM with that app, started from the channel they are looking at.
const thread = await user.openAgentThread({ from });thread = await user.open_agent_thread(from_=from_)let thread = user.open_agent_thread().from(&from).await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
from | from_ · from | SlackConversation | no | option |
app | app | SlackApp | no | option |
Returns SlackThread.
Errors split_view_unavailable.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
pickPrompt()#
Pick one of the prompts the app suggested in a thread: this person says its message there.
const message = await user.pickPrompt("…", { thread });message = await user.pick_prompt("…", thread=thread)let message = user.pick_prompt("…").thread(&thread).await?;| Parameter | Type | Required | |
|---|---|---|---|
title | string | yes | positional |
thread | SlackThread | SlackMessage | yes | option |
Returns SlackMessage. While refused with not_found, it tries again until the wait's timeout.
Errors not_in_channel.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
switchContext()#
Look at another channel while the split view stays open: the app is told the new context.
const delivery = await user.switchContext(channel, { thread });delivery = await user.switch_context(channel, thread=thread)let delivery = user.switch_context(&channel).thread(&thread).await?;| Parameter | Type | Required | |
|---|---|---|---|
channel | SlackConversation | yes | positional |
thread | SlackThread | SlackMessage | yes | option |
Returns SlackDelivery.
Errors not_in_channel, split_view_unavailable.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
modals()#
The modals the app opened for this person, in the order it opened them; open says which are still up.
const modals = await user.modals();modals = await user.modals()let modals = user.modals().await?;Returns SlackModals.
Live: needs proxy mode: no Slack API reads this back; proxy mode sees the agent's own calls. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
react()#
Add an emoji reaction to a message.
const delivery = await user.react("…", { message });delivery = await user.react("…", message=message)let delivery = user.react("…").message(&message).await?;| Parameter | Type | Required | |
|---|---|---|---|
emoji | string | yes | positional |
message | SlackMessage | yes | option |
Returns SlackDelivery | undefined.
Errors not_in_channel, already_reacted.
unreact()#
Remove this person's emoji reaction from a message.
const delivery = await user.unreact("…", { message });delivery = await user.unreact("…", message=message)let delivery = user.unreact("…").message(&message).await?;| Parameter | Type | Required | |
|---|---|---|---|
emoji | string | yes | positional |
message | SlackMessage | yes | option |
Returns SlackDelivery | undefined.
Errors not_in_channel, no_reaction.
openDM()#
Open (or reuse) a DM with the app, another person, or several.
const conversation = await user.openDM(participants);conversation = await user.open_dm(participants)let conversation = user.open_dm(participants).await?;| Parameter | Type | Required | |
|---|---|---|---|
participants | SlackUser | SlackApp | Array<SlackUser | SlackApp> | yes | positional |
Returns SlackConversation.
invite()#
Invite people or the app to a channel.
await user.invite(participants, { channel });await user.invite(participants, channel=channel)user.invite(participants).channel(&channel).await?;| Parameter | Type | Required | |
|---|---|---|---|
participants | SlackUser | SlackApp | Array<SlackUser | SlackApp> | yes | positional |
channel | SlackConversation | yes | option |
Returns nothing.
Errors not_in_channel, already_in_channel, method_not_supported_for_channel_type.
kick()#
Remove someone from a channel.
await user.kick(participant, { channel });await user.kick(participant, channel=channel)user.kick(&participant).channel(&channel).await?;| Parameter | Type | Required | |
|---|---|---|---|
participant | SlackUser | SlackApp | yes | positional |
channel | SlackConversation | yes | option |
Returns nothing.
Errors not_in_channel, method_not_supported_for_channel_type.
ephemeral()#
Messages only this person can see.
const ephemeralMessages = await user.ephemeral();ephemeral_messages = await user.ephemeral()let ephemeral_messages = user.ephemeral().await?;Returns SlackEphemeralMessages. It reads once the app is quiet.
Live: needs proxy mode: no Slack API reads this back; proxy mode sees the agent's own calls. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
waitForModal()#
Waits for the next open modal from the agent after the last one this handle returned: it polls modals() and never sleeps longer than it must.
const modal = await user.waitForModal();modal = await user.wait_for_modal()let modal = user.wait_for_modal().await?;| Parameter | Type | Required | |
|---|---|---|---|
title | string | RegExp | no | contains, or matches |
timeout | Duration | no | default 10s |
Returns SlackModal. When the time is up, it fails with what it was waiting for.
SlackMessage#
Returned by SlackApp.say(), SlackApp.reply(), SlackUser.say(), SlackUser.reply().
| Field | Python / Rust | Type |
|---|---|---|
channel | channel | string |
ts | ts | string |
conversation | conversation | SlackConversation |
author | author | SlackUser | SlackApp |
text | text | string |
blocks | blocks | unknown[] |
files | files | string[] |
postedAt | posted_at | string |
threadTs | thread_ts | string | undefined |
edited | edited | boolean |
visibleTo | visible_to | SlackUser | undefined |
thread | thread | SlackThread |
delivery | delivery | SlackDelivery | undefined |
stream | stream | SlackStream | undefined |
refresh()#
Re-read a message: its latest text, edits and deliveries.
const updated = await message.refresh();updated = await message.refresh()let updated = message.refresh().await?;Returns SlackMessage.
reactions()#
The reactions on a message, and who added each.
const reactions = await message.reactions();reactions = await message.reactions()let reactions = message.reactions().await?;Returns SlackReactions.
transcript()#
A message and the replies under it as a person would read them.
const transcript = await message.transcript({ as });transcript = await message.transcript(as_=as_)let transcript = message.transcript().r#as(&r#as).await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
as | as_ · r#as | SlackUser | SlackApp | no | option |
Returns SlackTranscript.
deliveryFor()#
The first delivery this message caused to this app (decision 0027), or nothing when it wasn't told.
const delivery = await message.deliveryFor(app);delivery = await message.delivery_for(app)let delivery = message.delivery_for(&app).await?;| Parameter | Type | Required | |
|---|---|---|---|
app | SlackApp | yes | positional |
Returns SlackDelivery | undefined.
Live: refused with unsupported_in_live: Live, the platform delivers to the agent itself and channelstack isn't in the path (delivery chaos is fake-only).
deliveries()#
Every delivery this message caused to the agent.
const messageDeliveries = await message.deliveries();message_deliveries = await message.deliveries()let message_deliveries = message.deliveries().await?;Returns SlackMessageDeliveries.
Live: refused with unsupported_in_live: Live, the platform delivers to the agent itself and channelstack isn't in the path (delivery chaos is fake-only).
SlackConversation#
Returned by SlackFixture.createChannel(), SlackUser.openDM().
| Field | Type |
|---|---|
id | string |
kind | "channel" | "private_channel" | "im" | "mpim" |
name | string | undefined |
latestMessage()#
The newest message of a conversation, replies included.
const message = await conversation.latestMessage();message = await conversation.latest_message()let message = conversation.latest_message().await?;Returns SlackMessage.
messages()#
Top-level messages of a conversation, oldest first.
const messages = await conversation.messages();messages = await conversation.messages()let messages = conversation.messages().await?;Returns SlackMessages.
members()#
The people and apps in a conversation.
const members = await conversation.members();members = await conversation.members()let members = conversation.members().await?;Returns SlackMembers.
transcript()#
The conversation as a person would read it, threads included.
const transcript = await conversation.transcript({ as });transcript = await conversation.transcript(as_=as_)let transcript = conversation.transcript().r#as(&r#as).await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
as | as_ · r#as | SlackUser | SlackApp | no | option |
Returns SlackTranscript.
waitForMessage()#
Waits for the next message after the last one this handle returned: it polls messages() and never sleeps longer than it must.
const message = await conversation.waitForMessage({ from: "my-agent" });message = await conversation.wait_for_message(from_="my-agent")let message = conversation.wait_for_message().from("my-agent").await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
from | from_ · from | SlackUser | SlackApp | string | no | a handle, or a name |
timeout | timeout | Duration | no | default 10s |
Returns SlackMessage. When the time is up, it fails with what it was waiting for.
SlackThread#
Returned by SlackUser.openAgentThread().
| Field | Type |
|---|---|
channel | string |
ts | string |
conversation | SlackConversation |
suggestedPrompts()#
The prompts the app suggested in a thread.
const suggestedPrompts = await thread.suggestedPrompts();suggested_prompts = await thread.suggested_prompts()let suggested_prompts = thread.suggested_prompts().await?;Returns SlackSuggestedPrompts. It reads once the app is quiet.
Live: needs proxy mode: no Slack API reads this back; proxy mode sees the agent's own calls. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
root()#
The message that starts a thread, as it is now.
const message = await thread.root();message = await thread.root()let message = thread.root().await?;Returns SlackMessage.
replies()#
Replies in a thread, oldest first, without the message that starts it.
const replies = await thread.replies();replies = await thread.replies()let replies = thread.replies().await?;Returns SlackReplies.
status()#
What the agent is doing in a thread: its status line, an open stream, or idle.
const threadStatus = await thread.status();thread_status = await thread.status()let thread_status = thread.status().await?;Returns SlackThreadStatus.
Live: needs proxy mode: no Slack API reads this back; proxy mode sees the agent's own calls. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
transcript()#
A thread as a person would read it.
const transcript = await thread.transcript({ as });transcript = await thread.transcript(as_=as_)let transcript = thread.transcript().r#as(&r#as).await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
as | as_ · r#as | SlackUser | SlackApp | no | option |
Returns SlackTranscript.
waitForReply()#
Waits for the next reply after the last one this handle returned: it polls replies() and never sleeps longer than it must.
const message = await thread.waitForReply({ from: "my-agent" });message = await thread.wait_for_reply(from_="my-agent")let message = thread.wait_for_reply().from("my-agent").await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
from | from_ · from | SlackUser | SlackApp | string | no | a handle, or a name |
timeout | timeout | Duration | no | default 10s |
Returns SlackMessage. When the time is up, it fails with what it was waiting for.
latestReply()#
The latest reply, once the app is quiet. Waits for at least one: it polls replies() and never sleeps longer than it must.
const message = await thread.latestReply({ from: "my-agent" });message = await thread.latest_reply(from_="my-agent")let message = thread.latest_reply().from("my-agent").await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
from | from_ · from | SlackUser | SlackApp | string | no | a handle, or a name |
timeout | timeout | Duration | no | default 10s |
quietFor | quiet_for | Duration | no | default 750ms |
Returns SlackMessage. When the time is up, it fails with what it was waiting for.
SlackDelivery#
Returned by SlackApp.react(), SlackApp.unreact(), SlackUser.click(), SlackUser.select().
| Field | Python / Rust | Type |
|---|---|---|
id | id | string |
channel | channel | "slack" |
app | app | string |
type | type · r#type | string |
eventType | event_type | string | undefined |
eventId | event_id | string | undefined |
payload | payload | unknown | undefined |
attempts | attempts | DeliveryAttempt[] |
status | status | "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable" |
refresh()#
Re-read a delivery: its attempts and status.
const updated = await delivery.refresh();updated = await delivery.refresh()let updated = delivery.refresh().await?;Returns SlackDelivery.
Live: refused with unsupported_in_live: Live, the platform delivers to the agent itself and channelstack isn't in the path (delivery chaos is fake-only).
resend()#
Send the delivery again, unchanged or forged: a wrong signature, or a timestamp outside the replay window.
const deliveryAttempt = await delivery.resend({ badSignature });delivery_attempt = await delivery.resend(bad_signature=bad_signature)let delivery_attempt = delivery.resend().bad_signature(bad_signature).await?;| Parameter | Python / Rust | Type | Required | |
|---|---|---|---|---|
badSignature | bad_signature | boolean | no | option |
stale | stale | boolean | no | option |
headers | headers | Record<string, string> | no | option |
Returns DeliveryAttempt.
Live: refused with unsupported_in_live: Live, the platform delivers to the agent itself and channelstack isn't in the path (delivery chaos is fake-only).
retry()#
Retry the way Slack does: the same payload, with X-Slack-Retry-Num and X-Slack-Retry-Reason.
const deliveryAttempt = await delivery.retry({ after });delivery_attempt = await delivery.retry(after=after)let delivery_attempt = delivery.retry().after(after).await?;| Parameter | Type | Required | |
|---|---|---|---|
after | Duration | no | option |
reason | "http_timeout" | "http_error" | "too_many_redirects" | no | option |
Returns DeliveryAttempt.
Live: refused with unsupported_in_live: Live, the platform delivers to the agent itself and channelstack isn't in the path (delivery chaos is fake-only).
settled()#
Waits for the delivery to settle: it polls refresh() and never sleeps longer than it must.
const updated = await delivery.settled();updated = await delivery.settled()let updated = delivery.settled().await?;| Parameter | Type | Required | |
|---|---|---|---|
timeout | Duration | no | default 10s |
Returns SlackDelivery. When the time is up, it fails with what it was waiting for.
SlackStream#
Returned by SlackStream.refresh().
| Field | Python / Rust | Type |
|---|---|---|
channel | channel | string |
ts | ts | string |
state | state | "open" | "stopped" | "completed" |
chunks | chunks | string[] |
startedAt | started_at | string |
endedAt | ended_at | string | undefined |
refresh()#
Re-read a streamed message's stream: its state and what was streamed so far.
const updated = await stream.refresh();updated = await stream.refresh()let updated = stream.refresh().await?;Returns SlackStream.
Live: needs proxy mode: no Slack API reads this back; proxy mode sees the agent's own calls. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
ended()#
Waits for the stream to end: it polls refresh() and never sleeps longer than it must.
const updated = await stream.ended();updated = await stream.ended()let updated = stream.ended().await?;| Parameter | Type | Required | |
|---|---|---|---|
timeout | Duration | no | default 10s |
Returns SlackStream. When the time is up, it fails with what it was waiting for.
SlackModal#
| Field | Python / Rust | Type |
|---|---|---|
viewId | view_id | string |
user | user | SlackUser |
title | title | string |
blocks | blocks | unknown[] |
open | open | boolean |
errors | errors | Record<string, string> |
values()#
What is filled in: each input by its label (or action_id), with the text a person sees in it.
const modalValues = await modal.values();modal_values = await modal.values()let modal_values = modal.values().await?;Returns SlackModalValues.
Live: needs proxy mode: no Slack API reads this back; proxy mode sees the agent's own calls. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
submit()#
Fill in inputs, by label or block_id.action_id, and submit the modal.
const delivery = await modal.submit();delivery = await modal.submit()let delivery = modal.submit().await?;| Parameter | Type | Required | |
|---|---|---|---|
values | Record<string, string | string[]> | no | positional |
Returns SlackDelivery.
Errors dispatch_failed.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
close()#
Close the modal. The app is told only if it asked to be (notify_on_close).
const delivery = await modal.close();delivery = await modal.close()let delivery = modal.close().await?;Returns SlackDelivery | undefined.
Errors dispatch_failed.
Live: needs the browser actor: Slack sends this only when a person does it in the client; no API does it as a person. The browser actor doesn't do this yet (#47), so for now the call is refused with action_requires and the test is skipped.
SlackFault#
Returned by SlackFixture.fault().
| Field | Type |
|---|---|
id | string |
undo()#
Remove a fault.
await fault.undo();await fault.undo()fault.undo().await?;Returns nothing. Disposing the handle calls it.
Live: needs proxy mode: a fault changes what the agent's own calls get back, and only proxy mode sits between the agent and Slack. Proxy mode doesn't read the app's calls back live yet (#24), so for now the call is refused with action_requires and the test is skipped.
Types#
Plain values the handles return and take.
SlackTeam#
| Field | Type |
|---|---|
id | string |
name | string |
SlackApps#
type SlackApps = SlackApp[];
SlackMessageInput#
| Field | Type |
|---|---|
text | string | undefined |
blocks | unknown[] | undefined |
metadata | SlackMessageMetadata | undefined |
SlackMessageMetadata#
| Field | Type |
|---|---|
event_type | string |
event_payload | Record<string, unknown> |
SlackUsers#
type SlackUsers = SlackUser[];
SlackConversations#
type SlackConversations = SlackConversation[];
SlackButtonRef#
| Field | Python / Rust | Type |
|---|---|---|
label | label | string | undefined |
actionId | action_id | string | undefined |
value | value | string | undefined |
SlackMenuRef#
| Field | Python / Rust | Type |
|---|---|---|
label | label | string | undefined |
actionId | action_id | string | undefined |
SlackSuggestedPrompts#
type SlackSuggestedPrompts = Array<{ title: string; message: string }>;
SlackModals#
type SlackModals = SlackModal[];
SlackModalValues#
type SlackModalValues = Record<string, string | string[] | undefined>;
SlackMessages#
type SlackMessages = SlackMessage[];
SlackMembers#
type SlackMembers = Array<SlackUser | SlackApp>;
SlackReplies#
type SlackReplies = SlackMessage[];
SlackReactions#
type SlackReactions = SlackReaction[];
SlackReaction#
| Field | Type |
|---|---|
emoji | string |
by | Array<SlackUser | SlackApp> |
SlackThreadStatus#
| Field | Python / Rust | Type |
|---|---|---|
state | state | "working" | "streaming" | "stopped" | "idle" |
text | text | string | undefined |
sessionStatus | session_status | "active" | "processing" | "suspended" | "closed" | undefined |
SlackTranscript#
| Field | Type |
|---|---|
entries | SlackTranscriptEntry[] |
text | string |
SlackTranscriptEntry#
| Field | Python / Rust | Type |
|---|---|---|
id | id | string |
author | author | SlackPrincipal |
at | at | string |
text | text | string |
controls | controls | string[] |
edited | edited | boolean |
depth | depth | number |
files | files | string[] |
alsoInChannel | also_in_channel | true | undefined |
streaming | streaming | "open" | "stopped" | "completed" | undefined |
visibleTo | visible_to | SlackPrincipal | undefined |
SlackPrincipal#
| Field | Type |
|---|---|
id | string |
name | string |
kind | "user" | "app" |
SlackEphemeralMessages#
type SlackEphemeralMessages = SlackMessage[];
SlackMessageDeliveries#
type SlackMessageDeliveries = SlackDelivery[];
SlackDeliveries#
type SlackDeliveries = SlackDelivery[];
SlackApiCalls#
type SlackApiCalls = SlackApiCall[];
SlackApiCall#
| Field | Python / Rust | Type |
|---|---|---|
id | id | string |
channel | channel | "slack" |
operation | operation | string |
method | method | string |
path | path | string |
at | at | string |
durationMs | duration_ms | number |
request | request | unknown | undefined |
responseStatus | response_status | number |
response | response | unknown | undefined |
error | error | string | undefined |
SlackUninstallDeliveries#
type SlackUninstallDeliveries = SlackDelivery[];