slow down checking so maybe it doesnt 404 as much
This commit is contained in:
parent
4b55b0e6f7
commit
e978ed6643
1 changed files with 4 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
from cogs.base_cog.bot_base_cog import BotBaseCog
|
from cogs.base_cog.bot_base_cog import BotBaseCog
|
||||||
import feedparser
|
import feedparser
|
||||||
|
import asyncio
|
||||||
|
|
||||||
class RSSCog(BotBaseCog):
|
class RSSCog(BotBaseCog):
|
||||||
|
|
||||||
|
|
@ -12,7 +13,7 @@ class RSSCog(BotBaseCog):
|
||||||
self.last_items = {key: None for key in self.usernames}
|
self.last_items = {key: None for key in self.usernames}
|
||||||
self.check_rss.start()
|
self.check_rss.start()
|
||||||
|
|
||||||
@tasks.loop(minutes=1)
|
@tasks.loop(minutes=5)
|
||||||
async def check_rss(self):
|
async def check_rss(self):
|
||||||
for name in self.usernames:
|
for name in self.usernames:
|
||||||
rss_url = self.rss_base_url + name.replace(' ','%20')
|
rss_url = self.rss_base_url + name.replace(' ','%20')
|
||||||
|
|
@ -24,6 +25,8 @@ class RSSCog(BotBaseCog):
|
||||||
channel = self.bot.get_channel(895388842834673696)
|
channel = self.bot.get_channel(895388842834673696)
|
||||||
await channel.send(f"{name}: {latest_item.description}")
|
await channel.send(f"{name}: {latest_item.description}")
|
||||||
|
|
||||||
|
asyncio.sleep(60)
|
||||||
|
|
||||||
@check_rss.before_loop
|
@check_rss.before_loop
|
||||||
async def before_check_rss(self):
|
async def before_check_rss(self):
|
||||||
await self.bot.wait_until_ready()
|
await self.bot.wait_until_ready()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue