Skip to content

Triggers

Pumble apps can subscribe to two types of triggers:

  1. App specific triggers (Slash Commands, Global Shortcuts, Message Shortcuts, Block Interactions, View Action)
  2. Pumble Events

The payloads for each specific trigger exist on every event handler context:

typescript
slashCommands: [
    {
        command: '/my_slash_command',
        handler: async (ctx) => {
            await ctx.ack();
            const payload = ctx.payload;
        },
    },
]

Slash Commands

To create slash commands, in your main.ts App object insert the property slashCommands.

typescript
const app: App = {
    slashCommands: [
        {
            command: '/my_slash_command',
            description: 'My slash command description',
            usageHint: '[usage hint]',
            handler: async (ctx) => {
                console.log('Received slash command');
            }
        },
    ]
}

NOTE

If you created an App object using setup function, insert the slashCommands property within the AddonManifest object, and make sure to specify the full url for each slash command.

WARNING

You cannot have two slash commands with the same command

Slash Command context

nametypedescription
payloadSlashCommandPayloadThe payload for the slash command
saySayFunctionQuickly reply to the trigger using the bot. See SayFunction
ack() => Promise<void>Callback to acknowledge the trigger. This should be invoked within 3 seconds upon receiving the request. It's recommended for this to be the first call in the trigger handler.
nack(message?: String) => Promise<void>Callback to reject the trigger. If provided with an argument the message will be sent to the user as an ephemeral message.
getBotClient() => Promise<ApiClient | undefined>Get the bot ApiClient for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest this will return undefined
getUserClient(userId?: String) => Promise<ApiClient | undefined>Return the user client given a user ID. If userId is not fed in this method it will try to find a the ApiClient of the triggering user. If the user has not authorized your app this will return undefined
getManifest() => ManifestReturn the manifest of your app. This can be used if you need to access some manifest configuration or secret
getBotUserId() => Promise<String | undefined>Get the bot user ID for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest this will return undefined
getAuthUrl() => StringGenerate an auth URL that when opened it will show the Pumble Consent screen to authorize your app
getChannelDetails() => Promise<ChannelInfo>Get channel information for the channel where the command was invoked, given the channels:read scope is granted for the user or bot
spawnModalView(View<"MODAL"> | StorageIntegrationModalCredentials) => Promise<void>Get channel information for the channel where the command was invoked, given the channels:read scope is granted for the user or bot

The slash command payload will contain all the relevant information for the trigger event.

Slash Command payload

nametypeoptionaldescription
slashCommandStringfalseThe slash command that was invoked
textStringfalseThe text that user typed after the slash command
userIdStringfalseThe user who invoked the slash command
channelIdStringfalseThe channel where the slash command was invoked
workspaceIdStringfalseThe workspace where the slash command was invoked
threadRootIdStringtrueThe thread ID if the slash command is invoked in a thread window
triggerIdStringfalseInternal identifier of the action.

Global Shortcuts

To create Global Shortcuts in your main.ts App object insert the property globalShortcuts:

typescript

// main.ts
const app: App = {
    globalShortcuts: [
        {
            name: 'Global Shortcut',
            description: 'Global shortcut description',
            handler: async (ctx) => {
                console.log('Received global shortcut');
            },
        },
    ]
}

NOTE

If you created an App object using setup function, insert the globalShortcuts property within the AddonManifest object, and make sure to specify the full url for each global shortcut.

WARNING

Your app cannot have two global shortcuts with the same name.

Global Shortcut context

nametypedescription
payloadGlobalShortcutPayloadThe payload for the global shortcut
saySayFunctionQuickly reply to the trigger using the bot. See SayFunction
ack() => Promise<void>Callback to acknowledge the trigger. This should be invoked within 3 seconds upon receiving the request. It's recommended for this to be the first call in the trigger handler.
nack(message?: String) => Promise<void>Callback to reject the trigger. If provided with an argument the message will be sent to the user as an ephemeral message.
getBotClient() => Promise<ApiClient | undefined>Get the bot ApiClient for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest this will return undefined
getUserClient(userId?: String) => Promise<ApiClient | undefined>Return the user client given a user ID. If userId is not fed in this method it will try to find a the ApiClient of the triggering user. If the user has not authorized your app this will return undefined
getManifest() => ManifestReturn the manifest of your app. This can be used if you need to access some manifest configuration or secret
getBotUserId() => Promise<String | undefined>Get the bot user ID for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest this will return undefined
getAuthUrl()=> StringGenerate an auth URL that when opened it will show the Pumble Consent screen to authorize your app
spawnModalView(View<"MODAL"> | StorageIntegrationModalCredentials) => Promise<void>Create a modal

