Scream's off.
-
When the violin starts, it turns on for a second and turns off immediately. How can you fix that? (sighs)Just please answer without input and similar)
Video recording: https://disk.yandex.ru/i/YIj_IC6bD2OSCw
Code bot.py:
# -*- coding: utf-8 -*- # строка нужна, чтобы не было ошибки Non-UTF-8 code starting with '\xd1' in file ...
import telebot
from telebot import typesTOKENBOT = '123123124125125пквчпв'
bot = telebot.TeleBot(TOKENBOT)
@bot.message_handler(commands=['start'])
def text(message):
markup = types.InlineKeyboardMarkup(row_width=2)
item = types.InlineKeyboardButton("Вперёд", callback_data='sokr')
markup.add(item)
bot.send_sticker(message.chat.id, "CAACAgQAAxkBAAEDMaJhfpoCVPgHZ_OmGZX_Lh5uIGfTrAAC7QADD6r0B6meFwSQLxsBIQQ")
bot.send_message(message.chat.id, "Привет", reply_markup=markup)
-
You need to start a bot.infinity_polling() at the end of the crypt:
import telebot from telebot import types
TOKENBOT = '123123124125125пквчпв'
bot = telebot.TeleBot(TOKENBOT)
@bot.message_handler(commands=['start'])
def text(message):
markup = types.InlineKeyboardMarkup(row_width=2)
item = types.InlineKeyboardButton("Вперёд", callback_data='sokr')
markup.add(item)
bot.send_sticker(message.chat.id, "CAACAgQAAxkBAAEDMaJhfpoCVPgHZ_OmGZX_Lh5uIGfTrAAC7QADD6r0B6meFwSQLxsBIQQ")
bot.send_message(message.chat.id, "Привет", reply_markup=markup)bot.infinity_polling() # необходимая строчка
Recommended regenerating TOKENBOT after successful launch