Initial commit of template cog.

main
Ezekiel Grave 2024-03-02 10:20:11 -08:00
parent ad26506c3c
commit 1ead8161e1
3 changed files with 61 additions and 0 deletions

13
template/__init__.py Normal file
View File

@ -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))

21
template/info.json Normal file
View File

@ -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"
}

27
template/template.py Normal file
View File

@ -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)