The global shortcut payload will contain all the relevant information for the trigger event

Global Shortcut payload

nametypeoptionaldescription
shortcutStringfalseThe shortcut name that was invoked
userIdStringfalseThe user who invoked the shortcut
channelIdStringfalseThe channel where the shortcut was invoked
workspaceIdStringfalseThe workspace where the shortcut was invoked
triggerIdStringfalseInternal identifier of the action.

Message Shortcuts

To create Message Shortcuts in your main.ts App object, insert the property messageShortcuts:

typescript

// main.ts
const app: App = {
    messageShortcuts: [
        {
            name: 'Message Shortcut',
            description: 'Message shortcut description',
            handler: async (ctx) => {
                console.log('Received message shortcut');
            }
        },
    ]
}

NOTE

If you created an App object using setup function, insert the messageShortcuts property within the AddonManifest object, and make sure to specify the full url for each message shortcut.

WARNING

Your app cannot have two message shortcuts with the same name.

Message Shortcut context

nametypedescription
payloadMessageShortcutPayloadThe payload for the global shortcut
sayReplyFunctionQuickly reply to the trigger using the bot. See ReplyFunction
ack() => Promise<void>Callback to acknowledge the trigger. This should be invoked within 3 seconds upon receiving the request. It's recommended for this to be the first call in the trigger handler.
nack(message?: String) => Promise<void>Callback to reject the trigger. If provided with an argument the message will be sent to the user as an ephemeral message.
getBotClient() => Promise<ApiClient | undefined>Get the bot ApiClient for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest, this will return undefined.
getUserClient(userId?: String) => Promise<ApiClient | undefined>Return the user client given a user ID. If userId is not fed in this method it will try to find a the ApiClient of the triggering user. If the user has not authorized your app, this will return undefined.
getManifest() => ManifestReturn the manifest of your app. This can be used if you need to access some manifest configuration or secret
getBotUserId() => Promise<String | undefined>Get the bot user ID for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest, this will return undefined.
getAuthUrl()=> StringGenerate an auth URL that when opened it will show the Pumble Consent screen to authorize your app
fetchMessage()=> Promise<Message | undefined>Fetch the message on which the shortcut was invoked. It will first try to fetch the message using the ApiClient of the user that invoked the trigger. If the user has not authorized, it will try to fetch with the bot ApiClient. If none of these succeed, it will return undefined.
spawnModalView(View<"MODAL"> | StorageIntegrationModalCredentials) => Promise<void>Create a modal

The message shortcut payload will contain all the relevant information for the trigger event.

Message Shortcut payload

nametypeoptionaldescription
shortcutStringfalseThe shortcut name that was invoked
userIdStringfalseThe user who invoked the shortcut
channelIdStringfalseThe channel where the shortcut was invoked
workspaceIdStringfalseThe workspace where the shortcut was invoked
messageIdStringfalseThe message ID on which the shortcut was invoked
triggerIdStringfalseInternal identifier of the action.

Block Interactions

To create block interaction handlers in your main.ts App object, insert the property blockInteraction:

typescript

// main.ts
const app: App = {
    blockInteraction: {
        interactions: [
            {
                sourceType: "MESSAGE",
                handlers: {
                    bttn_1_action: async (ctx) => {
                        await ctx.ack();
                        await ctx.say("Button 1 pressed", "ephemeral");
                    },
                    bttn_2_action: async (ctx) => {
                        await ctx.ack();
                        await ctx.say("Button 2 pressed", "ephemeral");
                    }
                }
            },
            {
                sourceType: "VIEW",
                handlers: {
                    checkboxes_action: async (ctx) => {
                        await ctx.ack();
                        const checkboxesData = JSON.parse(ctx.payload.payload);
                        console.log(`Selected: ${checkboxesData.values}`);
                    }
                }
            },
            {
                sourceType: "EPHEMERAL_MESSAGE",
                handlers: {
                    select_menu_action: async (ctx) => {
                        await ctx.ack();
                        console.log("Item selected!");
                    }
                }
            }
        ]
    }
}

