Slack Command and Module Reference

Applies to

Bridge by Smartsheet

Slash Commands

You can add slash commands to Slack teams from your app that invoke actions in Bridge by defining them with Bridge and creating a new slash command in your Slack app with the matching slash command string.

Default Slash Commands

The default commands will invoke functions within Bridge for the Slack integration.

For the default commands you specify the Slash Commands that will invoke the command in Slack as well as a simple response that will be sent as an ephemeral message to the user that invokes the command.

  • Start Bot: Will restart the bot automatic response for the invoking user if it has been stopped.
  • Stop Bot: Will stop the bot automatically responding to the invoking user.

Slack Default Commands

Using the Group Channel User option, these functions will be the whole channel as they are treated as an individual user.

Custom Commands

Custom commands are used to start a conversation with the invoking user. These conversations cannot be replied to by the user typing so it is important to design them so they do not need user interaction or you request the user interaction using the Slack attachment interactive buttons.

  • Command: The command used to invoke the function in the Slack app.
  • Template: The name of the conversation template that is to be invoked.
  • Response type: How the messages sent back to the user will be displayed, either in channel as a public message or as an ephemeral message that will only be visible to the invoking user.
  • State Values: A list of values for the conversation states that is to be invoked. This allows for some or all of the conversation states to be pre-populated to advance the conversation and avoid the need for some of the user input.

Slack Custom Commands

The end user can define state values when invoking the slash command by specifying simplified argument handle bars when defining the state values.

  • You can use the argument handlebar {,}, to take all of the slash command arguments, everything the user types after the command, and pass it as the state value.
  • Alternatively you can treat the slash command arguments as individual words, so {.} would get the first word {,} would get the second word and so on, treating a space as the separator between the words.
  • The command /ditto repeat this back to me would have {,} getting repeat this back to me, {.} would be repeat, {,} would be this and so on.

Create Attachment module

Create an attachment that will be displayed during the Slack conversation either as a question, comment, or an answer instead of the state's default value.

Create Attachment initial fields

  • Return Media As: Determine how the attachment will be displayed in regards to the conversation for conversations using Slack. Any conversations not using slack will not invoke this module.
    • Next Question: This will replace the question for the next state with the Slack attachment.
    • New Comment: This will add a new comment without affecting any of the other conversation states.
    • Current Answer: This will replace the current states answer with the Slack attachment.
  • Fallback: Required plain-text description of the attachment. Used by Slack if they are unable to display the attachment
  • Attachment Pretext: Optional text that appears before the attachment block.

Slack Create Attachment fields

Create Attachment Author and Title fields

  • Author: An object that defines the author of the attachment.
    • Name: The name of the author.
    • Link: Adds a link to the author name to allow the user to get more information. The link must be a proper URL, including http or https.
    • Icon: A URL to an icon to displayed alongside the author name.

Slack Author

  • Title: An object that defines a title for the attachment.
    • Text: The title text to be displayed.
    • Link: Adds a link to the title text to allow the user to get more information. The link must be a proper URL, including http or https.

Slack create attachment title

Create Attachment Footer fields

  • Footer: An object that defines the footer for the attachment.
    • Text: The footer text to be displayed.
    • Icon: A URL to an icon to displayed alongside the footer text.
  • Text: Optional text that appears within the attachment, between the title and footer.
  • Image URL: A URL for an image to be displayed within the attachment.
  • Thumbnail URL: A URL for a thumbnail image to be displayed within the attachment.
  • Color: The color to be used for the sidebar.
    • Good: Displays with a green sidebar.
    • Warning: Displays with an amber sidebar.
    • Danger: Displays with a red sidebar.
  • Hex Color: A hex color value e.g. #439FE0, this will override the value set by color.

Slack create attachment footer

Create Attachment Actions field

  • Actions: An array of objects that define actions, or buttons, that are included with the attachment that allow for guided user input.
    • Name: The name of the action. This needs to be a unique value among these actions in order to invoke the correct response.
    • Display Text: The text that will be displayed for the action.
    • Style: The type of the action input.
      • Default: Will display the button in the default black color.
      • Primary: Will display the button in the primary green color.
      • Danger: Will display the button in the danger red color.
    • Type: Define the type of action to be displayed. Currently the only value supported by Slack is Button.
    • Value: The value of the slack action. This will be treated as a new user comment when the action is invoked. If the conversation is just for a single user then this could continue the current conversation or could be used to start a new conversation for multiple users.

Slack create attachment actions fields

Create Attachment Confirmation fields

  • Confirmation: An object to define a confirmation box that will appear when the action is invoked to reconfirm if a destructive action should be invoked.
    • Title: The title for the confirmation message box.
    • Message: The text for the confirmation message box.
    • OK Text: The text for the confirm action button. Defaults to Okay.
    • Dismiss Text: The text for the reject action button. Defaults to Cancel.

Slack create attachment confirmation

When invoking the action with a confirmation message, the message will pop-up and ask to confirm if the action will be invoked by selecting the confirm action. The color of the confirm button will match the color of the button that caused it to be displayed.

Slack confirm title

Create Attachment Response fields

  • Response: An object to define how slack should behave when the action is invoked.
    • Response Type: Define how the response to the action should be displayed.
      • In Channel: A public message that can be seen by all users in the channel.
      • Ephemeral: A hidden message that can only be seen by the invoking user.
      • Message: The response message.
      • Response Action: Define how the attachment will change when the action is invoked.
        • Replace: The buttons will be removed and the response message will be appended to the attachment text as a new line. The rest of the attachment will not be altered. This action type cannot be an ephemeral message and will remain in channel like the original message.
      • Delete: The attachment will be deleted and a new comment with the response message will be displayed.
      • New Comment: The attachment will not be modified and a new comment with the response message will be displayed.
    • Slack create attachment response