D
D
Donald2019-09-08 10:25:32
Python
Donald, 2019-09-08 10:25:32

AttributeError: 'Bot' object has no attribute 'polling'?

I run the script:

import telegram
import config

bot = telegram.Bot(config.token)

chat_id = '@юзернейм чата'
chat_text = 'some text'
bot.send_message(chat_id=chat_id, text=chat_text)

bot.polling(none_stop=True)

A message arrives, but an error still occurs and the script stops working. Mistake:
$ python bot.py
Traceback (most recent call last):
  File "bot.py", line 10, in <module>
    bot.polling(none_stop=True)
AttributeError: 'Bot' object has no attribute 'polling'

I'm not strong in python...

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question