This Telegram bot allows you to send private messages to individual participants in a Telegram group and fetch the participant IDs of a group.
- Send private messages to users using the
/sendprivate
command. - Fetch participant IDs of a group using the
/getparticipants
command.
-
Create a new bot with the help of BotFather and obtain the bot token.
-
Install the required Python packages:
pip install python-telegram-bot
-
Replace 'YOUR_BOT_TOKEN' in the bot_script.py file with your actual bot token.
-
Run the bot script:
python bot_script.py
-
Open the Telegram app and search for your bot by its username.
-
Start a chat with your bot.
To send a private message to a user:
/sendprivate <user_id> <message>
-
<user_id>: The ID of the user you want to send the message to.
-
<"message">: The content of the message you want to send.
-
Example:
/sendprivate 123456789 Hello there!
To fetch the participant IDs of a group:
/getparticipants <group_id>
-
<group_id>: The ID of the group you want to fetch participant IDs from.
-
Example:
/getparticipants -123456789
To deploy the bot, you have several options:
- Local Machine: Run the bot script on your local machine.
- Cloud Hosting Platforms: Deploy the bot on platforms like Heroku, AWS, Google Cloud Platform, or Azure.
- Server or VPS: Deploy the bot on a dedicated server or virtual private server (VPS).
Ensure that the bot script is running continuously to receive and respond to messages.
This project is licensed under the MIT License.