NOTE

If you created an App object using setup function, insert the blockInteraction property within the AddonManifest object, with handlerMesssage, handlerEphemeralMessage and handlerView interaction handlers, and make sure to specify the full url for block interactions.

Block interaction context depends on the source type of the interaction (whether it is a message, an ephemeral message, or a view). Therefore, interaction handlers must be specified along with the appropriate block interaction source type.

Block interaction context (sourceType: MESSAGE)

nametypedescription
payloadBlockInteractionPayload<"MESSAGE">The payload for the global shortcut
sayReplyFunctionQuickly reply to the trigger using the bot. See ReplyFunction
ack() => Promise<void>Callback to acknowledge the trigger. This should be invoked within 3 seconds upon receiving the request. It's recommended for this to be the first call in the trigger handler.
nack(message?: String) => Promise<void>Callback to reject the trigger. If provided with an argument the message will be sent to the user as an ephemeral message.
getBotClient() => Promise<ApiClient | undefined>Get the bot ApiClient for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest, this will return undefined.
getUserClient(userId?: String) => Promise<ApiClient | undefined>Return the user client given a user ID. If userId is not fed in this method it will try to find a the ApiClient of the triggering user. If the user has not authorized your app, this will return undefined.
getManifest() => ManifestReturn the manifest of your app. This can be used if you need to access some manifest configuration or secret
getBotUserId() => Promise<String | undefined>Get the bot user ID for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest, this will return undefined.
getAuthUrl()=> StringGenerate an auth URL that when opened it will show the Pumble Consent screen to authorize your app
fetchMessage()=> Promise<Message | undefined>Fetch the message on which the interaction was triggered. It will first try to fetch the message using the ApiClient of the user that invoked the trigger. If the user has not authorized, it will try to fetch with the bot ApiClient. If none of these succeed, it will return undefined.
getChannelDetails() => Promise<ChannelInfo>Get channel information for the channel where the interaction was triggered, given the channels:read scope is granted for the user or bot.
spawnModalView(View<"MODAL"> | StorageIntegrationModalCredentials) => Promise<void>Triggers creation of a modal (regular modal or storage integration modal).

Block interaction context (sourceType: EPHEMERAL_MESSAGE)

nametypedescription
payloadBlockInteractionPayload <"EPHEMERAL_MESSAGE">The payload for the global shortcut
ack() => Promise<void>Callback to acknowledge the trigger. This should be invoked within 3 seconds upon receiving the request. It's recommended for this to be the first call in the trigger handler.
nack(message?: String) => Promise<void>Callback to reject the trigger. If provided with an argument the message will be sent to the user as an ephemeral message.
getBotClient() => Promise<ApiClient | undefined>Get the bot ApiClient for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest, this will return undefined.
getUserClient(userId?: String) => Promise<ApiClient | undefined>Return the user client given a user ID. If userId is not fed in this method it will try to find a the ApiClient of the triggering user. If the user has not authorized your app, this will return undefined.
getManifest() => ManifestReturn the manifest of your app. This can be used if you need to access some manifest configuration or secret
getBotUserId() => Promise<String | undefined>Get the bot user ID for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest, this will return undefined.
getAuthUrl()=> StringGenerate an auth URL that when opened it will show the Pumble Consent screen to authorize your app
getChannelDetails() => Promise<ChannelInfo>Get channel information for the channel where the interaction was triggered, given the channels:read scope is granted for the user or bot.
spawnModalView(View<"MODAL"> | StorageIntegrationModalCredentials) => Promise<void>Triggers creation of a modal (regular modal or storage integration modal).

Block interaction context (sourceType: VIEW)

