[Mod] Only loop through guilds in config when checking tempbans (#4907)

* [Mod] No longer loop through all guilds on check_tempban_expirations.

* Address Jack's review.

* I don't think this comment actually served any purpose

* Split this into more methods

* Small optimization for cases where the guild tempbans weren't updated

* Blackify

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
PredaaA
2021-04-03 23:59:41 +02:00
committed by GitHub
parent edbd31413b
commit 363a2e8a17
2 changed files with 55 additions and 35 deletions

View File

@@ -80,7 +80,7 @@ class Mod(
self.config.register_member(**self.default_member_settings)
self.config.register_user(**self.default_user_settings)
self.cache: dict = {}
self.tban_expiry_task = self.bot.loop.create_task(self.check_tempban_expirations())
self.tban_expiry_task = asyncio.create_task(self.tempban_expirations_task())
self.last_case: dict = defaultdict(dict)
self._ready = asyncio.Event()