# Path: modnotes/apsw_wrapper.py
# class Connection(apsw.Connection, ContextManagerMixin):
#     pass
# 
# Path: modnotes/converters.py
# class MemberOrID(NamedTuple):
#     member: Optional[discord.Member]
#     id: int
# 
#     @classmethod
#     async def convert(cls, ctx: Context, argument: str):
# 
#         with contextlib.suppress(Exception):
#             m = await _discord_member_converter_instance.convert(ctx, argument)
#             return cls(m, m.id)
# 
#         match = _id_regex.match(argument) or _mention_regex.match(argument)
#         if match:
#             return cls(None, int(match.group(1)))
# 
#         raise BadArgument()


import asyncio
import logging
import discord
from datetime import datetime
from typing import Iterator, Literal, NamedTuple, Optional
from redbot.core import checks, commands
from redbot.core.bot import Red
from redbot.core.data_manager import cog_data_path
from redbot.core.utils import menus
from .apsw_wrapper import Connection
from .converters import MemberOrID
        e.add_field(name="Note Subject", value=s_str)
        return e


class ModNotes(commands.Cog):
    """
    Store moderation notes
    """

    __version__ = "340.0.0"

    async def red_delete_data_for_user(
        self,
        *,
        requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
        user_id: int,
    ):
        if requester != "discord_deleted_user":
            return
        await self.bot.send_to_owners(
            f"Data deletion request for `ModNotes` by {requester} for user id {user_id}."
        )

    def format_help_for_context(self, ctx):
        pre_processed = super().format_help_for_context(ctx)
        return f"{pre_processed}\nCog Version: {self.__version__}"

    def __init__(self, bot: Red):
        self.bot: Red = bot
        fp = str(cog_data_path(self) / "notes.db")

# Path: modnotes/apsw_wrapper.py
# class Connection(apsw.Connection, ContextManagerMixin):
#     pass
# 
# Path: modnotes/converters.py
# class MemberOrID(NamedTuple):
#     member: Optional[discord.Member]
#     id: int
# 
#     @classmethod
#     async def convert(cls, ctx: Context, argument: str):
# 
#         with contextlib.suppress(Exception):
#             m = await _discord_member_converter_instance.convert(ctx, argument)
#             return cls(m, m.id)
# 
#         match = _id_regex.match(argument) or _mention_regex.match(argument)
#         if match:
#             return cls(None, int(match.group(1)))
# 
#         raise BadArgument()


# Path: modnotes/modnotes.py
import asyncio
import logging
import discord
from datetime import datetime
from typing import Iterator, Literal, NamedTuple, Optional
from redbot.core import checks, commands
from redbot.core.bot import Red
from redbot.core.data_manager import cog_data_path
from redbot.core.utils import menus
from .apsw_wrapper import Connection
from .converters import MemberOrID

        e.add_field(name="Note Subject", value=s_str)
        return e


class ModNotes(commands.Cog):
    """
    Store moderation notes
    """

    __version__ = "340.0.0"

    async def red_delete_data_for_user(
        self,
        *,
        requester: Literal["discord_deleted_user", "owner", "user", "user_strict"],
        user_id: int,
    ):
        if requester != "discord_deleted_user":
            return
        await self.bot.send_to_owners(
            f"Data deletion request for `ModNotes` by {requester} for user id {user_id}."
        )

    def format_help_for_context(self, ctx):
        pre_processed = super().format_help_for_context(ctx)
        return f"{pre_processed}\nCog Version: {self.__version__}"

    def __init__(self, bot: Red):
        self.bot: Red = bot
        fp = str(cog_data_path(self) / "notes.db")

        self._connection = Connection(fp)