Answer the question
In order to leave comments, you need to log in
Telegram bot not working, why?
Hello everyone
, I have a problem. When creating the first Telegram bot in python, I ran into one problem, my bot did NOT react to anything
pip list
certifi 2021.10.8
charset-normalizer 2.0.9
idna 3.3
pip 21.3.1
pyTelegramBotAPI 4.2.2
requests 2.26.0
setuptools 58.1. 0
urllib3 1.26.7
code
import telebot;
from telebot import types
TOKEN = '5004045280:AAHH9q5bg5H4CI7chlaJJC7mQAl8LZgcpd0'
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(content_types=['text'])
def send_text(message):
if message.text.lower() == 'Hello ':
bot.send_message(message.chat.id, 'Hello my creator')
elif message.text.lover() == 'Bye':
bot.send_message(message.chat.id, 'Goodbye creator')
bot.polling ()
when I drive the script run:
C:\Users\defaultuser0>python HQDBot2021.py
C:\Users\defaultuser0>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question