Skip to content

deeppavlov/DFF-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DFF Project Template

This repository is a template for DFF projects.

How to use it

Clone the repo:

git clone https://github.com/deeppavlov/DFF-template.git
cd DFF-template

Alternatively, you can create a new repository using this one as a template via GitHub:

https://github.com/new?template_name=DFF-template&template_owner=deeppavlov

Edit project files

[0.] Install dependencies with

(cd services/bot && pip install -r requirements.txt)
  1. Write your custom functions (e.g. custom responses, custom services) into bot/custom.
  2. Edit DFF script at bot/script.py.
  3. Save Telegram bot token into secrets/tg_token.txt. (currently this template only supports telegram bots)

Test the bot

With Python

(cd services/bot && pytest test.py)

With Docker

docker build --target test services/bot

Run the bot

With Python

(export DB_URI="sqlite+aiosqlite:////$(pwd)/sqlite.db" TG_BOT_TOKEN_FILE="$(pwd)/secrets/tg_token.txt" && cd services/bot && python app.py)

With Docker Compose

docker compose up