nametypedescription
payloadBlockInteractionPayload<"VIEW">The payload for the block interacion.
ack() => Promise<void>Callback to acknowledge the trigger. This should be invoked within 3 seconds upon receiving the request. It's recommended for this to be the first call in the trigger handler.
nack(message?: String) => Promise<void>Callback to reject the trigger. If provided with an argument the message will be sent to the user as an ephemeral message.
getBotClient() => Promise<ApiClient | undefined>Returns the bot ApiClient for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest, this will return undefined.
getUserClient(userId?: String) => Promise<ApiClient | undefined>Returns the user client given a user ID. If userId is not fed in this method it will try to find a the ApiClient of the triggering user. If the user has not authorized your app, this will return undefined.
getManifest() => ManifestReturns the manifest of your app. This can be used if you need to access some manifest configuration or secret
getBotUserId() => Promise<String | undefined>Returns the bot user ID for the workspace where the trigger was invoked. If you set {bot: false} in the manifest, this will return undefined.
getAuthUrl()=> StringGenerate an auth URL that when opened it will show the Pumble Consent screen to authorize your app.
pushModalView(View<"MODAL">) => Promise<void>Triggers creation of a child modal, whose parent if the view from which the interaction was triggered.
updateView(View<"MODAL">) => Promise<void>Updated the view from which the interaction was triggered.
viewIdString | undefinedID of the view, from which the interaction was triggered.
viewTypeString | undefinedType of the view, from which the interaction was triggered. Possible values are MODAL and HOME.
viewTitleTextElement | undefinedTitle of the view, from which the interaction was triggered.
viewStateState | undefinedState object of the view, from which the interaction was triggered.
viewBlocksMain Block[] | undefinedDisplayed content of the view, from which the interaction was triggered.
viewSubmitText Block | undefinedContent of the submit button of the modal, from which the interaction was triggered.
viewCallbackIdString | undefinedCallback ID of the modal, from which the interaction was triggered.
viewCloseText Block | undefinedContent of the close button of the modal, from which the interaction was triggered.
viewNotifyOnCloseBoolean | undefinedSpecifies if the onClose handler should be triggered, when the modal from which the interaction was triggered is dismissed without submission.
parentViewIdString | undefinedIn case the modal from which the interaction was triggered was spawned as a child of another modal, this field specifies the ID of the parent modal.
viewBuilder(view: View<"MODAL" | "HOME_VIEW">) => ViewBuilder<"MODAL" | "HOME_VIEW">Returns a function that takes a view object as an argument, and returns a builder object with helper methods for easier manipulaton of the view object content (append blocks, update state, update title...)

Block Interaction payload

nametypeoptionaldescription
workspaceIsStringfalseID of the workspace, where the interaction was triggered.
userIdStringfalseID of the user who triggered the interaction.
channelIdStringtrueID of the channel, where the interaction was triggered.
sourceTypeStringfalseType of the source of the interaction. Possible values are MESSAGE, EPHEMERAL_MESSAGE, VIEW.
sourceIdStringfalseID of the source of the interaction (message ID, ephemeral message ID, or view ID).
actionTypeStringfalseType of the interactive element, from which the interaction was triggered. Possible values are BUTTON, STATIC_SELECT_MENU, DYNAMIC_SELECT_MENU, CHECKBOXES, DATE_PICKER, DATE_RANGE_PICKER.
onActionStringfalseAction identifier the interactive element, from which the interaction was triggered.
payloadStringfalseJSON string containing value(s) entered or selected by the interaction.
viewViewtrueView object, representing the view from which the interaction was triggered. Applicable only when sourceType is VIEW.
loadingTimeoutIntegerfalseDuration of interactive element's loading state, which is entered after the interaction is triggered. Will be 0 if interactive element does not enter loading state upon interaction.
triggerIdStringfalseInternal identifier of the interaction.

View Action

To create view action handlers in your main.ts App object, insert the property viewAction, with onSubmit and onClose handlers:

typescript

