How to create new custom slash command in rocket application for the admin

Hi guys , can any one help on to create new custom slash command in rocket chat in the rocketchat application in the admin account


Here you have a good, simple example on how to create a Rocket.Chat App that will provide a slash command:

hi thank you for your response, is there any steps to create or register slash command in the rocket chat without coding

Not for slash commands.

You can create an integrations, so when you type a trigger word on specific channels, it will send a webhook to a configurable endpoint where you can do whatever you want and then get the content back.

However, coding an App inside Rocket.Chat will give you the ability to open modals, create forms, store data inside Rocket.Chat, etc.

Thank you very much for your response

Here are the steps to create a new custom slash command in Rocket Chat:

  1. Log in to your Rocket Chat account as an administrator.
  2. Click on the three dots in the top left corner of the screen and select “Administration” from the dropdown menu.
  3. In the left sidebar, click on “Custom Commands.”
  4. Click on the “New” button in the top right corner of the screen.
  5. In the “Command” field, enter the command you want to create (e.g., /customcommand).
  6. In the “Description” field, enter a brief description of what the command does.
  7. In the “URL” field, enter the URL of the script or API endpoint that will handle the command. This script should return the output that you want the command to display in the chat.
  8. In the “Method” field, select the HTTP method (GET or POST) that the script uses.
  9. In the “Token” field, enter a secret token that will be sent with the command to authenticate it.
  10. Click on the “Save” button.

Your custom slash command is now created and ready to use in your Rocket Chat instance. You can test the command by typing it into the chat and seeing the output that your script returns.

1 Like