Compare commits

...

2 Commits

@ -6,4 +6,4 @@ from .announcedaily import AnnounceDaily
def setup(bot: Red):
daily = AnnounceDaily(bot)
bot.add_cog(daily)
bot.loop.create_task(daily.check_day())
daily.announce_task = bot.loop.create_task(daily.check_day())

@ -1,6 +1,8 @@
import asyncio
import random
from asyncio import Task
from datetime import datetime, timedelta
from typing import Optional
import discord
from redbot.core import Config, checks, commands
@ -38,10 +40,16 @@ class AnnounceDaily(Cog):
self.config.register_global(**default_global)
self.config.register_guild(**default_guild)
self.announce_task = None
async def red_delete_data_for_user(self, **kwargs):
"""Nothing to delete"""
return
def cog_unload(self):
if self.announce_task is not None:
self.announce_task.cancel()
async def _get_msgs(self):
return DEFAULT_MESSAGES + await self.config.messages()

Loading…
Cancel
Save