boolean type
This reference documents the Slack types at the platform level. Their availability and structure may differ in each SDK
Type: boolean
| Property | Type | Description |
|---|---|---|
default | The type that is being described. For a boolean it would be true or false. | An optional parameter default value. |
description | string | An optional parameter description. |
examples | An array of the type being described. | An optional list of examples. |
hint | string | An optional parameter hint. |
title | string | An optional parameter title. |
type | string | String that defines the parameter type. |
Declare a boolean type:
- JSON manifest
- Deno Slack SDK
// ...
"isMember": {
"type": "boolean"
}
// ...
// ...
isMember: {
type: Schema.types.boolean,
}
// ...
Boolean example
In this example datastore definition, we use a boolean type to capture whether the message author holds membership in our club.
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 },
},
});