Как запустить PyTelegramBotApi на Django
Я использую pytelegrambotapi для запуcка бота на django командой "python3 manage.py bot" запускается команда без ошибок, но ничего не происходит. Вот весь когд бота.
from django.core.management.base import BaseCommand
import telebot
TOKEN = '*********:AAEuvYEQg1IKJX9GXeYIniQB1wmj84J4Q4o'
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def send_welcome(message):
bot.reply_to(message.chat.id, 'Привет!')
@bot.message_handler(func=lambda m: True)
def echo_all(message):
bot.reply_to(message, message.text)
class Command(BaseCommand):
help = 'Телеграм-бот'
def handle(self, *args, **options):
bot = telebot.TeleBot(token=TOKEN)
bot.get_updates(timeout=15)
bot.polling()