Code Monkey home page Code Monkey logo

telegram-bulk-message-termux's Introduction

Bulk Telegram Message Sender for Termux

This script sends a bulk message to multiple Telegram users using a bot. It iterates over a list of user IDs stored in a users.txt file and sends a specified message to each user.

Prerequisites

  • A Telegram bot token. You can get one by creating a bot through BotFather.
  • A list of user IDs saved in a file named users.txt, with each ID on a new line.
  • Termux app installed on your Android device.

Installation

  1. Install Termux: Download and install Termux from the Google Play Store or F-Droid.

  2. Install required packages: Open Termux and install curl if it's not already installed:

    pkg update && pkg upgrade
    pkg install curl

Usage

  1. Prepare your environment:

    • Make sure you have curl installed (as per the above installation step).
    • Create a file named users.txt in the same directory as the script. Add the Telegram user IDs, one per line.
  2. Configure the script:

    • Open the script file and replace YOUR BOT TOKEN HERE with your actual Telegram bot token.
    • Replace test bulk message with the message you want to send.
  3. Run the script:

    • Open Termux and navigate to the directory containing the script:
      cd /path/to/your/script
    • Make the script executable (if it’s not already):
      chmod +x bulk_message_sender.sh
    • Execute the script:
      ./bulk_message_sender.sh

Script

#!/bin/bash

# Replace <YourBotToken> with your actual Telegram bot token
TOKEN="YOUR BOT TOKEN HERE"

# Replace <YourMessage> with the message you want to send
MESSAGE="test bulk message"

# Iterate over the list of user IDs and send the message to each user
for USER_ID in $(cat users.txt); do
    curl -s -X POST "https://api.telegram.org/bot$TOKEN/sendMessage" -d "chat_id=$USER_ID&text=$MESSAGE" > /dev/null
    sleep 1  # Add a delay to avoid rate limiting
done

Notes

  • Rate Limiting: The script includes a sleep 1 command to add a delay of 1 second between each message to avoid hitting Telegram's rate limits.
  • Error Handling: Currently, the script does not include error handling. If you need more robust error handling, you might consider adding checks for the HTTP response status and logging errors appropriately.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.

Contact

If you have any questions or need further assistance, please open an issue in the repository or contact the maintainer.

telegram-bulk-message-termux's People

Contributors

8izzle avatar

Stargazers

 avatar

Watchers

 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.