Skip to content

Telegram bot for publishing anonymous messages from Russian-speaking users who want to vent, complain, or share their pain.

License

Notifications You must be signed in to change notification settings

gorshunovr/tg-anon-cry-out-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Anonymous Telegram Bot "Cry Out"

This is a Telegram bot for publishing anonymous messages from Russian-speaking users who want to vent, complain, or share their pain. The bot uses the OpenAI API to ensure messages meet community guidelines and then posts them in a Telegram channel, where others can express support through reactions and comments.


🔧 Features

  • 📥 Accepts user messages
  • 🤖 Verifies messages using OpenAI (GPT-3.5)
  • 📜 Checks compliance with posting rules (in Russian, no harsh swearing, etc.)
  • 📢 Publishes to the specified Telegram channel
  • 🔗 Replies to the user with a direct link to the published message
  • ⏳ Customizable rate limiting (1 message per user per 20 min by default)
  • 📛 Deduplication (prevents duplicate messages)
  • 🔗 Supports polling and webhook modes
  • 🔄 Implements handling for SIGINT/SIGTERM signals to allow graceful shutdowns

🚀 Quick Start (Docker)

  1. Clone the repository:

    git clone https://github.com/yourusername/tg-anon-bot.git
    cd tg-anon-bot
  2. Create an .env file with environment variables:

    TELEGRAM_BOT_TOKEN=your_telegram_bot_token
    TELEGRAM_BOT_CHANNEL_NAME=@your_channel_name
    OPENAI_API_KEY=your_openai_api_key
    WEBHOOK_URL=your_webhook_url  # leave empty for polling mode
    OPENAI_PROMPT=Проверь, соответствует ли сообщение следующим критериям: написано преимущественно на русском языке, не содержит грубых ругательств (допускаются слова с символами '*'), а цель сообщения — пожаловаться, выплакаться, выговориться публично. Ответь только 'да' или 'нет'. Сообщение:
    RATE_LIMIT_DURATION=20
  3. Build and run the Docker container:

    docker build -t tg-anon-bot .
    docker run -d --restart=always -p 8080:8080 --env-file .env tg-anon-bot

📋 Message Rules

  1. The message should be mostly in Russian.
  2. Harsh obscene language is not allowed.
  3. Mild swearing is allowed if letters are replaced with * so that the meaning is still clear.
  4. The message should aim to express emotion, vent, and seek support.

🔒 License

This project is licensed under the GPL-3.0. See the full LICENSE file for more details.


🤝 Acknowledgements


🚧 Future Improvements

  • 💾 Backup Strategy: Consider persisting important data (e.g., using SQLite) to maintain state across restarts

📫 Contact

If you have suggestions or questions — feel free to open an issue or submit a pull request!


👤 Author

About

Telegram bot for publishing anonymous messages from Russian-speaking users who want to vent, complain, or share their pain.

Topics

Resources

License

Stars

Watchers

Forks