V
V
Valery2020-04-15 01:19:52
linux
Valery, 2020-04-15 01:19:52

How to run a Telegram bot on a VPS server?

When starting the Telegram bot, it gives an error:
5e963a36629e5391367595.png
Since I'm working with Linux for the first time, I followed the instructions of the person from habr https://habr.com/en/post/347106/
Even when systemctl writes that the bot is active in the telegram, nothing works, and after repeated entering the systemctl status bot command gives the same error.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Valery, 2020-04-15
@ApXNTekToP

Thank you all for your help! The problem is solved, I installed Ubuntu 18.04, and also updated python to version 3.6.9.
5e96eda88089b446729755.png

P
paran0id, 2020-04-15
@paran0id

journalctl -u botwill show what the bot said before dying. systemctl says that the bot is active, because, apparently, it does not die immediately, but restarts after the fall (auto-restart)

A
Alexander, 2020-04-15
@shabelski89

since there is no knowledge to embed a logger, run the bot not through a unit, but directly.
an error will be displayed in the console with which the bot falls. then either google or paste the error here. check your python version to see if you have features that are not yet supported by your version. as f'string' example since 3.6
/usr/bin/python3 /usr/local/bin/bot/bot.py
python3 -V

I
Ivan Shumov, 2020-04-15
@inoise

The console says it's a syntax error. White on black. Go and check what's wrong there, and without a configuration, you can only poke your fingers into this problem and send it back to figure it out

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question