RedBot
What's new • Plugins • Documentation • GitHub • Forum • Blog
Back
Commands

The Commands plugins is used to show some localized contents as answer to simple Telegram-like commands (i.e., /my-command or /terms).

The plugin works with all platforms and the contents are defined using the Mission Control's content management system. It also supports localized contents: the chatbot user will always receive the content in the registered language, if present, otherwise the fallback language will be used.

For the Telegram platform, the chatbot menu in the Telegram client is updated automatically.

How to use

Connect the first pin to the senders node, use the second pin as a pass-thru pin to the other chatbot sections (to handle all other requests):

How to use Commands plugin

Define contents

Use Mission Control to define the contents. Click on "Add command" to add a new command (i.e., /privacy) then click on the plus sign to "Create content", don't forget to define the language of the content and the slug.

What's a slug? It's a unique identifier for the same content written in a different language. For example, a content with slug privacy and English language and a content with the same slug privacy and Italian language. In the Commands window the clickable labels "en" and "it" will be shown next to "slug: privacy".

Parameters

  • ChatbotId: it's the chatbotId for which we want to load the commands for. Mission Control is able to handle multiple chatbots, you can find the current chatbotId in the drop-down menu in the top right corner.
  • Failback language: in case a content is not available in the user's language, the default (or failback language will be used)
  • Update menu: only for Telegram, automatically updates the chatbot menu in the Telegram's client.

Changelog

  • 1.3.1 Fixed empty content body, now command with missing content just passes through
  • 1.3.0 Updated docs and removed dependencies from internal configuration.
  • 1.1.0 Add failbackLanguage and chatbotId parameter
  • 1.0.3 Fixed "send" error
Version
1.3.1
content
commands
How to install a plugin?

Installing plugins it's easy: open Mission Control (https://your-bot.com/mc or locally http://localhost:1880/mc) and then go to the plugins section and click on "install" (some plugins could include a Node-RED flow to import).

Be sure to enable Mission Control in RedBot / Node-RED and enable it in the bot configuration, read a complete tutorial here.

Coded with ❤️ in 🇮🇹