This is a Telegram bot that provides URL encryption services, bringing cloakstream website features to Telegram. It uses AES-GCM encryption to securely encrypt URLs and provides a simple interface for users to interact with the bot.
- Encrypt URLs: Send a URL to the bot, and it will provide an encrypted version of the URL.
- Commands:
/start
: Welcome message with instructions./help
: Instructions on how to use the bot./about
: Information about the bot.
- Node.js (version 16 or higher recommended)
- A Telegram Bot Token (create a bot via BotFather)
- Basic knowledge of environment variables and encryption
-
Clone the repository:
git clone https://github.com/advaithsshetty/cloakstream-telegram-bot.git cd cloakstream-telegram-bot
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory of the project and add the following variables:TELEGRAM_BOT_TOKEN=your-telegram-bot-token ENCRYPTION_PASSWORD=your-encryption-password BASE_URL=https://proxy-download.cdxfedcxadsdcsdxz.workers.dev/ PORT=5050
Replace
your-telegram-bot-token
with the token you received from BotFather, andyour-encryption-password
with a secure password of your choice.
To start the bot, run:
node --no-deprecation bot.js
or
node bot.js
The bot will start and listen for incoming messages. It will also start a basic HTTP server on the specified port (default is 5050).
The bot is hosted over here using daki.
- Start the Bot: Send
/start
to the bot to receive a welcome message. - Get Help: Send
/help
to the bot to get instructions on how to use it. - Learn More About the Bot: Send
/about
to get information about the bot. - Encrypt a URL: Simply send a URL (starting with
http://
orhttps://
) to the bot, and it will respond with the encrypted version of the URL.
The bot uses AES-GCM for encryption. The encryption process involves:
- Deriving a key from a password using PBKDF2.
- Encrypting the URL with AES-GCM.
- Returning the encrypted URL as a base64-encoded string.
This project is licensed under the MIT License - see the LICENSE file for details.
- node-telegram-bot-api for the Telegram Bot API integration.
- Crypto API for encryption utilities.
- Ensure that your
.env
file is correctly configured. - Make sure all dependencies are properly installed.
- Verify that your bot token and encryption password are correct.
- Check the server logs for any errors or issues during runtime.
For any additional help or to report issues, please open an issue on the GitHub repository.