Strapi plugin logo for Telegram Bot

Telegram Bot

Telegram bot for sending messages.

Strapi v4 plugin: Telegram bot

Plugin Strapi for sending messages to a Telegram bot.


Table of Contents

✨ Features

The plugin allows sending text messages to site administrators. This will enable quicker processing of customer inquiries or orders.

⏳ Installation

Via Strapi Marketplace

Currently, this is not implemented.

Via command line

(Use yarn to install this plugin within your Strapi project (recommended). Install yarn with these docs.)

1
  yarn add telegram-bot-strapi

After successful installation you've to re-build your Strapi instance. To archive that simply use:

1
2
  yarn build
  yarn develop

The telegram-bot plugin should appear in the Plugins section of Strapi sidebar after you run app again.

As a next step you must configure your the plugin by the way you want to. See Configuration section.

All done. Enjoy 🎉

🔧 Configuration

  • Register a Telegram bot using @BotFather
  • Add the received token to the .env file.
    1
    TELEGRAM_TOKEN=""
  • A plugin will appear in the Strapi admin panel.

    Plugin

  • In the plugin window, the name of your bot should appear. Name Plugin

  • Congratulations, everything is ready for use.

🖐 Using

  • Add the created bot to the contacts list.
  • Execute the command /start in the added bot. Start bot
  • Receive a message about successful registration. Registration in  bot
  • In the bot's window, click the Update list chats button.
  • The registered user will appear in this list. Update list chats
  • Edit the user's settings to allow them to receive messages. Enable chat
  • To send messages to all selected users, make a POST request.

    1
    2
    3
    4
    5
    http://[addres sever]/telegram-bot-strapi/send-message
    
      {
        "message": "My first message"
      }
    
  • All activated users will receive the message.

  • In response, we will receive a message:

    1
    2
    3
    {
      "result": "Message send"
    }
    

📚 References

Install now

npm install telegram-bot-strapi

STATS

6 GitHub stars31 weekly downloads

Last updated

253 days ago

Strapi Version

4.0.0 and above

Author

github profile image for Serhii Kostiuchenko
Serhii Kostiuchenko

Useful links

Create your own plugin

Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.