mirror of https://github.com/stijndcl/didier
23 lines
495 B
Python
23 lines
495 B
Python
from abc import ABC, abstractmethod
|
|
|
|
import discord
|
|
from pydantic import BaseModel
|
|
|
|
__all__ = [
|
|
"EmbedBaseModel",
|
|
"EmbedPydantic",
|
|
]
|
|
|
|
|
|
class EmbedBaseModel(ABC):
|
|
"""Abstract base class for a model that can be turned into a Discord embed"""
|
|
|
|
@abstractmethod
|
|
def to_embed(self) -> discord.Embed:
|
|
"""Turn this model into a Discord embed"""
|
|
raise NotImplementedError
|
|
|
|
|
|
class EmbedPydantic(ABC, EmbedBaseModel, BaseModel):
|
|
"""Pydantic version of EmbedModel"""
|