// main.ts
const app: App = {
    viewAction: {
        onSubmit: {
            modal_callback_id: async (ctx) => {
                await ctx.ack();
                console.log(`Modal submitted with state ${JSON.stringify(ctx.payload.view.state)}.`);
            }
        },
        onClose: {
            modal_callback_id: async (ctx) => {
                await cts.ack();
                console.log('Modal closed.');
            }
        }
    }
}

NOTE

If you created an App object using setup function, insert the viewAction property within the AddonManifest object, with the view action handler, and make sure to specify the full url for block interactions.

View Action context

nametypedescription
payloadViewActionPayloadThe payload for the block interacion.
ack() => Promise<Void>Callback to acknowledge the trigger. This should be invoked within 3 seconds upon receiving the request. It's recommended for this to be the first call in the trigger handler.
nack(message?: String) => Promise<Void>Callback to reject the trigger. If provided with an argument the message will be sent to the user as an ephemeral message.
getBotClient() => Promise<ApiClient | undefined>Returns the bot ApiClient for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest, this will return undefined.
getUserClient(userId?: String) => Promise<ApiClient | undefined>Returns the user client given a user ID. If userId is not fed in this method it will try to find a the ApiClient of the triggering user. If the user has not authorized your app, this will return undefined.
getManifest() => ManifestReturns the manifest of your app. This can be used if you need to access some manifest configuration or secret
getBotUserId() => Promise<String | undefined>Returns the bot user ID for the workspace where the trigger was invoked. If you set {bot: false} in the manifest, this will return undefined.
getAuthUrl()=> StringGenerate an auth URL that when opened it will show the Pumble Consent screen to authorize your app.
spawnModalView(View<"MODAL"> | StorageIntegrationModalCredentials) => Promise<void>Triggers creation of a modal (regular modal or storage integration modal).
viewIdString | undefinedID of the view, from which the interaction was triggered.
viewTypeString | undefinedType of the view, from which the interaction was triggered. Possible values are MODAL and HOME.
viewTitleTextElement | undefinedTitle of the view, from which the interaction was triggered.
viewStateState | undefinedState object of the view, from which the interaction was triggered.
viewBlocksMain Block[] | undefinedDisplayed content of the view, from which the interaction was triggered.
viewSubmitText Block | undefinedContent of the submit button of the modal, from which the interaction was triggered.
viewCallbackIdString | undefinedCallback ID of the modal, from which the interaction was triggered.
viewCloseText Block | undefinedContent of the close button of the modal, from which the interaction was triggered.
viewNotifyOnCloseBoolean | undefinedSpecifies if the onClose handler should be triggered, when the modal from which the interaction was triggered is dismissed without submission.
parentViewIdString | undefinedIn case the modal from which the interaction was triggered was spawned as a child of another modal, this field specifies the ID of the parent modal.
viewBuilder(view: View<"MODAL" | "HOME_VIEW">) => ViewBuilder<"MODAL" | "HOME_VIEW">Returns a function that takes a view object as an argument, and returns a builder object with helper methods for easier manipulaton of the view object content (append blocks, update state, update title...)

View Action payload

nametypeoptionaldescription
workspaceIsStringfalseID of the workspace, where the view action was triggered.
userIdStringfalseID of the user who triggered the view action.
channelIdStringtrueID of the channel, where the view action was triggered.
viewActionTypeStringfalseType of the source of the view action. Possible values are SUBMIT, CLOSE.
viewView<"MODAL">falseView object, whose submit or close action was triggered.
triggerIdStringfalseInternal identifier of the action.

Events

To subscribe to events, you have to add the event listeners in the main App. Events do not need to be acknowledged.

typescript
const app: App = {
	events: [
		{
			name: "NEW_MESSAGE",
			handler: async (ctx) => {
                console.log("New message arrived!");
			}
		}
	]
}

NOTE

If you created an App object using setup function, insert the eventSubscriptions property within the AddonManifest object, and make sure to specify the full url for it.

There are two types of events:

  1. App specific events ( APP_UNAUTHORIZED and APP_UNINSTALLED )
  2. Pumble Events

While App specific events do not require any special scope to be able to receive them, Pumble Events usually requires the users or bots to have authorized your app with certain scopes to receive them. So, for example, if you have messages:read scope for the bot but not for users, you will receive only NEW_MESSAGE events that the bot can read.

