What are bots in Rocket.Chat?
Bots (or Chatbots) are pieces of software that provide automated messaging in a chat platform. They are useful for running pre-defined (scripted) interactions to provide support, conversational workflow or on-boarding with multi-channel, multi-user, public and private interactions. Bots can also be integrated with external services.
In Rocket.Chat, a bot is a special user account with the
bot role and a specific set
How do bots send and receive messages?
Rocket.Chat’s framework (Meteor) has built-in utilities for streaming updates to data collections. Every user in Rocket.Chat has such a collection for their messages. Bots subscribe to the collection of messages for their user account, creating a stream that is updated every time a message is sent either directly to them or any room they are joined in.
For more details, see the Bots Architecture section.
How are bots hosted?
Rocket.Chat supports bots that are hosted outside of your Rocket.Chat instance. Their working logic is defined by their provider.
The hosting for bots depends on the platform. For example, Hubot can be launched on any Node.js environment, but you have to set it up yourself (using Heroku or Glitch services). Another bot platforms like Botkit provide their own services for hosting and provisioning bots. They just need a configuration to connect to your Rocket.Chat instance.
These are the basic steps for using bots with Rocket.Chat:
- A bot user is created by an admin on the server;
- The bot is running as a separate process using your chosen framework or platform;
- The bot environment is pre-configured with environment variables;
- The bot’s behavior is defined via scripts according to the requirements of your framework. For example, check the details on how to run a bBot bot.
Get yourself familiar with Bots Architecture.
- Creating Bot Users
- Configuring the Bot Environment
- Running a bBot Bot
- Running a Hubot Bot
- Running a Botkit Bot
- Running a Rasa Bot
- Running a Botpress Bot
Configuration and implementation details for components of the Bots Architecture can be found in their project READMEs:
- Rocket.Chat JS SDK
- bBot Rocket.Chat boilerplate
- Hubot Rocket.Chat boilerplate
- Hubot Rocket.Chat adapter
To contribute to features under development see our Bots Project issues.