import functools

from snek.model.channel import ChannelModel
from snek.model.channel_member import ChannelMemberModel

# from snek.model.channel_message import ChannelMessageModel
from snek.model.channel_message import ChannelMessageModel
from snek.model.user import UserModel
from snek.system.object import Object


@functools.cache
def get_models():
    return Object(
        **{
            "user": UserModel,
            "channel_member": ChannelMemberModel,
            "channel": ChannelModel,
            "channel_message": ChannelMessageModel,
        }
    )


def get_model(name):
    return get_models()[name]