The list of Pumble Events and their scopes:

eventscopes
NEW_MESSAGEmessages:read
UPDATED_MESSAGEmessages:read
REACTION_ADDEDreaction:read
CHANNEL_CREATEDchannels:read
WORKSPACE_USER_JOINEDuser:read

Unauthorize and Uninstall events

These events will be useful to clean up the tokens in the token store, and do any other cleanup after user un-authorizes.

typescript
const app: App = {
	events: [
		{
			name: "APP_UNAUTHORIZED",
			handler: async (ctx) => {
				console.log("UNAUTHORIZED USER", ctx.payload.body.workspaceUser)
			}
		}
	]
}

Pumble Events

Pumble Events Context

nametypedescription
payloadEventPayloadThe payload for the global shortcut
getBotClient() => Promise<ApiClient | undefined>Get the bot ApiClient for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest this will return undefined
getUserClient(userId: String) => Promise<ApiClient | undefined>An event that arrives in your app can apply to more than one user. Therefore getUserClient the event is not user specific so userId must be provided. An exception for this rule applies to NEW_MESSAGE, UPDATED_MESSAGE and REACTION_ADDED event. The default user ID in getUserClient for these events is the message/reaction author
getManifest() => ManifestReturn the manifest of your app. This can be used if you need to access some manifest configuration or secret
getBotUserId() => Promise<String | undefined>Get the bot user ID for the workspace where the trigger was invoked. If you have set {bot: false} in the manifest this will return undefined
getAuthUrl()=> StringGenerate an auth URL that when opened it will show the Pumble Consent screen to authorize your app

NEW_MESSAGE Event Context

NEW_MESSAGE Event context in addition to the normal events context has the say function. See Reply Function

REACTION_ADDED Event Context

REACTION_ADDED Event context in addition to the normal events context has fetchMessage function. This function will first try to find the ApiClient of the reaction author. If that is not successful it will fall back the the bot ApiClient and will try to fetch the message where the reaction was added.

Event Payload

