https://github.com/sobhan-srza/anonymous-chat-bot
A Telegram bot for anonymous chatting with referral system and profile-based random chat.
https://github.com/sobhan-srza/anonymous-chat-bot
anonymous anonymous-chat anonymous-chat-bot mr-sinre persian-caesar sobhan-srza telegraf telegrafjs telegram telegram-bot telegram-bot-api telegram-bots telegram-tool
Last synced: 26 days ago
JSON representation
A Telegram bot for anonymous chatting with referral system and profile-based random chat.
- Host: GitHub
- URL: https://github.com/sobhan-srza/anonymous-chat-bot
- Owner: Sobhan-SRZA
- License: bsd-3-clause
- Created: 2025-02-03T09:43:04.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-10T19:50:35.000Z (3 months ago)
- Last Synced: 2025-02-10T20:34:38.560Z (3 months ago)
- Topics: anonymous, anonymous-chat, anonymous-chat-bot, mr-sinre, persian-caesar, sobhan-srza, telegraf, telegrafjs, telegram, telegram-bot, telegram-bot-api, telegram-bots, telegram-tool
- Language: TypeScript
- Homepage:
- Size: 150 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license
Awesome Lists containing this project
README
# Anonymous Chat Bot π€
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
This project is a Telegram bot that enables users to chat anonymously. It features a referral system where each user can generate a unique referral link (without revealing their Telegram ID), profile creation (e.g., setting gender), and random anonymous chat options with filtering.
> **Note:** The bot supports various message types (text, stickers, photos, files, voice messages, videos, etc.) by copying messages so that the senderβs identity remains hidden.
---
## Features β¨
- **Anonymous Chat:** Chat with random users without revealing your personal details.
- **Referral System:** Generate a unique referral code and share your referral link without exposing your Telegram user ID.
- **Profile Management:** Set up your profile (e.g., gender) for filtered random chats.
- **Multi-type Messaging:** All message types (text, photo, sticker, video, etc.) are forwarded/copyed anonymously.
- **Database Integration:** Uses [quick.db](https://www.npmjs.com/package/quick.db) with JsonDriver for storing non-sensitive data like profiles and referral codes.---
## Prerequisites βοΈ
- **Node.js** (v14 or higher recommended)
- **Telegram Bot Token:** Create a bot via [BotFather](https://core.telegram.org/bots#6-botfather) and obtain your bot token.---
## Setup Instructions π
### 1. Clone the Repository
```bash
git clone https://github.com/yourusername/anonymous-chat-bot.git
cd anonymous-chat-bot
```### 2. Install Dependencies
```bash
npm install
```### 3. Configure the `.env` File
Create a `.env` file in the root directory. **Make sure to provide values for at least `token` and `database_type`.**
Below is an example configuration:```ini
# Bot token (required)
token="YOUR_TELEGRAM_BOT_TOKEN"# Database type (required): options are "mysql" | "sql" | "mongodb" | "json"
database_type="json"# (Optional) If using MongoDB:
database_mongoURL="your-mongo-url"# (Optional) If using MySQL:
database_msql_host="your-mysql-host"
database_msql_user="your-mysql-user"
database_msql_password="your-mysql-password"
database_msql_database="your-mysql-database"# Support server invite link (optional)
support_url="https://discord.gg/yourInvite"# Source owners (optional, comma-separated list of owner IDs)
owners='["123456789", "987654321"]'# Anti crash controller (optional)
anti_crash="true"# Send console errors to Discord (optional)
logger="true"
```### 4. Running the Bot
You can run the bot in development mode using `ts-node`:
```bash
npm start
```Or compile the TypeScript code to JavaScript and run it:
```bash
npm run build
node dist/index.js
```---
## Available Commands π
| Command | Description | Emoji |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
| `/help` | Preview all bot avalible commands with description. | β |
| `/link` | Send or create a referral link of your anonymous chat invite. | π |
| `/settings` | Your settings in bot. (With using buttons you can customize your bot profile.) | β |
| `/start` | Starts the bot. Without parameters, it shows usage instructions. With a referral parameter (``), it connects you with a partner. | π |
| `/stop` | Stops the current chat session and removes you from any waiting queues. | β |---
## Packages & Versions π¦
| Package | Version | Description | Emoji |
|----------------------|------------|-----------------------------------------------------------------------------------------------------------|----------|
| **telegraf** | ^4.16.3 | Telegram bot framework for interacting with the Telegram Bot API. | π€ |
| **dotenv** | ^16.4.7 | Loads environment variables from a `.env` file. | π± |
| **quick.db** | ^9.1.7 | A simple SQLite-based database using JsonDriver for storing bot data. | ποΈ |
| **colors** | ^1.4.0 | Adds color support to console messages, making debugging output more visually appealing. | π¨ |
| **write-file-atomic**| ^6.0.0 | Provides atomic writing to a file to ensure data integrity during writes. | πΎ |
| **@types/node** | ^22.5.0 | TypeScript definitions for Node.js, providing type checking and IntelliSense for Node.js APIs. | π |
| **ts-node** | ^10.9.2 | Runs TypeScript files directly without needing to compile them first. | β‘ |
| **tsup** | ^8.2.4 | A bundler for TypeScript projects that provides fast and simple builds. | π¦ |
| **tslib** | ^2.8.1 | Contains runtime helpers for TypeScript to reduce output size. | π§ |
| **typescript** | ^5.5.4 | A superset of JavaScript that compiles to plain JavaScript and provides static type checking. | π» |---
## License
This project is licensed under the [BSD 3-Clause License](./license).
---
## Final Steps
1. **Ensure your `.env` file is properly configured** with at least the `token` and `database_type` values.
2. **Run `npm install`** to install all dependencies.
3. **Start your bot** using `npm start` (or build and run the compiled JavaScript).Enjoy using the Anonymous Chat Bot and feel free to extend its functionality as needed!
---
## Contact