From 8664c883a51ef5565911d0a875549a913e63b695 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sun, 7 Jan 2024 14:01:27 +0000 Subject: [PATCH] fix(updatechecker): use discord.ext tasks --- updatechecker/updatechecker.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/updatechecker/updatechecker.py b/updatechecker/updatechecker.py index dada2a8..4a95fc0 100644 --- a/updatechecker/updatechecker.py +++ b/updatechecker/updatechecker.py @@ -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