Skeleton module structure.

This commit is contained in:
2025-06-13 23:50:28 +10:00
parent 092e818990
commit 8e2bd67efc
4 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import logging
logger = logging.getLogger(__name__)
async def setup(bot):
from .cog import DreamCog
await bot.add_cog(DreamCog(bot))

View File

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

View File

@@ -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:
...

View File