FAQ для КНИТУ-КАИ username tg: @FAQ_KAIBot
- git clone https://github.com/ayazzali/FAQ_KAI_Bot.git
- change token at config.py ( nano config.py ) or settings.ini if you already have it
- apt-get install python3
- apt-get install python3-pip
- pip3 install python-telegram-bot
- python3 start.py
- nano /etc/supervisor/supervisord.conf
- and type at the end this:
[program:kai_worker]
directory=/root/FAQ_KAI_Bot
command=python3 start.py
;command=nohup python3 start.py >>/root/FAQ_KAI_Bot/log.txt 2>&1
stdout_logfile=/var/log/kai_worker.log
stderr_logfile =/var/log/kai_worker.log
autostart=true
autorestart=true
user=root
stopsignal=KILL
numprocs=1
- do /etc/init.d/supervisor restart
- to check status use command supervisorctl
-
nano nano /etc/rc.local
-
and put:
- exec 2> /var/log/0KaiFaqBot_from_rc.local.log # send stderr from rc.local to a log file
- exec 1>&2 # send stdout to the same log file
- cd /root/FAQ_KAI_Bot
- nohup python3 start.py >> /root/FAQ_KAI_Bot/kaiBot.log &