Skip to content

BorisovMaksim/FinanceBot

Repository files navigation

Telegram bot with AI

GitHub issues GitHub license Code style

Stack

Python Jupyter Notebook GitHub Docker PyTorch Postgres

Description

Finance bot built on dff. Uses telegram as an interface.

This bot listens for user questions and finds similar questions in its database by using the clips/mfaq model.

It displays found questions as buttons. Upon pressing a button, the bot sends an answer to the question from the database.

An example of bot usage:

Setup

Telegram

In order for the bot to work, set the bot token via .env. First step is creating your .env file:

echo TG_BOT_TOKEN=******* >> .env

Database

conda install -y -c conda-forge postgresql
initdb -D finance_db
pg_ctl -D finance_db -l logfile start
createuser --encrypted --pwprompt __username__
createdb --owner=__username__ inner_finance_db
echo POSTGRES_USERNAME=******* >> bot/.env
echo POSTGRES_PASSWORD=******* >> bot/.env
echo POSTGRES_DB=******* >> bot/.env

Tinkoff api

Get token from Tinkoff. Instruction is here

echo TINKOFF_TOKEN=******* >> .env

<<<<<<< HEAD

Run with python

=======

Run with Docker & Docker-Compose environment

In order for the bot to work, set the bot token via .env. First step is creating your .env file:

0fea0f1162dae6f5a211dd250d7e63f5effc93a7

pip install -r bot/requirements.txt
python bot/run.py

Run with Docker & Docker-Compose environment

Build the bot:

docker-compose build

Testing the bot:

docker-compose run bot pytest test.py

Running the bot:

docker-compose run bot python run.py

Running in background

docker-compose up -d

Run with Python environment

In order for the bot to work, set the bot token, example is in .env. First step is setting environment variables:

export TG_BOT_TOKEN=*******
export TINKOFF_TOKEN==*******

Build the bot:

pip3 install -r requirements.txt

Testing the bot:

pytest test.py

Running the bot:

python run.py

Contribution

Read CONTRIBUTING.md

Author

Vladimir Dimitrov

About

This is a project for Dialog system course at ITMO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages