Skip to main content

Slack types

Slack types are used across the Slack platform to define the parameters of custom functions and workflows. For the full reference of each type, its properties, and examples, refer to Slack types.

In an app built using the Deno Slack SDK, declaring a non-primitive type requires a reference to the Schema.slack package. All manifests can also be written in JSON, where types are defined directly.

All Deno types can be found in the Deno Slack SDK repo on GitHub.

Slack types for datastores

When defining a datastore, you can use certain Slack types for its attributes. Attributes accept only a single type property in the definition, instead of all the common properties listed in the Slack types reference. The following is a list of the Slack types supported for use with datastores:

Here's a sample datastore definition using Slack types for attributes:

import { DefineDatastore, Schema } from "deno-slack-sdk/mod.ts";

export const MyDatastore = DefineDatastore({
name: "my_datastore",
primary_key: "id",
attributes: {
id: { type: Schema.types.string },
channel: { type: Schema.slack.types.channel_id },
message: { type: Schema.types.string },
author: { type: Schema.slack.types.user_id },
isMember: { type: Schema.types.boolean },
},
});