From 5e3610818620eaddb0b1c4af1d8dd8438156770f Mon Sep 17 00:00:00 2001 From: flifloo Date: Thu, 28 May 2020 17:34:09 +0200 Subject: [PATCH] Fix Task DB object date and creation_date type --- db/Task.py | 6 +++--- extensions/reminders.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/Task.py b/db/Task.py index dae228c..b39c7df 100644 --- a/db/Task.py +++ b/db/Task.py @@ -1,5 +1,5 @@ from db import Base -from sqlalchemy import Column, Integer, String, BigInteger, Date +from sqlalchemy import Column, Integer, String, BigInteger, DateTime from datetime import datetime @@ -9,8 +9,8 @@ class Task(Base): message = Column(String, nullable=False) user = Column(BigInteger, nullable=False) channel = Column(BigInteger, nullable=False) - date = Column(Date, nullable=False) - creation_date = Column(Date, default=datetime.now()) + date = Column(DateTime, nullable=False) + creation_date = Column(DateTime, default=datetime.now()) def __init__(self, message: str, user: int, channel: int, date: datetime): self.message = message diff --git a/extensions/reminders.py b/extensions/reminders.py index 4c87439..d55e58f 100644 --- a/extensions/reminders.py +++ b/extensions/reminders.py @@ -99,7 +99,7 @@ class Reminders(commands.Cog): embed = Embed(title="You have a reminder !") user = self.bot.get_user(task.user) embed.set_author(name=f"{user.name}#{user.discriminator}", icon_url=user.avatar_url) - embed.add_field(name=str(task.date), value=task.message) + embed.add_field(name=str(task.creation_date), value=task.message) await (await self.bot.get_channel(task.channel).send(f"{user.mention}", embed=embed)).edit(content="") @commands.Cog.listener()