P
P
Python Newbie2021-07-19 13:21:59
Python
Python Newbie, 2021-07-19 13:21:59

Console doesn't work. What to do?

Hello.

I wrote a python script. It is located in C:\Users\Home\Desktop\Py\telega

I open the console. Writing

Microsoft Windows [Version 10.0.17763.2061]
(c) Корпорация Майкрософт (Microsoft Corporation), 2018. Все права защищены.

C:\Users\Дом>cd C:\Users\Дом\Desktop\Py\telega

C:\Users\Дом\Desktop\Py\telega>python telegabot.py

C:\Users\Дом\Desktop\Py\telega>


When you press enter, nothing happens.

The code:
import telebot
import config

bot = telebot.telebot(config.TOKEN)

@bot.message_handler(content_types=['text'])
def lol(message):
  

bot.pulling(none_stop=True)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2021-07-19
@twistfire92

Crashes with an error and closes.
Firstly, polling must be written correctly, as noted in the comments.
Second, you don't have a function body lol. If you want it to do nothing at all, write pass in the body of the function .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question