目录

Auto Push GitHub Bot by Telegram

This is a Node.js Telegram bot that automatically pushes a specified file to one or more GitHub repositories at a set interval. The bot is controlled via Telegram inline buttons and supports multiple users independently.

Auto Push GitHub Bot by Telegram

Features

  • Set GitHub Token, Username, Repo(s) sequentially via guided prompts
  • Specify file to push (default: log.md)
  • Set delay between pushes (seconds)
  • Start and stop the bot
  • Runs continuously until stopped
  • Supports multiple Telegram users independently
  • User-friendly interface with Telegram inline buttons

Setup

  1. Clone this repository:

    git clone https://github.com/xsrazy/GitHub-Auto-Push-by-Telegram.git
    cd GitHub-Auto-Push-by-Telegram
  2. Install dependencies:

    npm install
  3. Create a .env file and add your Telegram Bot Token:

    TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
  4. Run the bot:

    npm start

Usage

Use the Telegram inline buttons to control the bot. The bot will guide you through setting up your GitHub token, username, repositories, file, and delay sequentially.

Main buttons:

  • ⚙️ Settings
  • ▶️ Start Push
  • ⏹️ Stop Push
  • 📊 Status

Settings buttons:

  • 🔑 Set GitHub Token
  • 👤 Set Username
  • 📁 Set Repos
  • 📄 Set File
  • ⏱️ Set Delay
  • 🔙 Back to Main Menu

Notes

  • The bot writes a message with the current WIB (GMT+7) time into the file before pushing
  • Each user’s settings and push operations are independent
  • Make sure the file to push exists in the bot’s directory

Deploy to VPS/Terminal

  1. Upload the files to your VPS:

    scp -r auto-push-bot/* user@your-vps:/path/to/deploy
  2. SSH into your VPS:

    ssh user@your-vps
  3. Navigate to the bot directory:

    cd /path/to/deploy
  4. Install dependencies and start the bot:

    npm install
    npm start

For running the bot continuously, you can use PM2:

npm install -g pm2
pm2 start bot.js

Credits

Created by Xsrazy

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号