B
B
bilachayka2021-08-29 11:52:56
Python
bilachayka, 2021-08-29 11:52:56

Telegram bot in python does not work. What should be done?

Here is the code that I wrote (through the command line it does not give any errors):

import telebot
import config
import random
 
from telebot import types
 
bot = telebot.TeleBot(config.TOKEN)
 
@bot.message_handler(commands=['start'])
def welcome(message):
    bot.send_message(message.chat.id, "ТЕКСТ")


bot.polling(none_stop=True)

in the config there is a token

in the telegram when you press start, there is no response, and even when writing any words and commands.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mashincode, 2021-08-29
@mashincode

1) Show what pip freeze gives you
2) Do you have a strange tab for the welcome function, do you have indents in your code?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question