Slash Commands in Slack are used to trigger an action or interaction directly from the message box. These commands act like shortcuts for specific actions. Leveraging on channel specific features, Luma supports Slash commands to trigger skills through Slack.

In order to use Slash command, one should have Slack Channel Configured for your Tenant.

Once Slack channel is configured, follow the below steps to Create and Configure a Slash Commands:

Add User Phrases in Luma Skills

Slash Commands are linked to Luma skills through special utterances or user phrases. These additional user phrases are used by Slash Commands to identify the skill.

For more info on skill creation, refer article Create a Skill .

Follow the below steps to add the utterance to your skill .

<Skill identifier>{<Attribute Identifier 1>:@<Attribute Identifier 1>} {<Attribute Identifier 2> :@<Attribute Identifier 2>} {<Attribute Identifier 3> :@<Attribute Identifier 3>}

For Example, ‘Create_Ticket_Slash_Command’ to create a ticket. The skill requires three attributes: Username, Comments and Language. Below utterance should be added as user phrase:

Create_Ticket_Slash_Command {username:@username} {comment:@comment} {language:@language}

Points to remember:

  • Attributes should be added in right sequence. This means that the attribute sequence in the utterance should be same as the sequence in the Skill builder-->Conversation Parameter

  • No rules should be added to the attributes in the skill.

  • File type attributes(data type) are not supported.

Add the utterance in Phrases and click on Add (+) button or hit Enter. The new utterance will start appearing in the list of Phrases. Click Save.

This phrase should be added to Usage hint on ‘Create New Command’ screen in slack as described in next section.

Create a Slash Command

Copy Slash Command Request URL and paste the same in Request URL box in Slack API-Create New Command screen.

Application

Location

Text

Luma

User Phrase/Utterance

Create_Ticket_Slash_Command {username:@username} {comment:@comment} {language:@language}

Slack

Usage Hint for Slack API-->New Command

Create_Ticket_Slash_Command [username:username] [comment:comment] [language:language]

Database Update

Once a Slash Command is successfully created in Slack, Luma database should be updated with the skill and the slash command utterance. Contact Serviceaide support team with below details to add the slash command into the database:

Executing a Slash Command

For example: To execute Slash Command 'LumaCommand', type the command with attribute values in below format and hit enter:

/LumaCommand Create_Ticket_Slash_Command [username: John] [comment: TestComments] [language:English]

Luma skill will be executed and the response will be displayed on the message box.

Attribute Validation

While executing a skill through Slash commands, attributes are validated by Slack. Below validations are performed before the skill is executed: