The project was created for sales via telegram bot with CMS Moltin.
-
Python3 should already be installed.
-
Use
pip
(orpip3
, there is a conflict with Python2) to install the dependencies:
pip install -r requirements.txt
-
It is recommended to use virtualenv/venv to isolate the project.
-
Register store on Moltin, get
store id
,client id
,client secret
and add them to file.env
under the namesMOLT_STORE_ID
,MOLT_CLIENT_ID
,MOLT_CLIENT_SECRET
. Warn: they will interview you before registering. -
To work with Telegram you need:
- Enable
VPN
if the messenger is blocked in your country; - Get
bot token
and put it in.env
under the nameTG_BOT_TOKEN
, more about that here; - Get
bot token
for the bot logger required to track bot errors. Put it in.env
under the nameTG_LOG_BOT_TOKEN
. - Get your
id
from@userinfobot
and put in.env
asTG_CHAT_ID
- Enable
-
Get a free database on redislabs.com, get the host, port and password from the database and put them in
.env
under the namesDB_HOST
,DB_PORT
andDB_PASSWORD
. -
Run the file
tg_bot.py
.
This code is written for educational purposes on the online course for web developers dvmn.org.