diff --git a/template/__init__.py b/template/__init__.py new file mode 100644 index 0000000..0051a70 --- /dev/null +++ b/template/__init__.py @@ -0,0 +1,13 @@ +import json +from pathlib import Path + +from redbot.core.bot import Red + +from .template import TemplateManager + +with open(Path(__file__).parent / "info.json") as fp: + __red_end_user_data_statement__ = json.load(fp)["end_user_data_statement"] + + +async def setup(bot: Red) -> None: + await bot.add_cog(TemplateManager(bot)) diff --git a/template/info.json b/template/info.json new file mode 100644 index 0000000..e79e8cc --- /dev/null +++ b/template/info.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://raw.githubusercontent.com/Cog-Creators/Red-DiscordBot/V3/develop/schema/red_cog.schema.json", + "name": "TemplateManager", + "short": "A cog to help with server template management.", + "description": "This cog helps to load and save a server's template. This cog does not yet help to build, find, or sync templates.", + "end_user_data_statement": "This cog does not persistently store any data or metadata about users.", + "install_msg": "Sorry there is not a lot of documentation, maybe check the code comments.", + "author": [ + "Ezekiel" + ], + "required_cogs": {}, + "requirements": [], + "tags": [ + "red", + "templates" + ], + "min_bot_version": "3.5.0", + "hidden": false, + "disabled": false, + "type": "COG" +} diff --git a/template/template.py b/template/template.py new file mode 100644 index 0000000..7988b8c --- /dev/null +++ b/template/template.py @@ -0,0 +1,27 @@ +from typing import Literal + +from redbot.core import commands +from redbot.core.bot import Red +from redbot.core.config import Config + +RequestType = Literal["discord_deleted_user", "owner", "user", "user_strict"] + + +class TemplateManager(commands.Cog): + """ + A cog to help with server template management. + """ + + def __init__(self, bot: Red) -> None: + self.bot = bot + self.config = Config.get_conf( + self, + identifier=90052573731772, + force_registration=True, + ) + + async def red_delete_data_for_user( + self, *, requester: RequestType, user_id: int + ) -> None: + # TODO: Replace this with the proper end user data removal handling. + super().red_delete_data_for_user(requester=requester, user_id=user_id)