The complete, open-source solution for creating a safe and engaging anonymous confessions space on Telegram.
Get Starteda safe space for Addis Ababa University students to share their untold stories, secrets, thoughts, and feelings completely anonymously.
Deploy your own instance of this bot and get it featured. A great way to build and manage your own community.
Before you begin, you need to collect a few key pieces of information. This is the most important step!
-100
.Next, download the code from GitHub and install the necessary Python packages.
This command downloads the bot's source code into a new folder named
confessions-bot
.
git clone https://github.com/addisuderrese/confessions-bot.git
Move your terminal session into the newly created folder.
cd confessions-bot
This command installs all the libraries the bot depends on to function.
pip install -r requirements.txt
You'll store your credentials in a secure .env file. Create this file in the main directory of the bot.
This is the unique key for your bot. Get it from @BotFather after creating your bot.
BOT_TOKEN="123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
This is your personal Telegram User ID, which grants you admin privileges. Get it from @userinfobot.
ADMIN_ID="987654321"
The unique identifier for your public channel. Make sure the bot is an administrator in this
channel. The ID should start with -100
.
CHANNEL_ID="-1001234567890"
The full connection string for your PostgreSQL database. You can get this from your database provider (e.g., Aiven, Supabase).
DATABASE_URL="postgres://user:password@host:port/dbname?sslmode=require"
Once your .env
file is saved with all four values, you're
ready for the final step!
With the configuration complete, you're ready to start the bot.
Execute the following command in your terminal. The bot will start up, connect to the database, and begin listening for commands.
python main.py
On its first run, the bot will automatically create all the necessary tables in your database. You should see log messages in your terminal indicating a successful database connection and table setup.
Your bot is now live! Try sending it a /start
command on Telegram
to verify it's working.
/start
Shows the welcome message or views a confession.
/confess
Starts the anonymous confession submission process.
/profile
View your Aura points and submission history.
/help
Displays the help message with all commands.
/id <user_id>
Gets a detailed profile of a user.
/warn <user_id> <reason>
Sends a formal warning to a specific user.
/block <user_id> <duration>
Temporarily blocks a user (e.g., `7d`, `2w`).
/pblock <user_id>
Permanently blocks a user from the bot.
This project is open source and contributions are welcome! If you have ideas for new features, bug fixes, or improvements, please fork the repository and open a pull request.
View on GitHub