Skip to content

fincubator/tellerbot

Repository files navigation

TellerBot

Documentation Status pre-commit Translation Status GitHub license Telegram Code style: black


@TellerBot is an asynchronous Telegram Bot written in Python to help you meet people that you can swap money with.

Requirements

  • Python >= 3.8
  • MongoDB
  • Motor - asynchronous Python driver for MongoDB
  • AIOgram - asynchronous Python library for Telegram Bot API
  • Emoji - emoji for Python

Installation and launch

Using Docker (recommended)

  1. Clone the repository:
git clone https://github.com/fincubator/tellerbot
cd tellerbot
  1. Create environment file from example:
cp .env.example .env
  1. Personalize settings by modifying .env with your preferable text editor.
  2. Create a new Telegram bot by talking to @BotFather and get its API token.
  3. Create a file containing Telegram bot's API token with filename specified in TOKEN_FILENAME from .env (example in secrets/tbtoken).
  4. (Optional) If you're going to support escrow, set ESCROW_ENABLED=true in .env and create a file containing JSON mapping blockchain names to bot's WIF and API nodes with filename specified in ESCROW_FILENAME from .env (example in secrets/escrow.json).
  5. Create a file containing database password with filename specified in DATABASE_PASSWORD_FILENAME from .env (example in secrets/dbpassword).
  6. Install Docker Compose version no less than 1.26.0.
  7. Start container:
docker-compose up --build

For subsequent launches starting container is enough.

Manual

  1. Clone the repository:
git clone https://github.com/fincubator/tellerbot
cd tellerbot
  1. Install Python version no less than 3.8 with pip.
  2. Install requirements:
pip install -r requirements.txt
pip install -r requirements-escrow.txt  # If you're going to support escrow
  1. Compile translations:
pybabel compile -d locale/ -D bot
  1. Create environment file from example:
cp .env.example .env
  1. Personalize settings by modifying .env with your preferable text editor. Remove INTERNAL_HOST and DATABASE_HOST if you want bot and database running on localhost.
  2. Create a new Telegram bot by talking to @BotFather and get its API token.
  3. Create a file containing Telegram bot's API token with filename specified in TOKEN_FILENAME from .env (example in secrets/tbtoken).
  4. (Optional) If you're going to support escrow, set ESCROW_ENABLED=true in .env and create a file containing JSON mapping blockchain names to bot's WIF and API nodes with filename specified in ESCROW_FILENAME from .env (example in secrets/escrow.json).
  5. Create a file containing database password with filename specified in DATABASE_PASSWORD_FILENAME from .env (example in secrets/dbpassword).
  6. Install and start MongoDB server.
  7. Set environment variables:
export $(sed 's/#.*//' .env | xargs)
  1. Create database user:
./mongo-init.sh
  1. Restart MongoDB server with access control enabled.
  2. Launch TellerBot:
python .

For subsequent launches setting enviroment variables and launching TellerBot is enough.

Contributing

You can help by working on opened issues, fixing bugs, creating new features, improving documentation or translating bot messages to your language.

Before contributing, please read CONTRIBUTING.md first.

License

TellerBot is released under the GNU Affero General Public License v3.0. See COPYING for the full licensing conditions.