diff --git a/classes/holo_user.py b/classes/holo_user.py index 80e87bf..fb1cc35 100644 --- a/classes/holo_user.py +++ b/classes/holo_user.py @@ -7,53 +7,11 @@ from pyrogram.errors import bad_request_400 from dateutil.relativedelta import relativedelta from classes.errors.geo import PlaceNotFoundError from classes.errors.holo_user import UserInvalidError, UserNotFoundError, LabelTooLongError, LabelSettingError +from classes.templates import DefaultApplicationTemp, DefaultSponsorshipTemp from modules.database import col_tmp, col_users, col_applications, col_sponsorships, col_messages, col_spoilers from modules.logging import logWrite from modules.utils import configGet, find_location, locale, should_quote -class DefaultApplicationTemp(dict): - def __init__(self, user: int, reapply: bool = False): - super().__init__({}) - self.dict = { - "user": user, - "type": "application", - "complete": False, - "sent": False, - "state": "fill", - "reapply": reapply, - "stage": 1, - "application": { - "1": None, - "2": None, - "3": None, - "4": None, - "5": None, - "6": None, - "7": None, - "8": None, - "9": None, - "10": None - } - } - -class DefaultSponsorshipTemp(dict): - def __init__(self, user: int): - super().__init__({}) - self.dict = { - "user": user, - "type": "sponsorship", - "complete": False, - "sent": False, - "state": "fill", - "stage": 1, - "sponsorship": { - "streamer": None, - "expires": datetime.fromtimestamp(0), - "proof": None, - "label": "" - } - } - class HoloUser(): """This object represents a user of HoloChecker bot. It is primarily used to interact with a database in a more python-friendly way, diff --git a/classes/templates.py b/classes/templates.py new file mode 100644 index 0000000..08a848b --- /dev/null +++ b/classes/templates.py @@ -0,0 +1,46 @@ +"""Templates for temporary application/sponsorship records""" + +from datetime import datetime + +class DefaultApplicationTemp(dict): + def __init__(self, user: int, reapply: bool = False): + super().__init__({}) + self.dict = { + "user": user, + "type": "application", + "complete": False, + "sent": False, + "state": "fill", + "reapply": reapply, + "stage": 1, + "application": { + "1": None, + "2": None, + "3": None, + "4": None, + "5": None, + "6": None, + "7": None, + "8": None, + "9": None, + "10": None + } + } + +class DefaultSponsorshipTemp(dict): + def __init__(self, user: int): + super().__init__({}) + self.dict = { + "user": user, + "type": "sponsorship", + "complete": False, + "sent": False, + "state": "fill", + "stage": 1, + "sponsorship": { + "streamer": None, + "expires": datetime.fromtimestamp(0), + "proof": None, + "label": "" + } + } \ No newline at end of file