Giter VIP home page Giter VIP logo

viperadnan-git / telegram-forwarder-bot Goto Github PK

View Code? Open in Web Editor NEW
30.0 1.0 37.0 31 KB

Forward Telegram messages between chats using pure Telegram Bot API and Webhooks

Home Page: https://t.me/echoitbot

License: GNU General Public License v3.0

TypeScript 99.26% Dockerfile 0.74%
forward-messages telegram telegram-bot telegram-bot-api telegram-bots telegram-copier telegram-forward-bot telegram-forwarder telegram-message-forwarder telegram-messages

telegram-forwarder-bot's Introduction

Telgram Message Forwarder Bot

A simple telegram bot to forward messages from one channel to another channel or group. Written in pure Telegram Bot API using grammy framework. This bot uses webhooks to receive updates from telegram servers. So, you need a server with a public IP address and a domain name to run this bot. This bot can be deployed on serverless platforms like Vercel, Render, Cyclic etc.

Features

  • Forward messages from one channel to another channel or group
  • Forward messages from multiple channels to multiple channels or groups
  • Forward messages from multiple channels to a single channel or group
  • Forward messages from a single channel to multiple channels or groups
  • Configurations through commands
  • Owner only commands, so no one can misuse the bot
  • Easy to clone and create your own bot withing minutes

Commands

  • /start - Start the bot
  • /help - Show help message
  • /set - Add a channel to forward messages from
  • /rem - Remove a channel from forwarding messages
  • /get - List all the channels added
  • /set_owner - Set the owner of the bot

Configurations

Configurations are added in environment variables or .env.sample file and rename it to .env. The following environment variables are required to run the bot.

  • BOT_TOKEN - Telegram bot token received from BotFather
  • REDIS_URI - Redis database URI to store the channel ids. You can use Redis Labs to get a free Redis database
  • WEBHOOK_HOST - URL of the server where the bot is running

Deploying

Deploying on Vercel, Render, Cyclic, Heroku etc.

  • Fork this repository
  • Create a new app on the platform you want to deploy
  • Connect your forked repository to the app
  • Set environment variables in the project settings
  • (Optional) Set the PORT environment variable to the port number provided by the platform or set it to 3000

Deploy on VPS or any other server

Not recommended for beginners.

Note: You need a SSL certificates and a public IP address to run the bot on a VPS. As this bot work on webhooks, you need a domain name to set the webhook URL. You can use Cloudflare Tunnel to get a free domain name and SSL certificates.

  • Clone this repository
git clone <repo-url> <project-name>
cd <project-name>
  • Install dependencies
npm install
  • Build the project
npm run build
  • Set environment variables

  • Start the bot

npm start

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the GPL-3.0-or-later - see the LICENSE file for details

telegram-forwarder-bot's People

Contributors

viperadnan-git avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

telegram-forwarder-bot's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.