This is a simple anonymous chat bot built using Python and the Telegram Bot API. The bot connects random users for anonymous conversations and includes features like pseudonyms, gender-based pairing, and the ability to skip chats.
- Random Pairing: Users are randomly paired for anonymous chat sessions.
- Pseudonyms: Each user is assigned a unique pseudonym to maintain anonymity.
- Gender Selection: Users can select their gender (male/female) to be paired with a user of the opposite gender.
- Skip Feature: Users can skip the current chat and be reconnected with a new random user.
- Forbidden Words Filter: Messages containing forbidden words will be blocked.
To run this bot, you'll need the following installed:
- Python 3.x
- Telegram Bot Token (You can get this from BotFather on Telegram)
-
Clone the repository:
git clone https://github.com/davlix/Telegram-anonymous-chat-bot.git cd Telegram-anonymous-chat-bot
-
Install the required Python packages:
pip install -r requirements.txt
-
Add your Telegram Bot Token to the bot by modifying the
TOKEN
variable in thebot.py
file:TOKEN = 'YOUR_BOT_TOKEN'
-
Run the bot:
python bot.py
/start
: Starts the bot and prompts the user to choose their gender./male
: Choose the male gender for pairing with a female user./female
: Choose the female gender for pairing with a male user./skip
: Skip the current chat session and be paired with a new user./logout
: Exit the current chat or waiting queue.
- When a user types
/start
, they are asked to choose their gender using/male
or/female
. - After selecting a gender, they are added to a queue to be paired with a user of the opposite gender.
- Once paired, users can exchange messages anonymously using their pseudonyms.
- If a user sends
/skip
, they will leave the current chat and be paired with a new user from the queue. - The bot ensures that users are only paired with the opposite gender, and offensive words (defined in the
FORBIDDEN_WORDS
list) are filtered out.
- Forbidden Words: You can add or modify the forbidden words list by updating the
FORBIDDEN_WORDS
variable in thebot.py
file. - Pseudonyms: Update the
NICKNAMES
list to use different pseudonyms for users.
This project is licensed under the MIT License. See the LICENSE file for details.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.