Bot matching you with a random person on Telegram
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets Logo was equipped with background. Mar 7, 2016
randtalkbot was added. Bumped version number to 2.1.0 Jan 14, 2018
tests Several integration tests for chatting, chat lifecycle, invitations a… Jan 13, 2018
.gitignore Docker Compose was used for deploying. Jan 14, 2018
LICENSE Command line application package stub was taken here: https://github.… Jan 6, 2016 was updated with exact status badges. Jan 22, 2018 Docker Compose was used for deploying. Jan 14, 2018
docker-compose.yml Command line application package stub was taken here: https://github.… Jan 6, 2016

Rand Talk

Coverage Status Build Status

Telegram bot matching you with a random person of desired sex speaking on your language(s). Chat with anonymous strangers here. Rand Talk was written on Python 3.6 and telepot and uses MariaDB to store users' preferences. Rand Talk's interface was translated on several languages. You're able to send any messages except replies and forwarded messages. Rand Talk rewards you with bonuses for people you invite using your individual link. To get this link, use @RandTalkBot as inline bot. The bot collects stats regularly. Rand Talk rewards you with more bonuses for the people of rare sex.

Supported commands

In @BotFather compatible format:

begin - Begin looking for next stranger
end - End talking
setup - Choose languages and sex
help - Help for Rand Talk

Admins specified at admins configuration property are able to use the following additional commands:

clear TELEGRAM_IDs — "Clear" specified users. Stop their coversations or clear "looking for partner" flag.


  1. Reports
  2. Replies
  3. Customizable greetings message
  4. /oops command to ask your recent partner to connect together again


We're using Docker Compose to deploy Rand Talk's Docker container.

Create configuration/db_root_password and configuration/db_password files containing database passwords and configuration/telegram_token containing Telegram bot's token. After that write configuration/configuration.json file like that:

    "admins": [31416, 271828],
    "database": {
        "host": "db",
        "name": "randtalkbot",
        "user": "randtalkbot",
    "logging": {
        "version": 1,
        "formatters": {
            "simple": {
                "class": "logging.Formatter",
                "format": "%(asctime)s - %(levelname)s - %(name)s - %(message)s"
        "handlers": {
            "console": {
                "class": "logging.StreamHandler",
                "level": "DEBUG",
                "formatter": "simple"
        "loggers": {
            "randtalkbot": {
                "level": "DEBUG",
                "handlers": []
            "peewee": {
                "level": "DEBUG",
                "handlers": []
        "root": {
            "level": "DEBUG",
            "handlers": ["console", "email"]


  • admins — list of admins' Telegram IDs. Admins are able to use extended list of bot commands. Optional. Default is [].
  • logging — logging setup as described in this howto.

Fetch Docker Compose file:


Now you may run Rand Talk:

docker-compose up -d


We are glad to see your contributions to Rand Talk. Our reward starts from 10 bonuses for you.


We are interested in growing the number of Rand Talk's translations. You can help in doing that by translating some of .po files in randtalkbot/locale directory on your language. Feel free to send this files to

Here's the list of bot translators. Take your chance to be here!

Building gettext files

Use verboselib to extract new messages: extract -d randtalkbot -a -o randtalkbot/locale -i lib

And to compile them: compile -d randtalkbot/locale


To comfortably inject source code changes to the Docker container use another Docker Compose file:

docker-compose --file up


Launch tests and observe code coverage:

coverage run --source=randtalkbot -m unittest
coverage report -m

Launch some specific test:

python -m unittest tests.test_stranger.TestStranger


Please notice that tests' source code is also covered with codestyle checks but requirements for it are softer:

python lint