diff options
author | Parker <contact@pkrm.dev> | 2025-04-03 17:42:44 -0500 |
---|---|---|
committer | Parker <contact@pkrm.dev> | 2025-04-03 17:42:44 -0500 |
commit | 4a03653c139f3f48bb7294e7c7b4911f3c130c61 (patch) | |
tree | 3f844c82dfeaf18a12071006f82991a13e0d7ef0 | |
parent | 1c58d5e215837a02fc850fa25563931ede953c93 (diff) |
Save message IDs
-rw-r--r-- | models.py | 1 | ||||
-rw-r--r-- | src/cogs/archive.py | 1 | ||||
-rw-r--r-- | src/schemas/message_schema.py | 1 |
3 files changed, 3 insertions, 0 deletions
@@ -8,6 +8,7 @@ class Message(Base): id = Column(Integer, primary_key=True, autoincrement=True) timestamp = Column(String, nullable=False) + message_id = Column(Integer, nullable=False) author_id = Column(Integer, nullable=False) channel_id = Column(Integer, nullable=False) stickers = Column(JSON, nullable=False, default=list) diff --git a/src/cogs/archive.py b/src/cogs/archive.py index 5e80709..51adbdf 100644 --- a/src/cogs/archive.py +++ b/src/cogs/archive.py @@ -105,6 +105,7 @@ class Archive(commands.Cog): db_message = Message( timestamp=message.created_at.isoformat(), + message_id=message.id, author_id=message.author.id, channel_id=channel.id, stickers=[sticker.name for sticker in message.stickers], diff --git a/src/schemas/message_schema.py b/src/schemas/message_schema.py index 1738f3b..e135a2e 100644 --- a/src/schemas/message_schema.py +++ b/src/schemas/message_schema.py @@ -3,6 +3,7 @@ from pydantic import BaseModel class Message(BaseModel): timestamp: str + message_id: int author_id: int channel_id: int stickers: list[str] |