tuxbot-bot/cogs/utils/models/warn.py
Romain J 76e845e5be refactor(command|sondage): continue rewrite of sondage
known issues: datas are not commited in database on reaction on
2019-10-06 01:49:30 +02:00

21 lines
623 B
Python

import datetime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, BIGINT, TIMESTAMP
Base = declarative_base()
class Warn(Base):
__tablename__ = 'warns'
id = Column(Integer, primary_key=True)
server_id = Column(BIGINT)
user_id = Column(BIGINT)
reason = Column(String)
created_at = Column(TIMESTAMP, default=datetime.datetime.now())
def __repr__(self):
return "<Warn(server_id='%s', user_id='%s', reason='%s', " \
"created_at='%s')>" \
% (self.server_id, self.user_id, self.reason, self.created_at)