New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

auto-answering

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auto-answering

A configurable Node.js Telegram bot for Premium users that automatically replies to messages based on customizable triggers and replies, simulates typing behavior, supports multi-language responses, and logs messages for auditing.

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

Telegram Dynamic Responder

A robust Telegram bot that dynamically responds to messages using predefined triggers and replies. It logs messages and errors for auditing and debugging purposes and simulates real-user typing behavior before replying.

Features

  • Handles incoming Telegram webhooks for message events.
  • Simulates typing behavior before sending responses.
  • Logs all received messages into messages.log.
  • Logs all errors into errors.log.
  • Dynamic responses based on triggers defined in config.json.
  • Easily configurable via .env and config.json.

Prerequisites

  • Node.js
  • Telegram Bot Token

Installation

npm install

Configuration

  • Create a .env file in the root directory with the following variables:
BOT_TOKEN=<your_telegram_bot_token>
OWNER_ID=<your_telegram_user_id>
WEBHOOK_URL=https://your.domain.com
PORT=3000
SAVE_LOCAL=true
  • Customize config.json to set your triggers and replies.

Example config.json with localization support:

{
  "typingDelay": 1500,
  "languages": ["en", "ru"],
  "defaultLang": "en",
  "responses": {
    "en": [
      {
        "triggers": ["hi", "hello", "hey"],
        "replies": ["Hello! 👋", "Hi there! How can I help you?"]
      }
    ],
    "ru": [
      {
        "triggers": ["привет", "здравствуй"],
        "replies": ["Привет! 👋", "Здравствуйте! Чем могу помочь?"]
      }
    ]
  }
}

Usage

Start the bot with:

npm start

The bot will automatically set the Telegram webhook on startup.

Logs

  • Incoming messages are saved to messages.log (if enabled in .env)
  • Errors are logged into errors.log

Deployment

Ensure your server is accessible via the public URL defined in WEBHOOK_URL. Use services like Render, Railway, or Cloudflare Pages with Workers for hosting.

Keywords

telegram

FAQs

Package last updated on 20 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts