fix(updatechecker): use discord.ext tasks

This commit is contained in:
Seaswimmer 2024-01-07 14:01:27 +00:00
parent 0695dc061e
commit 8664c883a5
Signed by untrusted user: cswimr
GPG key ID: D74DDDDF420E13DF

View file

@ -36,6 +36,7 @@ from urllib.parse import urlparse
import aiohttp
import discord
from discord.ext import tasks
from redbot.cogs.downloader.repo_manager import Repo
from redbot.core import Config, commands
from redbot.core.utils.chat_formatting import box, humanize_list, inline
@ -72,10 +73,8 @@ class UpdateChecker(commands.Cog):
"""This cog does not store user data"""
return
@tasks.loop(minutes=1)
async def bg_task(self):
await self.bot.wait_until_ready()
# Just in case
await asyncio.sleep(10)
while True:
cog = self.bot.get_cog("Downloader")
if cog is not None:
@ -246,7 +245,6 @@ class UpdateChecker(commands.Cog):
pass
await asyncio.sleep(1)
await self.conf.repos.set(saving_dict)
await asyncio.sleep(60)
async def fetch_feed(self, url: str):
# Thank's to Sinbad's rss cog after which I copied this