A privacy-focused Telegram bot for sending "whisper" messages in groups.
Features • Installation • Configuration • Tech Stack • Contributing
Whisper Bot allows users to send hidden messages ("whispers") in public Telegram groups. The content of the message is hidden behind a button and can only be viewed by the sender and the specified recipient.
It works primarily via Inline Mode, meaning you can use it in any chat without adding the bot as a member.
- Inline Whispers: Type
@{bot_username} message @usernamein any chat. - Privacy First: Only the sender and the target recipient can see the message text.
- Smart Suggestions: The bot remembers your frequent contacts for quick access.
- User-Friendly Interface:
- Manual username/ID entry.
- Select user from contacts via private chat.
- Internationalization (i18n):
- English
- Russian
- Robust Backend: Built with asynchronous Python and PostgreSQL.
The easiest way to run the bot is using Docker Compose.
- Docker & Docker Compose installed.
- A Telegram Bot Token obtained from @BotFather.
-
Clone the repository:
git clone https://github.com/bchudo/whisper-telegram cd whisper-telegram -
Configure environment variables: Rename
.env.exampleto.envand populate it with your data.mv .env.example .env nano .env # or use any text editor -
Run with Docker:
docker-compose up -d --build
-
Bot settings: Make sure to enable Inline Mode for your bot in @BotFather (
/mybots-> Select Bot -> Bot Settings -> Inline Mode -> Turn on). And enable Inline Feedback for your bot on 100%
| Variable | Description | Default |
|---|---|---|
BOT_TOKEN |
Your Telegram Bot API Token | Required |
LOGGING_MODE |
Logging output (only_file, only_stdout, all) |
all |
DEFAULT_LOCALE |
Fallback language (en or ru) |
en |
DB_HOST |
Database host (use db for Docker) |
localhost |
DB_PORT |
Database port | 5432 |
DB_NAME |
Database name | whisper |
DB_USER |
Database username | postgres |
DB_PASSWORD |
Database password | Required |
- Language: Python 3.11
- Framework: aiogram 3.x (Asynchronous Telegram Bot API framework)
- Database: PostgreSQL
- Driver: asyncpg (High-performance async PostgreSQL driver)
- I18n: fluent & aiogram-i18n
- Infrastructure: Docker & Docker Compose
If you want to run the bot locally without Docker:
- Create a virtual environment:
python -m venv venv source venv/bin/activate # on Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Ensure you have a PostgreSQL database running and configure
.envto point tolocalhost. - Run the bot:
python -m whisper
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the MIT License. See LICENSE for more information.