configurable bot token

This commit is contained in:
2019-01-19 09:52:00 +03:00
parent 33ff1b800b
commit 999c6af8e7
20 changed files with 154 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
from django.utils import timezone
from telebot import TeleBot
from djconfig import config
from config.celery import app
@@ -15,7 +16,7 @@ def execute_feed(feed_pk):
feed.lock = True
feed.save()
bot = TeleBot('450146961:AAFcb9tyIiKAi6BHR1ZYfWuTEkYjhO3xEFE')
bot = TeleBot(config.feed_bot_token)
feed.last_id = feed.config.execute(bot, feed.chat_id, feed.last_id)
feed.last_check = timezone.now()
feed.save()