You can use custom commands in MS Teams to return specific information from the MSPbots apps. This is done by configuring the Message Command bot block to recognize custom commands that will trigger your bot and return needed information.
What is the Message Command bot block
The Message Command bot block is where chat commands for the Attendance Manager, NextTicket Manager, and Utilization apps are configured to return specific information. This block recognizes preset commands that, when sent to MS Teams or Slack, return needed information according to the set schedule or on demand.
If you have specific business needs that are not currently addressed by our preset commands, you can customize commands in the Message Command bot block.
For example, if you want to use the check command in MS Teams to have MSPbots return specific messages, you can create a new bot, set up the check command in the Message Command block, and then add an Alert block so that entering the check command in MS Teams will automatically trigger the bot you created and return the message you set in the Alert settings.
Relevant applications and permissions
Only users with admin permissions can create bot blocks and configure the Message Command block. If you do not have the required permission, contact your administrator for help.
How to create a bot for using custom commands in chat
The steps below show how you can create custom commands in the Message Command bot block. For this example, we want to set up a bot that will use the command check. Do the following:
- Log in to MSPbots using your Office 365 account.
- Navigate to Bots on the left menu then click the New Bot button on the Bots screen.
- When the Create a new bot window opens, select Start From Blank > Message Command.
-
When the next Create a new bot window appears, fill in the required fields.
- Enter a name in the Bot Name field.
- Identify the Role that will have access to the bot.
- Add a clear Description of the bot. (Recommended)
- Then click Continue button to open the tab with the details and settings for your new bot.
- Click Design on your bot's tab.
- In the Message Command pop-up window, click the Message Tool dropdown list, select Teams to trigger your bot.
- Next, go to the command menu, enter your custom command you want MSPbots to recognize, then click Finish.
Type commands in lowercase when adding new commands. Example: Type check instead of CHECK . - Click on the Message Command block, then click under it, and select Add a Block.
- Next, add an Alert block by clicking the generated blank block, typing Alert in the search bar, and selecting Alert.
- Next, start configuring the settings. Go to the Message Command block, click in the upper-right corner of the block, and select Edit.
- Verify if the selections for Message Tool and command are the same as your selections in steps 6 and 7. Click Next once confirmed.
- According to your preferences, follow the prompts on the Alert window and configure what message the Alert block sends when you send the command in Teams.
Please note that adding tokens is not supported when configuring the message in Alert block of this bot.
- Click Finish.
- Click Save on the upper right corner of your bot's window.
- Verify your settings. Go to MS Teams and type check. The command should be recognized and return a response based on the configurations you made.
MS Teams Command Template Bots
The table below displays the commands available for MS Teams, including their descriptions, configuration blocks, and corresponding need for alerts. Use this table as a guide when modifying message commands.
Template Bots | Message Command | Corresponding Block | Need for Alert Block | Descriptions |
TeamsCommand help |
hi | Command-Help | Yes | Bot that recognizes the hi command to return answers related to help information |
hello | Yes | Bot that recognizes the hello command to return answers related to help information | ||
help | Yes | Bot that recognizes the help command to return answers related to help information | ||
TeamsCommand in | in | Attendance-in | Yes | Bot that recognizes the in command for checking in into the Attendance Manager |
TeamsCommand out |
out |
Attendance-out | Yes | Bot that recognizes the out command when logging off in the Attendance Manager |
TeamsCommand break | break | Attendance-break | Yes | Bot that recognizes the break command for logging a pause from work in the Attendance Manager |
TeamsCommand lunch | lunch | Attendance-lunch | Yes | Bot that recognizes the lunch command for logging a lunchbreak the Attendance Manager |
TeamsCommand onsite | onsite | Attendance-onsite | Yes | Bot that recognizes the onsite command for the Attendance Manager check-in |
TeamsCommand back | back | Attendance-back | Yes | Bot that recognizes the back command when logging back to work in the Attendance Manager |
TeamsCommand pto | pto | Attendance-pto | Yes | Bot that recognizes the pto command to handle related leave operations |
TeamsCommand_wfh | wfh | Attendance-wfh | Yes | Bot that recognizes the wfh command for the Attendance Manager check-in |
Tech Stats Reviewer | stats or qa | Utilization-stats | Yes | This bot reports the total working hours, utilization rate, overlapping time entries, ongoing work orders, and pending tasks before the end of each user's workday. |
TeamsCommand nt | nt | NT command message formatting | Yes | When used, the nt command the bot returns data in a custom format. |
TeamsCommand reject | reject | Teams Command-reject | No | Bot that recognizes the reject command to skip the current ticket. This bot needs to be used with the nt command. |
TeamsCommand unknown | unknown | Teams Command-ChatGPT | Yes | Bot that returns answers from ChatGPT. You need to set up your OpenAI integration before you can start using this bot. |