Skip to content

A Telegram Bot that automatically reacts to posts in Telegram Channels, groups, and private messages, developed as a server-less application.✨

License

Notifications You must be signed in to change notification settings

Malith-Rukshan/Auto-Reaction-Bot

Repository files navigation

❤️ Auto Reaction Bot ✨

✨ Automate Your Telegram Chats with this Auto Reaction Bot! React to Messages Effortlessly! 🚀

Serverless deployment on Cloudflare - Free

Telegram API · Supported Reactions . Report a Bug

Auto Reaction Preview

✨ Features

  • Automatic Reactions ✓
  • Supports Multiple Chats ✓
  • Customizable Reactions ✓
  • Efficient Real-Time Processing ✓
  • Serverless Architecture ✓
  • Supports for Groups & Channels ✓
  • Compliance with Telegram API Updates ✓
  • Lightweight Code - Easy Setup ✓
  • More Comming Soon...

🚀 Deploy on PasS

Set All Environmental variables before deploy. - Instructions

Deploy with heroku Deploy to Netlify

Deploy on Railway Deploy to Render

✅ Serverless - Free

Deploy with Vercel Deploy to Cloudflare Workers


🚀 Deploy with Workers

Deploying this Telegram Auto-Reaction Bot on Cloudflare is straightforward thanks to the Deploy to Cloudflare button. Follow the steps below to get started:

  1. Start the Deployment:

    • Click the "Deploy to Cloudflare Workers" button below.
    • Deploy to Cloudflare Workers
  2. Set up your Cloudflare account:

    • If you do not already have a Cloudflare account, you will be prompted to create one.
    • Follow the on-screen instructions to set up your new Worker.
  3. Configure and Deploy:

    • Once logged in, authorize the deployment and configure the Worker with the environment variables described below.
    • Review and adjust the Worker’s settings as needed before finalizing the deployment.
    • You must add Repository secrets according to instructions before deployment.
    • After Deploy you must Configure the Webhook
Cloudflare Worker Settings

Demo: Experience the Auto Reaction Bot in demo: Auto Reaction Bot ✨.

🚀 Deploy with Github Actions

First you must Add Repository secrets as follows

Add Repository secrets

After that Click Here to Run Action.

🛠 Configuring Environments

To ensure that your Telegram Auto-Reaction Bot operates correctly, you will need to configure several environment variables in your Cloudflare Worker settings:

  • BOT_TOKEN: This is your bot's token, which you can generate from BotFather. This token allows your bot to authenticate and interact with the Telegram API.
  • BOT_USERNAME: The username you have set for your bot. This is used within the script to identify messages intended for your bot.
  • EMOJI_LIST: A string of emojis that the bot will use to react to messages. You can customize this list to include any emojis you prefer, such as 👍❤🔥🥰👏😁🎉🤩🙏👌🕊😍🐳❤‍🔥💯⚡🏆.
  • RANDOM_LEVEL: An integer that determines the randomness of reactions in group chats. Lower values result in more predictable reactions, while higher values increase randomness. Default is 0, meaning reactions are consistent by default.
  • RESTRICTED_CHATS: A list of chat IDs where the bot should not react to messages (Optional). Split each chat ID by " , ". Example : -1001233434,3434234

🧩 Configure the Webhook

Open your web browser and enter the following URL (replace with your actual bot token and https://your.cloudflare.worker.url/ with your Cloudflare Worker URL):

https://api.telegram.org/bot<YourBotToken>/setWebhook?url=https://your.cloudflare.worker.url/

Verify the Webhook Configuration: To check if the webhook is set up correctly, navigate to:

https://api.telegram.org/bot<YourBotToken>/getWebhookInfo

🚀 Deploy Manually with Cloudflare Wrangler

If you prefer to manually deploy the Auto Reaction Bot using Cloudflare Wrangler, follow these detailed steps to get started:

Prerequisites

Before you begin, you will need to have git installed on your local machine to clone the repository.

Step 1: Clone the Repository

Start by cloning the repository to your local machine. Open your terminal and run the following command:

git clone https://github.com/Malith-Rukshan/Auto-Reaction-Bot.git
cd Auto-Reaction-Bot

Step 2: Configure wrangler.toml

Edit the wrangler.toml file in your project directory to include your environment variables (like example.wrangler.toml). You will need to replace the placeholder values with your actual data : 🛠 Configuring Environments

Step 3: Install Cloudflare Wrangler

To deploy using Cloudflare Wrangler, you must first install it. You can find the installation instructions and more information on the official Cloudflare Wrangler documentation.

Step 4: Deploy Using Wrangler

Once Wrangler is installed and you've configured your wrangler.toml file, deploy your project to Cloudflare Workers by running the following command in your terminal:

wrangler publish

This command will deploy your bot to Cloudflare Workers, now you must Configure the Webhook. After All it will start reacting to messages in Telegram chats as configured.

🎯 Credits and Other

⚖️ License

And of course:

MIT: http://opensource.org/licenses/MIT

About

A Telegram Bot that automatically reacts to posts in Telegram Channels, groups, and private messages, developed as a server-less application.✨

Topics

Resources

License

Stars

Watchers

Forks