from peewee import TextField, IntegerField, DateTimeField import datetime from base import BaseModel class User(BaseModel): username = TextField() display_name = TextField() discord_id = TextField() level = IntegerField() exp = IntegerField() currency = IntegerField() message_count = IntegerField() joined_date = DateTimeField(default=datetime.datetime.now) exp_gained_time = DateTimeField(default=datetime.datetime.now) daily_gained_time = DateTimeField(default=datetime.datetime.now) def add_coins(self, additional_coins: int): self.currency = self.currency + additional_coins def remove_coins(self, lost_coins: int): self.currency = self.currency - lost_coins