Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nikkhvat/reply-bot
This is a simple Telegram bot that forwards messages sent to it to a group chat and sends back any replies to those messages to the original sender with the prefix reply-bot.
https://github.com/nikkhvat/reply-bot
nodejs telegraf telegram-bot
Last synced: about 1 month ago
JSON representation
This is a simple Telegram bot that forwards messages sent to it to a group chat and sends back any replies to those messages to the original sender with the prefix reply-bot.
- Host: GitHub
- URL: https://github.com/nikkhvat/reply-bot
- Owner: nikkhvat
- License: agpl-3.0
- Created: 2021-03-17T18:40:56.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T17:57:28.000Z (almost 2 years ago)
- Last Synced: 2023-09-18T18:08:56.162Z (over 1 year ago)
- Topics: nodejs, telegraf, telegram-bot
- Language: TypeScript
- Homepage:
- Size: 8.33 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Telegram Reply Bot
This is a simple Telegram bot that forwards messages sent to it to a group chat and sends back any replies to those messages to the original sender with the prefix reply-bot. The bot is written in TypeScript and uses the Telegraf library.
## Getting started
1. Clone the repository:
```bash
git clone https://github.com/nik19ta/reply-bot.git
```2. Install dependencies:
```bash
cd reply-bot
npm install
```3. Create a new Telegram bot and obtain an API token from the [BotFather](https://telegram.me/BotFather).
4. Set the `BOT_TOKEN` environment variable to the API token obtained in the previous step:```bash
BOT_TOKEN=
```5. Create a new group chat in Telegram and invite your bot to it.
6. Set the `GROUP_ID` environment variable to the ID of the group chat you just created. You can obtain the chat ID by adding the bot to the group and sending a message to it, then running the following command:
```bash
curl -X POST https://api.telegram.org/bot/getUpdates
```7. Look for the chat object in the JSON response and copy the value of the id field.
8. Set the `GROUP_ID` environment variable
```bash
GROUP_ID=
```Start the bot:
```bash
npm start
```## Usage
Send a message to the bot and it will be forwarded to the group chat. If anyone in the group replies to that message, the bot will send the reply back to the original sender with the prefix `reply-bot`.## Demo:
[![Watch the video](./screen_video.png)](https://youtu.be/TeOwEtaCdAk)
## License
This project is licensed under the MIT [License](https://github.com/nik19ta/reply-bot/blob/master/LICENSE.md). See the LICENSE file for details.