An open source telegram bot with which you can find new acquaintances
Before installing this DatingBot-project you need to check if you have python
To check if you have python installed, run this command in your terminal:
$ python -V
If you get an answer like this, it means that Python
is installed.
$ Python 3.9.5
$ https://github.com/DavidRomanovizc/DatingBot.git
First you need to rename the file .env.dist
to .env
.
After that, you need to fill it with data.
Variable | Type | Importance |
---|---|---|
BOT_TOKEN | str | True |
ADMINS | list | True |
SUPPORTS | list | True |
IP | str | True |
DB_USER | str | True |
DB_PASS | str | True |
DB_HOST | str | True |
DB_NAME | str | True |
SECRET_KEY | str | True |
API_KEY | str | True |
BOT_TOKEN
- Bot token
ADMINS
- list of admins id
SUPPORTS
- list of admins id
IP
- ip for other services
DB_USER
- username of the database owner
DB_PASS
- password from the database
DB_HOST
- IP address of the database
DB_NAME
- database name
SECRET_KEY
- secret key for django
API_KEY
- yandex api key for yandex map
Install Django
$ pip install Django
To create a SECRET_KEY
you can use the site to generate secret keys
And then paste it into the .env
file
SECRET_KEY=jjv@^0qv^=aydunfjo$qpd_66j+)egm1#-c1iwt%mtjinm)ftj
Install the jazzmin
$ pip install -U django-jazzmin
Add jazzmin to your INSTALLED_APPS
before django.contrib.admin.
INSTALLED_APPS = [
'jazzmin',
'django.contrib.admin',
[...]
]
$ python django_app.py makemigrations
$ python django_app.py migrate
$ python django_app.py createsuperuser
$ python django_app.py runserver
And after that you need to run the file app.py
Before making changes to the project, create a new branch
We try to stick to PEP 8
- There must be no buttons in handlers (only in extreme cases, but it is better to put it in a separate file)
- If we make a handler for buttons, then we use the "text='action'" in the decorator parameters
- If we are fetching data or updating data, then the function call should be like this:
await db_commands.func(...)
- If you use the "default button", you need to put them in the "keyboard/default" directories.
- If you are creating a new file, then you should add the prefix "_default" to the filename
- If you use the "inline button", you need to put them in the "keyboard/inline" directories.
- If you are creating a new file, then you should add the prefix "_inline" to the filename
- If you are creating a new keyboard, then you should add the prefix "_keyboard" in the name function
License:
MIT License