Giter VIP home page Giter VIP logo

telegram-forward-bot's Introduction

Telegram-Forward-Bot

Telegram-Forward-Bot built with Node.js based on Node-Telegram-Bot-API

This project relies on Node.js and MongoDB, so if you don't have both of these installed, please first install.

Start with single file

If you just want to use this bot, you can choose to download 2 runtime files to use it.

The main file below is built with vercel/ncc and does not require any other dependencies to be installed. Of course, you still need to install Node.js and MongoDB.

Please Note:

the configuration file must be in a directory named "env" and place the env directory at the same level as the main file.

After download, you should complete the configuration file.

Start with build

git clone https://github.com/DesnLee/Telegram-Forward-Bot.git && cd Telegram-Forward-Bot

Install Dependencies

 yarn install    # npm install

Config

in ./env/config.yaml

# Please keep the following double quotes

# Your mongodb address like 'mongodb://user:[email protected]:27017/ForwardBotDB'
database_url : ""

# The bot token that you get from BotFather
bot_token :    ""

# Your telegram number ID, no quotes like 123456789
me :

# Need notification, true / false
notice :       true

# Auto-reply message when the user sends the following commands, can use Markdown format
msg :
  start : "*Hello,welcome!*\n\nThis is my bot, and can forwards your messages to me"

# Don't change the following options!!
parse :
  html : { parse_mode : 'HTML' }
  mark : { parse_mode : 'Markdown' }
  mark2 : { parse_mode : 'MarkdownV2' }

build

yarn build    # npm run build

run

cd dist && node index.js

Usage

  • You can reply to the forwarded message to reply to the original message, currently supports text, stickers, photos.
  • Reply !ban or !unban to a forwarded message will add/remove someone to the blacklist, and when someone is blacklisted, the bot will not forward his/her messages to you.
  • Reply !info to a forwarded message will show you the userinfo whose sent the message.
  • Reply !del or !del all to a message you sent earlier and the message will be deleted from the chat history between the bot and you and the sender of the message.

Use the PM2 daemon

install PM2

npm install pm2 -g

use PM2

# start
pm2 start /Absolute/Path/To/index.js

# save status
pm2 save

# Boot up
pm2 startup

License

The MIT License (MIT)

Copyright © 2021 Alex Lee

telegram-forward-bot's People

Contributors

desnlee avatar

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.