slack-edge
Version:
Slack app development framework for edge functions with streamlined TypeScript support
25 lines • 2.28 kB
JavaScript
;
// ------------------------------------------
// The Slash command payload
// ------------------------------------------
//
// Slash commands allow users to invoke your app by typing a string into the message composer box. By enabling slash commands, your app can be summoned by users from any conversation in Slack. Slash commands created by developers cannot, however, be invoked in message threads.
// A submitted slash command will cause a payload of data to be sent from Slack to the associated app. The app can then respond in whatever way it wants using the context provided by that payload.
// When part of an app, they can be installed for your workspace as a single workspace app or distributed to other workspaces via the Slack Marketplace.
//
// Built-in slash commands:
// There is a set of built-in slash commands. These include slash commands such as /topic and /remind.
// Built-in slash commands are unique commands with unique additional features - they, along with Giphy app slash commands, are the only slash commands that can be invoked in message threads.
//
// Understanding the structure of slash commands:
// Slash commands require a particular invocation structure that makes them less universally usable compared to other app entry points. Ensure you understand your app's audience before implementation.
// Let's look at an example slash command for an app that stores a list of to-do tasks:
// /todo ask @crushermd to bake a birthday cake for @worf in #d-social
// Here's the structure:
// - /todo - This is the command, the part that tells Slack to treat it as a slash command and where to route it. You'll define yours below.
// - ask @crushermd to bake a birthday cake for @worf in #d-social - This is the text portion, it includes everything after the first space following the command. It is treated as a single parameter that is passed to the app that owns the command (we'll discuss this more below).
// We want to make sure that birthday cake gets baked, so read on to find out how to set up commands for your apps as well as how to handle and respond to them.
//
// See: https://api.slack.com/interactivity/slash-commands
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=slash-command.js.map