As with any application, Slack has its own series of commands that tell the application what to do when certain syntax is used. To tell Slack that the input in the message text box is a command, you begin the statement with a forward slash ( '/' ). Because of the slash at the beginning of a statement, these commands are called "slash commands." When you install a new app onto your server, the app description will have a slash command list to configure and control the new app. You use these slash commands to control apps, but Slack comes with its own native slash commands that can perform certain actions.
Built-In Slash Commands
Slack has several slash commands premade and ready to use. The slash commands available depend on the user's permissions on the server. For instance, any slash commands available to administrators would not be available to standard users. Users who install apps on their own user account will have slash commands that are not available to other users.
To get a brief overview of available commands, go to the Slackbot direct message section. If you're practicing commands, using them in the Slackbot section will avoid sending a command in a channel that you don't want others to see. Also, if you need to practice commands within a channel, you should create a private channel where only you have access and practice commands before you unleash them on your entire Slack server.
To get an overview and list of slash commands, type the "/" character into any channel or direct message. Immediately after the slash is typed into Slack, a window opens where you can see all slash commands available to your Slack instance. Notice that the ones you've used the most recently are shown at the top.
In this example, the most recently used slash command was the "gcal" command, which is the slash command that views and updates settings in the Google Calendar app. Only one slash command has been used recently on this account, so only one is listed.
After the "Last Used" section, the entire list of slash commands is displayed in the "Slack" section of the window. All native slash commands in this section are included with your Slack installation. As you add apps to your Slack server, new sections display in this window. For each new app installed on the server, a new section is added after the native slack slash command section. Scroll to the bottom of the window, and you'll find sections for your apps with a list of commands associated with the app. In this example, Google Calendar is installed so at the bottom of the window, a list of Google Calendar slash commands is displayed.
One reason you should type your command into Slackbot is because it can help you determine the right syntax when you don't know how to use a specific slash command. Take the "/dnd" command as an example. The "/dnd" command sets your status to "do not disturb." You must add a time frame to let Slack know when the do not disturb message to take effect and when it should end. When you don't know exactly how to use a Slack command, typing it into the message text box with no parameters will display help from Slackbot.
To get help from Slackbot, type "/dnd" into the direct message text box. This command is not the correct syntax, and Slackbot detects that you might need help. You see a message from Slackbot that shows you the right way to use the command.
Notice that the message is labeled with "Only visible to you" so that you know only you can see the message and no one else. If this was typed into a Slack channel, users would not see this message. Only you can see the help message returned by Slackbot.
The red text is the list of commands and the right syntax used for the /dnd command. With this information, you can now properly input a "do not disturb" message into Slack. For instance, type "/dnd for 15 minutes." A message returns from Slackbot letting you know that now your status has been updated to "do not disturb," but it will only take effect for 15 minutes.
You can set your status to "do not disturb" with several other options. You can set it to "do not disturb" for the rest of the day or until you come back to work in the morning. Whatever option you choose, Slackbot returns your status to inform you that your status has changed. You can confirm the status change by looking at your own profile icon in the left Slack panel.
The icon to the left of your profile name will still show the right color if you're online or idol, but the icon changes when you have your status set to "do not disturb." You can see this icon next to your profile name, and this is the same icon that other Slack users see when they view users available on the server. If another user has previously direct messaged you, your name will display in the "Direct Messages" panel where they would be able to identify if you are available or your status is set to "do not disturb."
You won't use all commands frequently, but you have a few commands that will be frequently used so that you can quickly make changes to your profile, channels and overall server settings.
/active: When you set yourself as away or idle, it changes the color of the circle next to your name. Users see this circle color and assume that you are not available for discussions. After you come back from a meeting or lunch, for example, you can use this command to set yourself back to active. The circle will display as green to other users indicating that you are available for chatting.
/away: When you walk away, instead of using the mouse to click your profile and set your status as "away," you can use this slash command. This slash command will display an orange circle next to your profile so that users know that you cannot answer them right away.
/invite @user channel: Any user registered on your Slack channel can be invited to any channel where you are an administrator. The "/invite" command lets you add a user to a named channel. This command is different than the command to invite users to your server.
/invite_people email@example.com: This slash command invites the user with the email address "firstname.lastname@example.org" to your server. Replace the email address with the user's email address to send an invite. This user will show up temporarily in the "Direct Messages" panel to indicate that they have an account once they accept the invitation.
/search (or /s) [search text]: Slack servers can store thousands of messages. With the "/search" slash command, you can find a message using a specific phrase. Remember that you can only search a specific number of messages based on the subscription that you have with Slack. You must upgrade to a paid plan to be able to search more messages. Search functionality is also based on dates, so you cannot search older messages with a paid plan.
/leave [channel]: The "/leave" slash command will remove you from the specified channel. If you choose to return to a channel, an administrator must re-invite you.
/remove or /kick @user: The "/kick" feature is an administrator slash command. Only users who have administrator permissions in a channel can add or remove people from channels. Non-administrative users cannot kick or add users. With this command, you must be in the right channel. When you use this command with a user account name, the user will be removed from the current channel that you are in.
/status clear: If you have any status changes to your account, you can clear them using the "/status clear" slash command. You can also change your status using the mouse and clicking your account in the top-left panel under the Slack server name. Using this slash command is a shortcut to using the mouse to change your status updates and clearing them.
/who: As an administrator, you might need to know who is in a specific channel. The "/who" command will list every user in the channel. From there, you can add more users to the channel or remove users who should no longer have access.
There are several other commands in the list, but the above ones will be used most frequently as you work with Slack. Should you ever forget a command's syntax, remember that you can type the slash ( "/" ) character into the window to see a list of available options and syntax for Slack.
Using the @ Command to Send Messages
Just like the slash command, the at command ( "@") will trigger Slack to send a message to a specified user. When you type the @ character into Slack messages, a window opens with a list of users available in the server. You can message any one of these users, but there are a few accounts that display in the list of options that are specific to Slack and will send messages to multiple people.
Type the @ character in your Slack messages either in a direct message window or in an open channel. Just like the slash command, a list of options displays in a popup window. The options are users available on the Slack server. Users invited to the server are also included, but any messages will not be sent to the user if they have not accepted the invitation to the Slack server.
To the right of each user account in the popup window is the same circle shown in the "Direct Messages" panel. If the circle next to the user account is green, then you know that the user is online and available for messages. Any status updates that change the account status icon will be shown in the popup window.
All apps are identified with the "APP" label. Notice that the Google Calendar bot is labeled as an app. Users who are not invited to the channel and not present in the same room will have the message "Not in channel" next to the account name. If you send a message to a user in a channel where they are not invited, the user will not be able to see the message and no notification will be sent to the user's account.
To send a notification to a user in a channel, use the following syntax:
Replace the "user" text with the name of the user that you want to message. Replace "<message>" with the text that you want to send. If you use direct messages, only the user can see your message. If you type the message in a channel, then all users can see the message but the one used in the at command will be notified that they have a message. Users get notification in email as well as in Slack when they have it open in a browser or on a mobile device.
You'll notice that there are other users listed that are not accounts added to the server. These accounts have a different avatar and additional information about what happens when you send a message to this account. The following two accounts are related to channel users:
@channel: Sending a message to this account will notify all users in the channel regardless of their account status settings.
@here: Sending a message to this account will only notify users who are currently active in the channel.
You have one more account named "@everyone" that will ping all users in the entire Slack server regardless of their account status. Use this account only with important messages that every user must read, because you could potentially notify thousands of users with this account.