working on new api changes into task
This commit is contained in:
parent
1e35751860
commit
4e3dc174cb
@ -16,7 +16,7 @@ from discord.errors import Forbidden
|
||||
from sqlalchemy import insert, select, and_
|
||||
from feedparser import parse
|
||||
|
||||
from feed import Source, Article, RSSFeed
|
||||
from feed import Source, Article, RSSFeed, Subscription, SubscriptionChannel
|
||||
from db import (
|
||||
DatabaseManager,
|
||||
FeedChannelModel,
|
||||
@ -90,10 +90,20 @@ class TaskCog(commands.Cog):
|
||||
|
||||
async with aiohttp.ClientSession() as session:
|
||||
api = API(self.bot.api_token, session)
|
||||
data, count = await api.get_rssfeed_list(discord_server_id__in=guild_ids)
|
||||
rssfeeds = RSSFeed.from_list(data)
|
||||
for item in rssfeeds:
|
||||
log.info(item.name)
|
||||
sub_data = api.get_subscriptions(server__in=guild_ids)
|
||||
subscriptions = Subscriptions.from_list(sub_data)
|
||||
|
||||
for sub in subscriptions:
|
||||
channel_data = api.get_subscription_channels(subscription__uuid=sub.uuid)
|
||||
channels = SubscriptionChannel.from_list(channel_data)
|
||||
|
||||
|
||||
# async with aiohttp.ClientSession() as session:
|
||||
# api = API(self.bot.api_token, session)
|
||||
# data, count = await api.get_rssfeed_list(discord_server_id__in=guild_ids)
|
||||
# rssfeeds = RSSFeed.from_list(data)
|
||||
# for item in rssfeeds:
|
||||
# log.info(item.name)
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user