Files
Pac-cogs/videoarchiver/__init__.py
pacnpal 01a9067368 Added proper command validation in the on_message event handler to prevent interference with command processing
Added missing asyncio import in events.py
Ensured all long-running operations are handled in background tasks
Fixed task initialization and management in base.py
2024-11-16 01:04:08 +00:00

27 lines
742 B
Python

"""VideoArchiver cog for Red-DiscordBot"""
from redbot.core.bot import Red
import asyncio
import logging
from .core.base import VideoArchiver
from .exceptions import ProcessingError
logger = logging.getLogger("VideoArchiver")
async def setup(bot: Red) -> None:
"""Load VideoArchiver."""
try:
cog = VideoArchiver(bot)
await bot.add_cog(cog)
except Exception as e:
logger.error(f"Failed to load VideoArchiver: {str(e)}")
raise
async def teardown(bot: Red) -> None:
"""Clean up when unloading."""
try:
if "VideoArchiver" in bot.cogs:
await bot.remove_cog("VideoArchiver")
except Exception as e:
logger.error(f"Error during teardown: {str(e)}")
raise