nametypedescription
bodyObjectEvent specific body
eventTypeStringType of the event
workspaceIdStringWorkspace ID where the event happened
workspaceUserIdsString[]The list of users that have authorized the app with the required event scopes, and they have access to the event (bot can be included in this list)
NEW_MESSAGE event body
nametypedescription
mIdStringMessage ID.
wIdStringWorkspace ID, where the message was sent.
cIdStringChannel ID, in which the message was sent.
trIdStringThread root message ID, in case the message is a reply.
stcBooleanIf message is a reply, specifies if it was also sent to channel.
trMtStringMessage text of the thread root message, in case the message is a reply.
aIdStringMessage author ID.
txStringMessage text.
blRecord<String, Object>[]Message blocks.
tyStringType of the event. In this case, it is always NEW_MESSAGE
tsStringTimestamp denoting when the message was sent.
tsmNumberTimestamp in milliseconds, denoting when the message was sent.
stStringMessage subtype. Applicable to system messages only.
ridStringIdentifier of a request, that triggered the message to be sent.
fObject[]Array of message files.
attRecord<String, Object>Message attachments.
mmObjectMessage metadata (can contains information about a call, or message translations).
mdString[]An array of IDs of users who were directly mentioned in the message.
mcString[]An array of IDs of users who were mentioned in the message through a channel mention.
muString[]An array of IDs of users who were mentioned in the message through a user group mention.
auObjectidk
eBooleanIndicates if the message was edited.
ephBooleanIndicates if the message is en ephemeral message.
UPDATED_MESSAGE event body
nametypedescription
mIdStringMessage ID.
wIdStringWorkspace ID, where the message was sent.
cIdStringChannel ID, in which the message was sent.
trIdStringThread root message ID, in case the message is a reply.
stcBooleanIf message is a reply, specifies if it was also sent to channel.
trMtStringMessage text of the thread root message, in case the message is a reply.
aIdStringMessage author ID.
txStringMessage text.
blRecord<String, Object>[]Message blocks.
tyStringType of the event. In this case, it is always UPDATED_MESSAGE.
tsStringTimestamp denoting when the message was sent.
tsmNumberTimestamp in milliseconds, denoting when the message was sent.
stStringMessage subtype. Applicable to system messages only.
ridStringIdentifier of a request, that triggered the message to be sent.
fObject[]Array of message files.
attRecord<String, Object>Message attachments.
mmObjectMessage metadata (can contains information about a call, or message translations).
mdString[]An array of IDs of users who were directly mentioned in the message.
mcString[]An array of IDs of users who were mentioned in the message through a channel mention.
muString[]An array of IDs of users who were mentioned in the message through a user group mention.
auObject[]An array of objects representing info about which users were affected by an action. Present for certain system messages (e.g. joined_channel, invitation_accepted).
eBooleanIndicates if the message was edited.
ephBooleanIndicates if the message is en ephemeral message.
REACTION_ADDED event body
nametypedescription
wIdStringWorkspace ID, where the reaction was added.
cIdStringChannel ID, in which the reaction was added.
mIdStringMessage ID, to which the reaction was added.
matStringID of the author of the message, to which the reaction was added.
uIdStringID of the user who added the reaction.
rcStringReaction emoji code.
tyStringType of the event. In this case, it is always REACTION_ADDED.
ridStringIdentifier of the request that triggered adding reaction.
CHANNEL_CREATED event body
nametypedescription
wIdStringWorkspace ID, where the channel was created.
cIdStringID of the created channel.
cNStringChannel name.
cUString[]Array of IDs of channel's members.
cTStringChannel type. Can be one of the following: PUBLIC, PRIVATE, DIRECT, SELF.
tyStringType of the event. In this case, it is always CHANNEL_CREATED.
ridStringIdentifier of the request that triggered channel creation.
WORKSPACE_USER_JOINED event body
nametypedescription
uNStringWorkspace user's name.
uEStringWorkspace user's email.
uIdStringWorkspace user's ID.
afpStringFull path of the workspace user's avatar.
aspStringScaled path of the workspace user's avatar.
wIdStringID of the workspace to which the user belongs.
tyStringType of the event. In this case, it is always WORKSPACE_USER_JOINED.
tzStringWorkspace user's time zone identifier.
stsStringTimestamp denoting the time when workspace user's notifications will be resumed, after they manually paused them.
ptStringWorkspace user's profile title.
ppStringWorkspace user's profile phone number.
csObjectWorkspace user's custom status.
ridStringIdentifier of the request that triggered workspace user joining.
stStringWorkspace user's status. In this case, it will always be ACTIVATED
roStringWorkspace user's role. Possible values are: ADMINISTRATOR, USER, GUEST_MULTI_CHANNEL, GUEST_SINGLE_CHANNEL.
auStringTimestamp denoting until when the workspace user stays active. Applicable to guest users only.
ibStringID of the workspace user's inviter.
APP_UNAUTHORIZED event body
nametypedescription
idStringApp authorization ID.
appStringApp ID.
appInstallationStringApp installation ID, to which the authorization belongs.
workspaceStringWorkspace ID, from which the authorization is removed.
workspaceUserStringID of the workspace user who is removing app authorization.
grantedScopesString[]An array of scopes that were granted by the authorization.
accessGrantedBooleanIndicates if the authorization was fully completed.
APP_UNINSTALLED event body
nametypedescription
idStringApp installation ID.
appStringApp ID.
workspaceStringWorkspace ID, from which the authorization is removed.
installedByStringID of the workspace user who installed the app.
botUserStringID of the bot user corresponding to the app installation.
uninstalledAtDateTimestamp denoting when the app was uninstalled.

Say function

Say function will use your app's bot to respond to a trigger. By default, it will send an ephemeral message to the triggering user.

typescript
async say(message: string | {text: string, blocks?: Block[], attachments?: Attachment[]}, type: "in_channel" | "ephemeral" = "ephemeral"){...}

Reply function

Reply function is similar to Say Function, but it has one more extra parameter reply. This function applies only to contexts where a message or message ID is present.

typescript
await say("Message", "in_channel", true);

If it's set to true, the response will be posted as a reply to the original message. If the original message is in a thread, the response will be posted in the same thread.