Answer the question
In order to leave comments, you need to log in
Why does the Telegram bot not work and give a TypeError?
bot = telebot.TeleBot ( 'TOKEN' )
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
bot.reply_to(message, "Howdy, how are you doing?")
@bot.message_handler(func=lambda message: True)
def echo_all(message):
bot.reply_to(message, message.text)
bot.polling()
Traceback (most recent call last):
File "C:/Users/Vibe/PycharmProjects/untitled1/TelBot1/Telo.py", line 9, in <module>
def send_welcome(message):
TypeError: 'NoneType' object is not callable
Answer the question
In order to leave comments, you need to log in
What does the space before the parenthesis do here?
bot = telebot.TeleBot ( 'TOKEN' )
This problem remains....
402 (util.py:68 PollingThread) ERROR - TeleBot: "ConnectionError occurred, args=(MaxRetryError("SOCKSHTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /botTOKEN/getUpdates?offset=1&timeout=20 (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))")),)
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\urllib3\contrib\socks.py", line 99, in _new_conn
**extra_kw
File "C:\ProgramData\Anaconda3\lib\site-packages\socks.py" , line 180, in create_connection
for r in socket.getaddrinfo(proxy_addr, proxy_port, 0, socket.SOCK_STREAM):
File "C:\ProgramData\Anaconda3\lib\socket.py", line 752, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question