Sfoglia il codice sorgente

possibly fixed task error

master
Haku 4 anni fa
parent
commit
e51a7c671d
2 ha cambiato i file con 4 aggiunte e 5 eliminazioni
  1. +3
    -2
      founderlessnotify/__init__.py
  2. +1
    -3
      founderlessnotify/founderlessnotify.py

+ 3
- 2
founderlessnotify/__init__.py Vedi File

@@ -1,7 +1,8 @@
from .founderlessnotify import FounderlessNotify
from redbot.core.bot import Red


def setup(bot):
def setup(bot: Red):
cog = FounderlessNotify(bot)
bot.add_cog(cog)
bot.loop.create_task(cog.bg_loop())

+ 1
- 3
founderlessnotify/founderlessnotify.py Vedi File

@@ -58,11 +58,9 @@ class FounderlessNotify(commands.Cog):
self.config = Config.get_conf(self, identifier=82732344, force_registration=True)
default_global_settings = {'update_time': 0, 'previous_founderless': [], 'notify_channel': 0}
self.config.register_global(**default_global_settings)
self.bg_loop_task = asyncio.create_task(self.bg_loop())

def cog_unload(self):
if self.bg_loop_task:
self.bg_loop_task.cancel()
pass

@commands.command()
@checks.is_owner()


Caricamento…
Annulla
Salva