import telebot
import os
from time import sleep
bot = telebot.TeleBot("TOKEN", parse_mode=None)
@bot.message_handler(commands=['str'])
def send_welcome(message):
a = 0
while True:
print(a)
a = a + 1
sleep(1)
@bot.message_handler(commands=['stp'])
def stop_command(message):
тут должно быть прописано, что бы программа остановила свою работу
bot.polling()
import telebot
import os
from time import sleep
import sys
bot = telebot.TeleBot("TOKEN", parse_mode=None)
@bot.message_handler(commands=['str'])
def send_welcome(message):
a = 0
while True:
print(a)
a = a + 1
sleep(1)
@bot.message_handler(commands=['stp'])
def stop_command(message):
print("ok")
bot.stop_polling()
bot.polling()