A
A
Adil9502020-04-19 16:54:56
Python
Adil950, 2020-04-19 16:54:56

Can you help with python bot?

I'm a beginner, I made my first bot, monitoring the coronavirus, it works well, but when you click let's say "countries", This is Russia, Ukraine, etc., it always crashes, although it sends the correct answer. Here is the code: https://hastebin.com/elihakodiq.py And when I click "all countries", the program does not crash. What is the problem? At the end, I wrote bot.polling(none_stop=True, timeout=60), but it did not help , I
used modules requests==2.23.0
covid==2.1.3
pyTelegramBotAPI==3.6.7
translate==3.5.0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
o5a, 2020-04-19
@o5a

Because print uses message.from_user.last_name which is not always present (i.e. may be None).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question