diff --git a/src/modules/dreamspace/__init__.py b/src/modules/dreamspace/__init__.py new file mode 100644 index 0000000..ff9f558 --- /dev/null +++ b/src/modules/dreamspace/__init__.py @@ -0,0 +1,8 @@ +import logging + +logger = logging.getLogger(__name__) + + +async def setup(bot): + from .cog import DreamCog + await bot.add_cog(DreamCog(bot)) diff --git a/src/modules/dreamspace/cog.py b/src/modules/dreamspace/cog.py new file mode 100644 index 0000000..b3d2bf5 --- /dev/null +++ b/src/modules/dreamspace/cog.py @@ -0,0 +1,53 @@ +import asyncio + +import discord +from discord import app_commands as appcmds +from discord.ext import commands as cmds + +from meta import LionCog, LionBot, LionContext +from meta.logger import log_wrap +from utils.lib import utc_now + +from . import logger + + +class DreamCog(LionCog): + """ + Discord-facting interface for Dreamspace Adventures + """ + + def __init__(self, bot: LionBot): + self.bot = bot + self.data = bot.core.datamodel + + async def cog_load(self): + pass + + @log_wrap(action="Dreamer migration") + async def migrate_dreamer(self, source_profile, target_profile): + """ + Called when two dreamer profiles need to merge. + + For example, when a user links a second twitch profile. + + :TODO-MARKER: + Most of the migration logic is simple, e.g. just update the profileid + on the old events to the new profile. + The same applies to transactions and probably to inventory items. + However, there are some subtle choices to make, such as what to do + if both the old and the new profile have an active specimen? + A profile can only have one active specimen at a time. + There is also the question of how to merge user preferences, when those exist. + """ + ... + + # User command: view their dreamer card, wallet inventory etc + + # (Admin): View events/documents matching certain criteria + + # (User): View own event cards with info? + + # (User): View Specimen + + + diff --git a/src/modules/dreamspace/events.py b/src/modules/dreamspace/events.py new file mode 100644 index 0000000..573c7db --- /dev/null +++ b/src/modules/dreamspace/events.py @@ -0,0 +1,36 @@ +from datamodels import DataModel + + +class Event: + _typs = {} + + def __init__(self, event_row: DataModel.Events, **kwargs): + self.row = event_row + + def __getattribute__(self, name: str): + ... + + async def get_document(self): + ... + + async def get_user(self): + ... + + +class Document: + def as_bytes(self): + ... + + async def get_stamps(self): + ... + + async def refresh(self): + ... + + +class User: + ... + + +class Stamp: + ... diff --git a/src/modules/dreamspace/ui/eventviewer.py b/src/modules/dreamspace/ui/eventviewer.py new file mode 100644 index 0000000..e69de29