move feeds to ptb

This commit is contained in:
2021-03-20 16:21:13 +03:00
parent b35d2ca251
commit e72cb9a453
12 changed files with 38 additions and 52 deletions

View File

@@ -4,8 +4,8 @@ import sentry_sdk
from celery_once import QueueOnce
from django.utils import timezone
from django.core.cache import cache
from telebot import TeleBot
from djconfig import config
from telegram import Bot
from config.celery import app
@@ -33,7 +33,7 @@ def execute_feed(feed_pk):
with sentry_sdk.configure_scope() as scope:
scope.set_tag('feed', str(feed))
try:
bot = TeleBot(config.feed_bot_token, threaded=False)
bot = Bot(config.feed_bot_token)
print(f'Last ID for "{feed}" = "{feed.last_id}"')
for last_id in feed.config.execute(bot, feed.chat_id, feed.last_id):
if last_id: