Answer the question
In order to leave comments, you need to log in
Gives a bunch of errors when writing a bot in Python. What to do?
I'm new in this business, please don't swear too much)))
Code:
import telebot
API_TOKEN = 'my token (it's here in the code)'
bot = telebot.TeleBot(API_TOKEN)
@bot.message_handler(commands='start')
def send_welcome(message):
bot.reply_to(message.chat.id, "Hi, I'm a feature test bot")
@bot.message_handler(commands='help')
def send_help(message):
bot.send_message(message.chat.id, "What can I do for you?")
@bot.message_handler( func=lambda m: True)
def echo_all(message):
if message.text == 'Hi':
bot.send_message(message.chat.id, 'Hi man!')
elif message.text == 'hi':
bot.send_message(message.chat.id, 'Hello, man!'
bot.polling()
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